/* ==========================================================================
   AI MEDIA PLATFORM - THE CORE PREMIUM FRAMEWORK 
   Designed by: Gemini & Engineer Youssouf Issakha
   Color Palette: Gold (#C28F5F), Deep Brown (#2D241E), Cream (#FDFBF7)
   ========================================================================== */

:root {
    /* 🎨 Colors */
    --primary-gold: #c28f5f;
    --primary-dark: #2d241e;
    --primary-light: #fdfbf7;
    --accent-gold: #d4a373;
    --bg-body: #fdfbf7;
    --bg-card: #ffffff;
    
    /* ℹ️ Status Colors */
    --success: #16a34a;
    --error: #dc2626;
    --warning: #ca8a04;
    --info: #2563eb;
    
    /* 🖋️ Typography & Spacing */
    --text-main: #2d241e;
    --text-muted: #6b5e55;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --shadow-sm: 0 2px 10px rgba(45, 36, 30, 0.05);
    --shadow-premium: 0 15px 40px rgba(45, 36, 30, 0.12);
}

/* 1. Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    padding-top: 75px; /* Navbar space */
}

/* RTL Support for Arabic Fonts */
html[dir="rtl"] body {
    font-family: 'Cairo', 'Inter', sans-serif;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* 2. Advanced Navbar */
.main-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    height: 75px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(194, 143, 95, 0.1);
}

.navbar-container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Logo & Brand */
.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary-gold), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(194, 143, 95, 0.3);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-text {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
}

/* Navbar Menu (Desktop Only) */
.navbar-menu {
    display: flex;
    gap: 10px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link i { font-size: 1.1rem; }

.nav-link:hover, .nav-link.active {
    color: var(--primary-gold);
    background: rgba(194, 143, 95, 0.05);
}

/* 3. User Dropdown Window */
.user-dropdown-container {
    position: relative;
}

.btn-user-trigger {
    background: white;
    border: 1.5px solid #eee;
    padding: 5px 10px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-user-trigger:hover { border-color: var(--primary-gold); }

.nav-avatar, .nav-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-avatar-placeholder {
    background: var(--primary-dark);
    color: var(--primary-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.dropdown-window {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 260px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-premium);
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    border: 1px solid rgba(194, 143, 95, 0.1);
}

html[dir="rtl"] .dropdown-window { right: auto; left: 0; }

.dropdown-window.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-user-header {
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    flex-direction: column;
}

.header-name { font-weight: 700; color: var(--primary-dark); }
.header-id { font-size: 0.8rem; color: var(--text-muted); }

.dropdown-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.dropdown-links a:hover {
    background: var(--primary-light);
    color: var(--primary-gold);
}

.logout-link:hover { background: #fff5f5 !important; color: var(--error) !important; }

/* 4. Modern Sidebar (Off-Canvas) */
.sidebar-modern {
    position: fixed;
    top: 0;
    left: -320px; /* Start hidden */
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 2000;
    transition: var(--transition);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-premium);
}

html[dir="rtl"] .sidebar-modern { left: auto; right: -320px; }

.sidebar-modern.active { left: 0; }
html[dir="rtl"] .sidebar-modern.active { right: 0; }

.sidebar-brand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.sidebar-title { font-weight: 800; font-size: 1.2rem; color: var(--primary-gold); }

.btn-close-sidebar {
    background: #f5f5f5;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

.sidebar-section { margin-bottom: 2rem; }
.sidebar-section label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: block;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    border-radius: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 5px;
}

.sidebar-item:hover {
    background: var(--primary-light);
    color: var(--primary-gold);
    transform: translateX(5px);
}

html[dir="rtl"] .sidebar-item:hover { transform: translateX(-5px); }

/* Sidebar Overlay */
.sidebar-overlay-blur {
    position: fixed;
    inset: 0;
    background: rgba(45, 36, 30, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay-blur.active { opacity: 1; visibility: visible; }

/* 5. Premium Toasts */
.toast-stack {
    position: fixed;
    top: 90px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html[dir="rtl"] .toast-stack { right: auto; left: 25px; }

.premium-toast {
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    border-left: 4px solid var(--primary-gold);
    animation: slideIn 0.5s ease;
}

.premium-toast.success { border-left-color: var(--success); }
.premium-toast.error { border-left-color: var(--error); }

.toast-text { font-weight: 600; font-size: 0.95rem; flex: 1; }
.toast-x { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #ccc; }

/* 6. Main Footer */
.main-footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.brand-footer { font-size: 1.5rem; font-weight: 800; margin-bottom: 15px; }
.footer-info p { color: var(--text-muted); max-width: 300px; }

.footer-nav h6, .footer-social h6 {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.footer-nav a { display: block; margin-bottom: 10px; color: var(--text-muted); font-weight: 500; }
.footer-nav a:hover { color: var(--primary-gold); }

.social-row { display: flex; gap: 15px; }
.social-row a {
    width: 40px; height: 40px; border-radius: 50%;
    background: #f8f8f8; display: flex; align-items: center; justify-content: center;
    color: var(--primary-dark);
}

.social-row a:hover { background: var(--primary-gold); color: white; }

.footer-bottom {
    text-align: center;
    border-top: 1px solid #f5f5f5;
    padding-top: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 7. Animations & Mobile */
@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 992px) {
    .d-desktop-only { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; }
    .brand-text { display: none; } /* Show only logo on small screens */
    .navbar-container { padding: 0 1rem; }
    .toast-stack { width: calc(100% - 40px); left: 20px; right: 20px; }
}
