/* ========================================================
   SITE_CORE.CSS - Empire Global UI System
   Shared styles: Auth Nav, Profile Dropdown, Notifications
   ======================================================== */

:root {
    --empire-orange: #ec5b13;
    --notif-accent: #ec5b13;
    --empire-orange-rgb: 236, 91, 19;
    --empire-cyan: #00f2ea;
    --empire-dark: #0a0b1e;
    --empire-surface: #111125;
    --empire-border: rgba(255, 255, 255, 0.06);
    --empire-text-dim: #8b95c9;
    --empire-danger: #ff4444;
}

/* --- THEME OVERRIDES --- */
.theme-games {
    --empire-orange: #C5A059; /* Royal Gold */
    --notif-accent: #C5A059;
    --empire-orange-rgb: 197, 160, 89;
    --empire-cyan: #bd00ff;   /* Royal Purple */
}

.theme-assets {
    --empire-orange: #ffcc00; /* Industrial Yellow */
    --notif-accent: #ffcc00;
    --empire-orange-rgb: 255, 204, 0;
    --empire-cyan: #ffffff;
}

.theme-courses {
    --empire-orange: #22c55e; /* Mission Green */
    --notif-accent: #22c55e;
    --empire-orange-rgb: 34, 197, 94;
    --empire-cyan: #a3e635;
}

.theme-tiktok {
    --empire-orange: #ff0050; /* TikTok Pink */
    --notif-accent: #ff0050;
    --empire-orange-rgb: 255, 0, 80;
    --empire-cyan: #00f2ea;   /* TikTok Cyan */
}

.theme-live {
    --empire-orange: #00a8ff; /* Vivid Blue */
    --notif-accent: #00f2ea;   /* Cyan */
    --empire-orange-rgb: 0, 168, 255;
    --empire-cyan: #ffffff;
}

/* ===== MATERIAL SYMBOLS FIX ===== */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

/* ===== GLOBAL HEADER (AUTH-NAV) ===== */
.auth-nav {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 70px;
    padding: 0 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10000;
    background: rgba(10, 11, 30, 0.7);
    backdrop-filter: blur(25px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.auth-nav.scrolled {
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 20px 20px;
    background: rgba(10, 11, 30, 0.9);
    border-color: rgba(255, 255, 255, 0.15);
    height: 65px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.auth-nav:hover {
    background: rgba(10, 11, 30, 0.85);
    border-color: rgba(255, 255, 255, 0.15);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.back-home-btn {
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 20px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--empire-text-dim);
}

.back-home-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
    border-color: var(--empire-orange);
    color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.back-home-btn .material-symbols-outlined {
    font-size: 1.3rem;
    color: var(--empire-orange);
}

.auth-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-login, .btn-register, .btn-signup {
    padding: 10px 22px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-login {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-register, .btn-signup {
    background: var(--empire-orange);
    color: white;
    box-shadow: 0 4px 15px rgba(236, 91, 19, 0.3);
}

.user-profile {
    position: relative;
    overflow: visible;
}

/* ===== PROFILE TRIGGER ===== */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 16px 6px 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.profile-trigger::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.profile-trigger:hover::before {
    transform: translateX(100%);
}

.profile-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--empire-orange);
    transition: all 0.3s ease;
}

/* ===== PROFILE DROPDOWN ===== */
.dropdown {
    position: absolute;
    top: 100.1%; /* Directly below trigger */
    right: 0;
    left: auto;
    width: 320px;
    background: rgba(12, 13, 35, 0.98);
    backdrop-filter: blur(40px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255,255,255,0.05);
    display: none;
    overflow: hidden;
    z-index: 10000;
}

.dropdown.show {
    display: block;
    animation: empireDropIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes empireDropIn {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Drop Header - Stats Section */
.drop-header {
    padding: 18px 18px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.lvl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.lvl-badge {
    background: linear-gradient(135deg, var(--empire-orange), #ff8c00);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.xp-text {
    font-size: 0.7rem;
    color: var(--empire-text-dim);
    font-weight: 800;
}

.xp-bar-wrap {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.xp-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--empire-orange), var(--notif-accent));
    box-shadow: 0 0 10px rgba(var(--empire-orange-rgb), 0.4);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
}

.points-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 10px 12px;
    background: rgba(0, 242, 234, 0.04);
    border: 1px solid rgba(0, 242, 234, 0.08);
    border-radius: 12px;
}

.points-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    color: var(--empire-cyan);
    line-height: 1;
}

.points-label {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 700;
}

/* Drop Items */
.drop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    text-decoration: none;
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.drop-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.drop-item .material-symbols-outlined {
    font-size: 1.2rem;
    color: var(--empire-text-dim);
}

.drop-item:hover .material-symbols-outlined {
    color: #fff;
}

.drop-item.danger:hover {
    color: var(--empire-danger);
    background: rgba(255, 68, 68, 0.08);
}

.drop-item.danger:hover .material-symbols-outlined {
    color: var(--empire-danger);
}

/* ===== NOTIFICATION SYSTEM ===== */
.notif-wrapper {
    position: relative;
}

.notif-trigger {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notif-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--empire-orange);
    transform: scale(1.08);
}

.notif-trigger .material-symbols-outlined {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.6);
}

.notif-trigger:hover .material-symbols-outlined {
    color: #fff;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 900;
    background: var(--notif-accent);
    color: white;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--empire-dark);
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.4);
    animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Notification Dropdown */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 18px); /* Adjusted for better spacing from floating nav */
    left: 0;
    width: 420px;
    max-height: 550px;
    background: rgba(12, 13, 35, 0.98);
    backdrop-filter: blur(50px) saturate(2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.9);
    display: none;
    overflow: hidden;
    z-index: 10000;
}

.notif-dropdown.show {
    display: block;
    animation: empireDropIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-header {
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.notif-title {
    font-weight: 800;
    color: #fff;
    font-size: 0.9rem;
}

.notif-clear {
    font-size: 0.75rem;
    color: var(--empire-cyan);
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.2s;
}

.notif-clear:hover {
    opacity: 0.7;
}

.notif-list {
    max-height: 350px;
    overflow-y: auto;
}

.notif-list::-webkit-scrollbar {
    width: 4px;
}

.notif-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Individual Notification Item */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.2s;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-item.unread {
    background: rgba(var(--empire-orange-rgb), 0.06);
    border-left: 3px solid var(--empire-orange); /* Corrected for RTL left edge */
}

.notif-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon .material-symbols-outlined {
    font-size: 1.2rem;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-content h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 3px;
}

.notif-content p {
    font-size: 0.78rem;
    color: var(--empire-text-dim);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-time {
    font-size: 0.68rem;
    color: #4a5580;
    margin-top: 4px;
    font-weight: 600;
}

/* Notification Footer */
.notif-footer {
    padding: 12px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.notif-all {
    color: var(--empire-cyan);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 800;
    transition: opacity 0.2s;
}

.notif-all:hover {
    opacity: 0.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .notif-dropdown {
        width: 320px;
        right: -60px;
    }

    .dropdown {
        right: -10px;
        width: 260px;
    }
}

@media (max-width: 480px) {
    .auth-nav {
        top: 10px;
        left: 10px;
        right: 10px;
        height: 65px;
        padding: 0 15px;
    }

    .notif-dropdown {
        position: fixed;
        top: 85px;
        left: 10px;
        right: 10px;
        width: auto;
    }

    .dropdown {
        left: 10px;
        right: 10px;
        width: auto;
        top: 85px;
    }
}
