/* 
   PREMIUM EXCLUSIVE DESIGN SYSTEM 
   Theme: Midnight Luxe (Dark/Gold/Violet)
*/

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    /* Color Palette */
    --bg-deep: #050507;
    --bg-card: #0E0E12;
    --bg-card-hover: #14141a;

    --primary: #D4AF37;
    /* Metallic Gold */
    --primary-dim: rgba(212, 175, 55, 0.1);
    --primary-glow: rgba(212, 175, 55, 0.4);

    --accent: #6C5DD3;
    /* Royal Violet */
    --accent-glow: rgba(108, 93, 211, 0.5);

    --text-main: #FFFFFF;
    --text-muted: #8F95B2;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 20, 25, 0.7);

    /* Spacing & Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --sidebar-width: 280px;
    --header-height: 80px;
    --space-unit: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
}

/* --- UTILITIES --- */

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.gap-1 {
    gap: 1rem;
}

.gap-2 {
    gap: 2rem;
}

.text-gold {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.text-dim {
    color: var(--text-muted);
}

.w-100 {
    width: 100%;
}

/* --- GLASSMORPHISM & CARDS --- */

.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
}

/* --- SIDEBAR --- */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-subtle);
    padding: 2rem;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Enable scrolling */
}

/* Custom Scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.brand-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 3rem;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.brand-logo::after {
    content: '.';
    color: var(--primary);
    font-size: 2.2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.nav-item i {
    margin-left: 1rem;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background: var(--primary-dim);
    color: var(--primary);
    border-right-color: var(--primary);
}

/* --- MAIN CONTENT --- */

.main-content {
    margin-right: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    padding: 2rem;
}

/* --- HEADER --- */

.top-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border-subtle);
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

/* --- STATS GRID --- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    position: absolute;
    left: 1.5rem;
    top: 1.5rem;
    font-size: 2.5rem;
    opacity: 0.1;
    color: var(--text-main);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    background: linear-gradient(to right, var(--text-main), #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- FORMS & INPUTS --- */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control,
.form-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    padding: 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
    background: var(--bg-card);
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary), #b8962e);
    color: #000;
    font-weight: 700;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* --- TABS --- */

.tab-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    font-weight: 600;
}

/* --- ANIMATIONS --- */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* --- RESPONSIVE --- */

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    body {
        display: block;
        /* Override flex on mobile for linear flow */
    }

    .sidebar {
        transform: translateX(100%);
        width: 280px;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        right: 0;
        left: auto;
        box-shadow: -15px 0 50px rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(20px);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .brand-logo {
        margin-bottom: 2rem;
        width: 100%;
        display: block;
        padding-right: 25px;
        padding-left: 25px;
        font-size: 1.6rem;
    }

    .main-content {
        margin-right: 0;
        width: 100%;
        padding: 1.5rem;
        padding-top: 5.5rem;
    }

    .mobile-menu-btn {
        display: flex;
        right: 1.5rem;
        top: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .stat-card {
        padding: 1.5rem !important;
    }

    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding: 0 25px 1rem 25px;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
        padding: 1.2rem !important;
    }
}