/* --- Root Variables (from your provided :root block) --- */
:root {
    /* --- Base Colors & Gradients (from new theme) --- */
    --color-primary: #8a63ed; /* A deeper, rich purple */
    --color-primary-light: #b4b9ff;
    --color-primary-dark: #5e47c0;
    --color-accent: #00d4ff; /* Bright cyan accent */
    --color-accent-light: #66fff9;
    --color-accent-dark: #00aaff;
    --color-warning: #ffb70d; /* Yellow for Coming Soon */
    --color-danger: #ff4f4f; /* Red for Lock icons */
    --color-success: #4caf50; /* Green for success */

    /* RGB values for shadows (needed because rgba() requires individual numbers) */
    --color-primary-rgb: 138, 99, 237;
    --color-accent-rgb: 0, 212, 255;
    --color-warning-rgb: 255, 183, 13;
    --color-danger-rgb: 255, 79, 79;
    --color-success-rgb: 76, 175, 80;

    /* --- Backgrounds (from new theme) --- */
    --bg-dark-1: #0f0e1a; /* Very dark body background */
    --bg-dark-2: linear-gradient(145deg, #18153d, #0d1e33); /* Sidebar & Footer bg */
    --bg-dark-3: linear-gradient(135deg, #0a0a1a, #151530); /* Main content bg */
    --bg-card: rgba(255, 255, 255, 0.04); /* General card/panel background (used for status-card-bg) */
    --bg-input: rgba(255, 255, 255, 0.08); /* Also useful for code blocks */

    /* --- Text Colors (from new theme) --- */
    --text-light: #e0e5ff; /* Main light text color */
    --text-muted: #9aa1c0; /* Muted text color */
    --text-heading: #d0d7ff; /* Heading text color */
    --color-text-dark: #000000; /* For text that needs to be dark on light backgrounds (e.g., on yellow badges) */


    /* --- Shadows (from new theme) --- */
    --shadow-glow-primary: 0 0 15px rgba(var(--color-primary-rgb), 0.7);
    --shadow-glow-primary-sm: 0 0 5px var(--color-primary), inset 0 0 2px var(--color-primary-light);
    --shadow-glow-accent: 0 0 15px rgba(var(--color-accent-rgb), 0.7);
    --shadow-card: 0 5px 25px rgba(0, 0, 0, 0.4);
    --shadow-inset: inset 0 0 15px rgba(0, 0, 0, 0.3);

    /* --- Borders (from new theme) --- */
    --border-subtle: 1px solid rgba(var(--color-primary-rgb), 0.15); /* Replaced old border-color rgba(255, 255, 255, 0.1) */
    --border-gradient: linear-gradient(90deg, var(--color-accent-dark), var(--color-accent-light));
    --border-radius-base: 12px; /* For general use */


    /* --- Font Families (mix of both, prioritizing new theme's base/mono) --- */
    --font-family-base: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-family-mono: 'Fira Code', 'Cascadia Code', monospace; /* Fira Code is excellent for code */
    --font-heading: 'Orbitron', sans-serif; /* Kept from original for specific titles */
    --font-code: var(--font-family-mono); /* Alias for consistency */
    --font-body: var(--font-family-base); /* Alias for consistency */


    /* --- Layout & Transition (from new theme) --- */
    --transition-speed: 0.35s;

    /* --- Status Page Specific Mappings (using new theme colors) --- */
    --primary-color: var(--color-primary); /* Alias for status-page title/accents */
    --secondary-color: var(--text-muted); /* Use muted text for secondary */
    --background-dark: var(--bg-dark-1); /* Main body background */
    --card-background: var(--bg-card); /* General card background */
    --border-color: var(--border-subtle); /* General border color */
    --success-color: var(--color-success);
    --warning-color: var(--color-warning);
    --danger-color: var(--color-danger);
    --info-color: var(--color-accent); /* Using accent as info color */

    /* Status Specific Colors - mapped to new theme */
    --status-operational: var(--success-color);
    --status-degraded-performance: var(--warning-color);
    --status-partial-outage: var(--danger-color);
    --status-major-outage: var(--danger-color);
    --status-under-maintenance: var(--info-color); /* Using info/accent */
    --status-investigating: var(--warning-color); /* Matches degraded for consistency or use --info-color */
    --status-monitoring: var(--info-color); /* Matches under-maintenance for consistency or use --info-color */
    --status-resolved: var(--success-color);
    --status-scheduled: var(--info-color);
    --status-in-progress: var(--warning-color);
    --status-completed: var(--secondary-color);
    --status-offline: var(--danger-color);
    --status-online: var(--success-color);
    --status-unknown: var(--secondary-color);
    --status-soon-color: var(--color-warning); /* Explicitly for "soon" status */

    /* Explicitly defined light/dark variants for status.css compatibility (using RGB values) */
    --success-light: rgba(var(--color-success-rgb), 0.2);
    --success-dark: var(--color-success);

    --warning-light: rgba(var(--color-warning-rgb), 0.2);
    --warning-dark: var(--color-warning);

    --danger-light: rgba(var(--color-danger-rgb), 0.2);
    --danger-dark: var(--color-danger);

    --info-light: rgba(var(--color-accent-rgb), 0.2);
    --info-dark: var(--color-accent);

    /* Backgrounds and borders (aliased for status.css compatibility) */
    --status-bg-dark: var(--bg-dark-1);
    --status-card-bg: var(--bg-card);
    --status-accent-blue: var(--color-primary-dark);
    --status-border-color: var(--border-subtle);
    --status-progress-bar-bg: rgba(255, 255, 255, 0.05);
    --status-code-bg: var(--bg-input);
    --card-header-bg-color: var(--bg-dark-2);
    --border-radius: var(--border-radius-base);

    /* HTTP Method Colors - re-evaluated with new theme or kept if distinct */
    --method-get: var(--color-success);
    --method-post: var(--color-primary-dark); /* Using a darker primary */
    --method-put: var(--color-accent); /* Using accent */
    --method-delete: var(--color-danger);
    --method-patch: var(--color-warning); /* Using warning */
    --method-options: var(--secondary-color);

    /* Text colors on status banners/badges (using new theme's --color-text-dark for contrast) */
    --text-on-status-operational: #fff;
    --text-on-status-degraded: var(--color-text-dark);
    --text-on-status-offline: #fff;
    --text-on-status-maintenance: #fff;
    --text-on-status-investigating: var(--color-text-dark); /* Changed to dark for yellow */
    --text-on-status-monitoring: #fff; /* Changed to light for info/accent */
    --text-on-status-soon: var(--color-text-dark);


    /* --- NEW VARIABLES FROM CHANGELOG THEME (RETAINED) --- */
    --color-card-background: var(--bg-dark-3); /* Card background, distinct from --bg-card if needed */
    --color-card-header-background: var(--bg-dark-2);
    --color-border-primary: var(--color-primary);

    --color-button-secondary-background: var(--bg-input);
    --color-button-secondary-text: var(--text-light);
    --color-button-secondary-border: var(--border-subtle);
    --color-button-active-text: var(--color-text-dark);
    --color-button-active-background: var(--color-accent);
    --color-button-active-border: var(--color-accent-light);
    --shadow-button-active-glow: var(--shadow-glow-accent);

    --color-input-background: var(--bg-input);
    --color-input-background-focus: rgba(var(--color-primary-rgb), 0.1);

    --color-code-background: var(--bg-dark-1);
    --color-code-text: var(--text-light);

    --color-link-external: var(--color-accent);
    --color-link-external-hover: var(--color-accent-light);

    /* Changelog Operation Badges - retained */
    --color-badge-feature: #8e44ad;
    --color-badge-feature-text: #ffffff;
    --color-badge-added: #28a745;
    --color-badge-added-text: #ffffff;
    --color-badge-updated: #ffc107;
    --color-badge-updated-text: #333333;
    --color-badge-fixed: #dc3545;
    --color-badge-fixed-text: #ffffff;
    --color-badge-security: #fd7e14;
    --color-badge-security-text: #ffffff;
    --color-badge-breaking: #6f42c1;
    --color-badge-breaking-text: #ffffff;
    --color-badge-performance: #20c997;
    --color-badge-performance-text: #ffffff;
    --color-badge-docs: #6c757d;
    --color-badge-docs-text: #ffffff;
    --color-badge-refactor: #007bff;
    --color-badge-refactor-text: #ffffff;
    --color-badge-deprecated: #ff007f;
    --color-badge-deprecated-text: #ffffff;
    --color-badge-experimental: #6610f2;
    --color-badge-experimental-text: #ffffff;

    /* Tech Badges (Affected Systems/Frameworks) - retained */
    --color-tech-badge-background: rgba(var(--color-primary-rgb), 0.1);
    --color-tech-badge-text: var(--color-primary-light);
    --color-tech-badge-border: rgba(var(--color-primary-rgb), 0.3);

    /* Search Highlight - retained */
    --color-highlight-background: rgba(var(--color-accent-rgb), 0.4);
    --color-highlight-text: var(--bg-dark-1);

    /* New for SOON status/type - retained */
    --color-badge-soon: rgba(0, 191, 255, 0.2);
    --color-badge-soon-text: #00BFFF;
}


/* --- Global Reset & Base Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    height: 100%; /* Ensures html takes full height */
}

body {
    font-family: var(--font-family-base);
    background: var(--bg-dark-1);
    color: var(--text-light);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh; /* Ensures body takes full viewport height */
    overflow: hidden; /* Prevent body scroll, layout containers will scroll */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed) ease;
}
a:hover {
    color: var(--color-accent-light);
}

ul, ol {
    list-style: none; /* Reset default list styles */
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    line-height: 1.2;
    margin-bottom: 0.8em;
}

p {
    margin-bottom: 1em;
}

/* --- Utility Classes (for responsive display) --- */
.d-none { display: none !important; } /* Hidden by default */
@media (min-width: 992px) { /* On desktop (lg) and up */
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
    .d-lg-none { display: none !important; } /* Hidden on desktop */
}
@media (max-width: 991.98px) { /* On tablet/mobile (up to lg) */
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    /* No d-md-none needed if elements are d-lg-block and hidden by default */
}


/* --- Loader Styles (Keep as is) --- */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark-1);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

#loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Allow interaction once hidden */
}

.loader-ellipsis {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}
.loader-ellipsis div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--color-primary-light);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.loader-ellipsis div:nth-child(1) { left: 8px; animation: loader-ellipsis1 0.6s infinite; }
.loader-ellipsis div:nth-child(2) { left: 8px; animation: loader-ellipsis2 0.6s infinite; }
.loader-ellipsis div:nth-child(3) { left: 32px; animation: loader-ellipsis2 0.6s infinite; }
.loader-ellipsis div:nth-child(4) { left: 56px; animation: loader-ellipsis3 0.6s infinite; }
@keyframes loader-ellipsis1 { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes loader-ellipsis3 { 0% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes loader-ellipsis2 { 0% { transform: translate(0, 0); } 100% { transform: translate(24px, 0); } }


/* ========================================= */
/* GLOBAL LAYOUT STYLES (NEW/UPDATED)        */
/* ========================================= */

.app-container {
    display: flex; /* Flex container for sidebar and main content */
    min-height: 100vh; /* Ensure it takes full viewport height */
    width: 100%;
    overflow: hidden; /* Important to prevent body scroll from this container */
}

/* Mobile Header (Visible only on mobile) */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height-mobile);
    background: var(--bg-dark-2);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1001; /* Ensure it's above sidebar and content */
    border-bottom: var(--border-subtle);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.mobile-header .mobile-menu-button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}
.mobile-header .mobile-menu-button:hover {
    background-color: rgba(255,255,255,0.1);
}
.mobile-header .mobile-menu-button i {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

.mobile-header .mobile-header-title {
    flex-grow: 1;
    text-align: center;
    color: var(--text-heading);
    font-weight: 600;
    font-size: 1.2rem;
}

body {
     scrollbar-color: var(--color-primary) var(--bg-dark-1);
}

body::-webkit-scrollbar {
    width: 8px; /* Width of the scrollbar */
}

body::-webkit-scrollbar-track {
    background: black /* Color of the scrollbar track */
}

body::-webkit-scrollbar-thumb {
    background: var(--color-primary); /* Color of the scrollbar thumb */
    border-radius: 10px; /* Rounded corners for the thumb */
    border: 2px solid var(--bg-dark-1); /* Border around the thumb, matching track background */
}

body::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-light); /* Color of the thumb on hover */
}

/* Mobile Nav (if you want separate links in mobile header) */
.mobile-header .mobile-nav .nav-list {
    display: flex;
    gap: 1rem;
}
.mobile-header .mobile-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}
.mobile-header .mobile-nav .nav-link:hover {
    color: var(--color-accent-light);
}

/* Desktop Header (Visible only on desktop) */
.desktop-header {
    width: 100%;
    height: var(--header-height-desktop);
    background: var(--bg-dark-2); /* Slightly darker for header */
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Align nav to the right */
    padding: 0 2rem;
    border-bottom: var(--border-subtle);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky; /* Makes desktop header sticky */
    top: 0;
    z-index: 999; /* Above main content, below mobile header */
}

.desktop-header .nav-list {
    display: flex;
    gap: 1.5rem;
}
.desktop-header .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    transition: color var(--transition-speed) ease;
}
.desktop-header .nav-link:hover {
    color: var(--color-accent-light);
}


/* Main Layout Structure */
/* On desktop, the sidebar will be fixed on the left.
   The main content area will take the remaining space and scroll independently. */
@media (min-width: 992px) { /* Desktop Layout */
    .sidebar {
        width: var(--sidebar-width-desktop);
        background: var(--bg-dark-2);
        padding: 2rem 1.5rem;
        position: sticky; /* Makes sidebar sticky */
        top: 0; /* Sticks to the top of its parent */
        height: 100vh; /* Take full viewport height */
        overflow-y: auto; /* Enable scrolling for sidebar content */
        flex-shrink: 0; /* Prevent sidebar from shrinking */
        border-right: var(--border-subtle);
        display: flex;
        flex-direction: column; /* Stack sidebar items */
        z-index: 990; /* Below desktop header, above main content */
    }

    .main-content-area {
        flex-grow: 1; /* Allows main content to take remaining space */
        background: var(--bg-dark-3); /* Main content background */
        height: 100vh; /* Take full viewport height */
        overflow-y: auto; /* Enable scrolling for main content */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        position: relative; /* For z-index and positioning */
        display: flex;
        flex-direction: column; /* To stack header, content, footer */
    }

    .main-content-area .main-content { /* Content within main-content-area, e.g., @yield('content') */
        flex-grow: 1; /* Allows content to push footer down */
        padding: 2rem; /* Global padding for main content */
        max-width: 1200px; /* Max width for content readability */
        margin: 0 auto; /* Center content */
        padding-top: calc(var(--header-height-desktop) + 2rem); /* Adjust for sticky header */
    }

    .footer {
        flex-shrink: 0; /* Prevents footer from shrinking */
        padding: 1.5rem 2rem;
        background: var(--bg-dark-2);
        border-top: var(--border-subtle);
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.9rem;
        color: var(--text-muted);
        text-align: center;
    }
    .footer .footer-text {
        color: var(--text-muted);
        transition: color 0.2s ease;
    }
    .footer .footer-text:hover {
        color: var(--color-primary-light);
    }
}

/* --- Mobile Specific Layout (Sidebar hidden by default) --- */
@media (max-width: 991.98px) { /* Tablet and Mobile */
    .sidebar {
        position: fixed; /* Fix sidebar off-screen */
        left: 0;
        top: 0; /* Keep it at the top */
        width: 280px; /* Smaller sidebar width for mobile */
        transform: translateX(-100%); /* Hide off-screen */
        height: 100vh;
        padding-top: var(--header-height-mobile); /* Space for fixed mobile header */
        background: var(--bg-dark-2);
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5); /* Shadow when open */
        transition: transform var(--transition-speed) ease-in-out; /* For mobile slide-in */
        z-index: 1000; /* Above main content for mobile overlay */
        border-right: var(--border-subtle);
        display: flex;
        flex-direction: column; /* Stack sidebar items */
    }

    .sidebar.active { /* Class to show sidebar */
        transform: translateX(0%);
    }

    .main-content-area {
        flex-grow: 1;
        background: var(--bg-dark-3);
        padding-top: var(--header-height-mobile); /* Space for mobile header */
        height: 100vh; /* Takes full viewport height */
        overflow-y: auto; /* Main content scrolls */
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    .main-content-area .main-content {
        padding: 1.5rem 1rem; /* Smaller padding for mobile content */
    }

    .footer {
        padding: 1rem;
        background: var(--bg-dark-2);
        border-top: var(--border-subtle);
        display: flex;
        flex-direction: column; /* Stack footer items vertically */
        gap: 0.5rem;
        font-size: 0.85rem;
        color: var(--text-muted);
        text-align: center;
    }

    /* Overlay for when sidebar is open */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 999; /* Below sidebar, above content */
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
    }

    .overlay.active {
        opacity: 1;
        visibility: visible;
    }
}