/**
 * Site Core Styles - Dztfix
 * Themed Popup System with scope-based aesthetics
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;800&family=Outfit:wght@300;400;500;700;800&family=Tajawal:wght@400;700;800&display=swap');

/* ========================================
   BASE OVERLAY
   ======================================== */
.popup-system-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(2, 2, 5, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.popup-system-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   BASE CARD
   ======================================== */
.popup-system-card {
    width: 92%;
    max-width: 440px;
    border-radius: 24px;
    border: 1px solid var(--border-accent, rgba(0,242,234,0.2));
    padding: 40px 32px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transform: translateY(40px) scale(0.92);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 40px var(--glow-color, rgba(0,242,234,0.05)),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

.popup-system-overlay.active .popup-system-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Pattern layer */
.popup-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Make content above pattern */
.popup-system-card > *:not(.popup-pattern):not(.popup-decor-img) {
    position: relative;
    z-index: 1;
}

/* ========================================
   CLOSE BUTTON
   ======================================== */
.popup-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 5;
    line-height: 1;
}

.popup-close-btn:hover {
    background: rgba(255, 77, 77, 0.15);
    border-color: rgba(255, 77, 77, 0.3);
    color: #ff4d4d;
    transform: rotate(90deg);
}

[dir="rtl"] .popup-close-btn {
    right: auto;
    left: 14px;
}

/* ========================================
   ICON
   ======================================== */
.popup-icon-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-accent, rgba(255,255,255,0.08));
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(8deg);
    transition: transform 0.4s ease;
    box-shadow: 
        0 8px 24px var(--glow-color, rgba(0,0,0,0.2)),
        inset 0 0 20px var(--glow-color, rgba(0,0,0,0.1));
}

.popup-system-overlay.active .popup-icon-wrapper {
    animation: icon-bounce 0.6s ease 0.4s both;
}

@keyframes icon-bounce {
    0% { transform: rotate(8deg) scale(0.5); opacity: 0; }
    50% { transform: rotate(-5deg) scale(1.1); }
    100% { transform: rotate(8deg) scale(1); opacity: 1; }
}

.popup-icon-emoji {
    font-size: 2.2rem;
    line-height: 1;
}

/* ========================================
   CONTENT
   ======================================== */
.popup-title {
    font-family: 'Tajawal', 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.popup-divider {
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-from, #00f2ea), var(--accent-to, #00a8ff), transparent);
    margin: 14px auto 18px;
    border-radius: 2px;
}

.popup-message {
    color: #9ca3c5;
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 26px;
    font-family: 'Tajawal', 'Outfit', sans-serif;
    direction: rtl;
}

/* ========================================
   ACTION BUTTON
   ======================================== */
.popup-actions {
    display: flex;
    justify-content: center;
}

.popup-main-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-from, #00f2ea), var(--accent-to, #00a8ff));
    color: #000;
    text-decoration: none;
    padding: 13px 32px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.95rem;
    font-family: 'Tajawal', 'Outfit', sans-serif;
    transition: all 0.3s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 20px var(--glow-color, rgba(0,242,234,0.15));
    letter-spacing: 0.3px;
}

.popup-main-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4), 0 0 30px var(--glow-color, rgba(0,242,234,0.25));
    filter: brightness(1.1);
}

.popup-main-btn:active {
    transform: translateY(-1px);
}

.btn-arrow {
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.popup-main-btn:hover .btn-arrow {
    transform: translateX(-4px);
}

/* ========================================
   THEME: ROYAL (main / home)
   ======================================== */
.popup-theme-royal {
    background: linear-gradient(145deg, #1a140a, #0d0a06) !important;
}

.popup-theme-royal .popup-icon-wrapper {
    background: rgba(197, 160, 89, 0.08);
    border-color: rgba(197, 160, 89, 0.25);
    box-shadow: 
        0 8px 24px rgba(197, 160, 89, 0.15),
        inset 0 0 30px rgba(197, 160, 89, 0.05);
}

.popup-theme-royal .popup-title {
    background: linear-gradient(135deg, #F5D998, #C5A059);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.popup-theme-royal .popup-divider {
    background: linear-gradient(90deg, transparent, #C5A059, #F5D998, #C5A059, transparent);
}

.popup-theme-royal .popup-main-btn {
    background: linear-gradient(135deg, #C5A059, #E8C97A);
    box-shadow: 0 8px 24px rgba(197, 160, 89, 0.25);
}

.popup-theme-royal .popup-main-btn:hover {
    box-shadow: 0 14px 35px rgba(197, 160, 89, 0.4);
}

.popup-theme-royal .popup-decor-img {
    top: -10px;
    right: -20px;
    width: 120px;
    height: 120px;
    opacity: 0.15;
}

.popup-system-overlay.active .popup-theme-royal .popup-decor-img {
    opacity: 0.15;
}

/* Royal shimmer effect */
.popup-theme-royal::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(197,160,89,0.03), transparent, rgba(245,217,152,0.02), transparent);
    animation: royal-shimmer 8s linear infinite;
    pointer-events: none;
}

@keyframes royal-shimmer {
    to { transform: rotate(360deg); }
}

/* ========================================
   THEME: GAMING (games)
   ======================================== */
.popup-theme-gaming {
    background: linear-gradient(145deg, #0f0525, #060310) !important;
}

.popup-theme-gaming .popup-icon-wrapper {
    background: rgba(157, 0, 255, 0.08);
    border-color: rgba(157, 0, 255, 0.3);
    box-shadow: 
        0 8px 24px rgba(157, 0, 255, 0.2),
        inset 0 0 30px rgba(157, 0, 255, 0.05);
    animation: gaming-glow 2s ease-in-out infinite alternate;
}

@keyframes gaming-glow {
    from { box-shadow: 0 8px 24px rgba(157, 0, 255, 0.2), inset 0 0 30px rgba(157, 0, 255, 0.05); }
    to { box-shadow: 0 8px 30px rgba(0, 242, 234, 0.2), inset 0 0 30px rgba(0, 242, 234, 0.05); }
}

.popup-theme-gaming .popup-title {
    background: linear-gradient(135deg, #bf5af2, #00f2ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.popup-theme-gaming .popup-divider {
    background: linear-gradient(90deg, transparent, #9d00ff, #00f2ea, transparent);
    height: 2px;
}

.popup-theme-gaming .popup-main-btn {
    background: linear-gradient(135deg, #9d00ff, #00f2ea);
    box-shadow: 0 8px 24px rgba(157, 0, 255, 0.3);
}

.popup-theme-gaming .popup-main-btn:hover {
    box-shadow: 0 14px 35px rgba(157, 0, 255, 0.5);
}

.popup-theme-gaming .popup-decor-img {
    bottom: -10px;
    left: -15px;
    width: 140px;
    height: 140px;
}

.popup-system-overlay.active .popup-theme-gaming .popup-decor-img {
    opacity: 0.2;
}

/* Gaming scan lines */
.popup-theme-gaming::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(157, 0, 255, 0.015) 2px,
        rgba(157, 0, 255, 0.015) 4px
    );
    pointer-events: none;
    border-radius: 24px;
}

/* ========================================
   THEME: COURSES (courses)
   ======================================== */
.popup-theme-courses {
    background: linear-gradient(145deg, #0a1a10, #050a08) !important;
}

.popup-theme-courses .popup-icon-wrapper {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.25);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.12);
}

.popup-theme-courses .popup-title {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.popup-theme-courses .popup-divider {
    background: linear-gradient(90deg, transparent, #22c55e, #10b981, transparent);
}

.popup-theme-courses .popup-main-btn {
    background: linear-gradient(135deg, #22c55e, #10b981);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.2);
}

.popup-theme-courses .popup-main-btn:hover {
    box-shadow: 0 14px 35px rgba(34, 197, 94, 0.35);
}

.popup-theme-courses .popup-decor-img {
    top: -5px;
    left: -10px;
    width: 100px;
    height: 100px;
}

.popup-system-overlay.active .popup-theme-courses .popup-decor-img {
    opacity: 0.12;
}

/* ========================================
   THEME: ASSETS (default cyan)
   ======================================== */
.popup-theme-assets .popup-icon-wrapper {
    background: rgba(0, 242, 234, 0.06);
    border-color: rgba(0, 242, 234, 0.2);
}

.popup-theme-assets .popup-title {
    background: linear-gradient(135deg, #00f2ea, #00a8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   THEME: PROFILE
   ======================================== */
.popup-theme-profile .popup-icon-wrapper {
    background: rgba(0, 168, 255, 0.06);
    border-color: rgba(0, 168, 255, 0.2);
}

.popup-theme-profile .popup-title {
    background: linear-gradient(135deg, #00a8ff, #00f2ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   RESPONSIVE — MOBILE
   ======================================== */
@media (max-width: 480px) {
    .popup-system-card {
        max-width: 100%;
        width: 96%;
        padding: 32px 22px 26px;
        border-radius: 20px;
    }

    .popup-icon-wrapper {
        width: 60px;
        height: 60px;
        border-radius: 18px;
        margin-bottom: 18px;
    }

    .popup-icon-emoji {
        font-size: 1.8rem;
    }

    .popup-title {
        font-size: 1.25rem;
    }

    .popup-message {
        font-size: 0.88rem;
        line-height: 1.7;
        margin-bottom: 22px;
    }

    .popup-main-btn {
        padding: 11px 26px;
        font-size: 0.9rem;
        border-radius: 12px;
        width: 100%;
        justify-content: center;
    }

    .popup-divider {
        margin: 10px auto 14px;
    }

    .popup-decor-img {
        display: none;
    }

    .popup-close-btn {
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    [dir="rtl"] .popup-close-btn {
        right: auto;
        left: 10px;
    }
}

@media (max-width: 360px) {
    .popup-system-card {
        padding: 28px 18px 22px;
    }

    .popup-title {
        font-size: 1.15rem;
    }

    .popup-message {
        font-size: 0.85rem;
    }
}
