/* OBS Motivational Popups - Frontend Styles - Refined & Beautiful */

/* 1. OVERLAY */
.obs-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.6);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.obs-popup-overlay.show {
    display: flex;
    opacity: 1;
}

.obs-popup-overlay.center {
    align-items: center;
    justify-content: center;
}

.obs-popup-overlay.top {
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}

.obs-popup-overlay.bottom {
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0;
}

/* 2. CONTAINER - Light tone background + Border */
.obs-popup-container {
    position: relative;
    /* User requested: Light tone background */
    background: #f9fafb; 
    border-radius: 24px;
    /* User requested: Border for popup */
    border: 1px solid #d1d5db; 
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    max-width: 95%; /* Safe max width */
    max-height: 95vh; /* Safe max height */
    overflow-y: auto;
    z-index: 9999;
    transform: scale(0.92);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
}

.obs-popup-overlay.bottom .obs-popup-container {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

.obs-popup-overlay.show .obs-popup-container {
    transform: scale(1);
    opacity: 1;
}

/* 3. CLOSE BUTTON */
.obs-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #555;
    transition: all 0.2s ease;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.obs-popup-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* Content Wrapper */
.obs-popup-content {
    padding: 50px 40px 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
    background: transparent; 
}

/* 4. SECTIONS (CARDS) - Motion + Glow + Border */
.obs-popup-section {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    /* User requested: Border for cards */
    border: 1px solid #e5e7eb; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    
    /* Animation Init */
    opacity: 0;
    transform: translateY(20px);
}

/* User requested: Hover movement + internal glow */
.obs-popup-section:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.08);
    /* Internal light glow */
    background: radial-gradient(circle at center, #ffffff 0%, #f3f4f6 100%);
    border-color: #cbd5e1;
}

/* STAGGERED ANIMATION */
.obs-popup-overlay.show .obs-popup-section {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.obs-popup-section:nth-child(1) { animation-delay: 0.1s; }
.obs-popup-section:nth-child(2) { animation-delay: 0.2s; }
.obs-popup-section:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.obs-popup-section.obs-section-editor {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #334155;
    line-height: 1.6;
}

.obs-popup-section.obs-section-editor h1, 
.obs-popup-section.obs-section-editor h2 {
    margin-top: 0;
    color: #111827;
    font-weight: 700;
}

/* HTML Section */
.obs-popup-section.obs-section-html {
    display: flex;
    flex-direction: column;
    align-items: center; 
}

/* 5. BUTTON - Uses Setting Color */
.obs-popup-section.obs-section-button {
    text-align: center;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 15px 0 0 0;
}

.obs-popup-button {
    display: inline-block;
    padding: 16px 45px;
    /* Uses the color from Admin Settings */
    background: var(--obs-btn-color, #2271b1);
    color: #fff !important;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Pulse Animation */
.obs-popup-overlay.show .obs-popup-button {
    animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.obs-popup-button:hover {
    transform: translateY(-3px) scale(1.05);
    filter: brightness(1.1); /* Make color slightly brighter */
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.3);
}

.obs-popup-button:active {
    transform: translateY(1px);
}

/* Container Animations */
.obs-popup-container.anim-fade { animation: obsFadeIn 0.5s ease forwards; }
@keyframes obsFadeIn { from { opacity: 0; } to { opacity: 1; } }

.obs-popup-container.anim-slide-up { animation: obsSlideUp 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards; }
@keyframes obsSlideUp { from { transform: translateY(80px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.obs-popup-container.anim-slide-down { animation: obsSlideDown 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards; }
@keyframes obsSlideDown { from { transform: translateY(-80px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.obs-popup-container.anim-zoom { animation: obsZoom 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards; }
@keyframes obsZoom { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
    .obs-popup-container {
        max-width: 95%;
        padding: 0;
    }
    .obs-popup-content {
        padding: 30px 20px;
    }
    .obs-popup-section {
        padding: 20px;
    }
    .obs-popup-close {
        top: 10px; right: 10px;
    }
    .obs-popup-button {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Scrollbar */
.obs-popup-container::-webkit-scrollbar { width: 6px; }
.obs-popup-container::-webkit-scrollbar-track { background: transparent; }
.obs-popup-container::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

body.obs-popup-open { overflow: hidden; }