/* =========================================
   1. CORE THEME VARIABLES & RESET
   ========================================= */
:root {
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-highlight: rgba(255, 255, 255, 0.3);
    --blur: blur(20px) saturate(160%);
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --danger: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, system-ui, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0f1e;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 80px;
    /* Header Height */
}

/* =========================================
   2. BACKGROUND ANIMATIONS (LIQUID SHAPES)
   ========================================= */
@keyframes liquidMorph {
    0% {
        border-radius: 50%;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    33% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: translate(50px, -80px) rotate(15deg) scale(1.1);
    }

    66% {
        border-radius: 60% 40% 30% 70% / 50% 30% 70% 40%;
        transform: translate(-40px, 40px) rotate(-10deg) scale(0.9);
    }

    100% {
        border-radius: 50%;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
}

.bg-shape {
    position: fixed;
    z-index: -1;
    filter: blur(90px);
    opacity: 0.4;
    animation: liquidMorph 20s ease-in-out infinite;
    pointer-events: none;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: var(--primary-color);
    top: -15%;
    left: -10%;
    animation-duration: 25s;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: #8b5cf6;
    bottom: -10%;
    right: -5%;
    animation-duration: 30s;
    animation-direction: reverse;
}

.shape-3 {
    width: 450px;
    height: 450px;
    background: #34d399;
    top: 40%;
    right: 25%;
    opacity: 0.3;
    animation-duration: 35s;
}

/* =========================================
   3. GLOBAL LAYOUT (SIDEBAR + FULL WIDTH CONTENT)
   ========================================= */
.user-page-wrapper,
.admin-page-wrapper {
    display: flex;
    align-items: flex-start;
    /* CRITICAL: Allows sidebar to be sticky */
    width: 100%;
    min-height: 100vh;
    gap: 30px;
    /* Natural spacing between sidebar and content */
}

/* The Main Content Area */
.dashboard-content,
.user-main-content {
    flex: 1;
    /* Takes exactly 100% of all remaining space to the right */
    width: 100%;
    min-width: 0;
    /* Prevents flexbox from blowing out the width */
    padding: 30px 30px 30px 0;
    /* Top, Right, Bottom, Left(0 because gap handles it) */
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
    /* Forces the inner cards to pull to the exact edges */
}

/* CRITICAL FIX: This forcefully overrides the old 1100px limit that was creating the empty space */
.dashboard-content>*,
.user-main-content>* {
    width: 100% !important;
    max-width: 100% !important;
}

/* =========================================
   4. LIQUID GLASS SIDEBAR
   ========================================= */
.glass-sidebar {
    position: sticky;
    top: 100px;
    /* Sits 20px below header */
    flex: 0 0 260px;
    /* STRICT WIDTH: Never shrinks, never grows */
    margin-left: 30px;
    /* Distance from left edge of screen */
    height: calc(100vh - 120px);
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 900;
    display: flex;
    flex-direction: column;
}

.sidebar-header h3 {
    font-size: 1rem;
    padding-left: 10px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.sidebar-links {
    position: relative;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-links li {
    z-index: 1;
}

.sidebar-links li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.sidebar-links li a i {
    width: 20px;
    text-align: center;
    opacity: 0.5;
}

.sidebar-links li a:hover {
    color: white;
}

.sidebar-links li a:hover i {
    opacity: 1;
    color: var(--primary-hover);
}

.sidebar-links li a.active {
    color: white;
    font-weight: 600;
}

.sidebar-links li a.active i {
    opacity: 1;
    color: var(--primary-hover);
}

/* =========================================
   5. TOP NAVIGATION & HEADER
   ========================================= */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo {
    font-weight: 800;
    font-size: 1.5rem;
}

.logo span {
    color: var(--primary-hover);
}

.glass-nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 5px;
}

.glass-nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    opacity: 0.7;
    transition: all 0.3s ease;
    font-weight: 500;
}

.glass-nav ul li a:hover,
.glass-nav ul li a.active {
    opacity: 1;
}

/* =========================================
   6. GLASS COMPONENTS (CARDS, BUTTONS, FORMS)
   ========================================= */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-input,
.combo-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    color: white;
    margin-bottom: 15px;
    transition: 0.3s;
}

.glass-input:focus,
.combo-input:focus {
    outline: none;
    border-color: var(--primary-hover);
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.1);
}

.glass-button {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 12px 25px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.glass-button.primary {
    background: var(--primary-color);
    border: none;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.glass-button.primary:hover {
    background: var(--primary-hover);
}

/* =========================================
   10. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 1100px) {

    .user-page-wrapper,
    .admin-page-wrapper {
        flex-direction: column;
        gap: 0;
    }

    .glass-sidebar {
        position: relative !important;
        top: 0 !important;
        flex: auto;
        width: calc(100% - 40px) !important;
        margin: 20px !important;
        height: auto !important;
    }

    .dashboard-content,
    .user-main-content {
        padding: 20px;
    }
}