/* ========================================= */
/* Sidebar Specific Styles
/* ========================================= */

.sidebar {
    grid-area: sidebar;
    background: var(--bg-dark-2);
    overflow-y: auto;
    padding: 1.5rem 0;
    width: 22rem;
    box-shadow: var(--shadow-inset);
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--bg-dark-1);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed) ease;
}

/* In assets/docs/css/sidebar.css */

/* ... (existing sidebar styles) ... */

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color-light);
    background-color: var(--bg-dark);
    color: var(--text-light);
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: rgba(var(--bg-dark-rgb), 0.8); /* Make background slightly transparent */
    backdrop-filter: blur(5px); /* Apply blur to content behind */
    -webkit-backdrop-filter: blur(5px); /* For Safari support */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); /* Optional, for depth */
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}
/* You'd need to ensure --bg-dark-rgb is defined as R,G,B values, e.g., 30,30,40 */
:root {
    --bg-dark: #1E1E28; /* Original hex */
    --bg-dark-rgb: 30, 30, 40; /* RGB components for transparent background */
}

/* Optional: Stronger blur/tint when scrolled/stuck */
.sidebar-logo.is-scrolled {
    background-color: rgba(var(--bg-dark-rgb), 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sidebar-logo img {
    height: 32px;
    width: auto;
    border-radius: 5px;
}

.sidebar-logo .logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-light);
    white-space: nowrap;
}

.sidebar-logo .version-badge {
    background-color: rgba(138, 99, 237, 0.2);
    color: var(--color-primary-light);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    margin-left: auto;
    white-space: nowrap;
}

/* ... (rest of your sidebar.css content) ... */

/* Sidebar Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 0 1.5rem 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-bottom: 1rem;
    text-shadow: var(--shadow-glow-primary);
    padding-top: 1rem;
}

.sidebar-logo img {
    width: 32px;
    height: 32px;
    margin-right: 0.8rem;
    filter: drop-shadow(0 0 8px var(--color-accent));
}

.version-badge {
    background: linear-gradient(145deg, var(--color-primary-dark), var(--color-primary));
    color: white;
    font-size: 0.7em;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    margin-left: auto;
    box-shadow: var(--shadow-glow-primary-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Add or update this variable if not already defined for smaller glow */
:root {
    --shadow-glow-primary-sm: 0 0 5px var(--color-primary), inset 0 0 2px var(--color-primary-light);
}


/* Search Input */
.sidebar-search {
    width: calc(100% - 3rem);
    margin: 0 1.5rem 1.8rem 1.5rem;
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
    border-radius: var(--border-radius-base);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-input);
    color: var(--text-light);
    outline: none;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-speed) ease;
    font-family: var(--font-family-base);
}

.sidebar-search::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.sidebar-search:focus {
    background: rgba(42, 36, 90, 0.9);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow-accent), inset 0 0 10px rgba(0, 212, 255, 0.3);
    color: #fff;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0 1rem;
    flex-grow: 1;
}

.menu-item {
    margin-bottom: 0.7rem;
    overflow: hidden;
    background: var(--bg-card);
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-speed) ease;
}

.menu-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), var(--shadow-glow-primary);
}

.menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-radius: var(--border-radius-base);
    font-weight: 700;
    color: var(--color-primary-light);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    user-select: none;
    position: relative;
    border: 1px solid transparent;
}

.menu-link i[data-feather] {
    margin-right: 0.8rem;
    color: var(--color-accent);
    transition: transform var(--transition-speed) ease, color var(--transition-speed) ease;
    stroke-width: 2.2;
}

.menu-link:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: white;
    border-color: var(--color-primary-light);
}

.menu-link:hover i[data-feather] {
    transform: scale(1.1);
    color: white;
}

/* --- COLLAPSIBLE MENU LOGIC (UPDATED WITH HIGH SPECIFICITY & !important) --- */

/* General submenu list default (collapsed state) */
.sidebar-nav .menu-item.submenu > ul {
    list-style: none;
    padding: 0.5rem 0 0.5rem 0.75rem;
    margin: 0.5rem 0 0 0;
    display: block;
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.4s ease-out;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius-base);
}

/* General submenu list when active (expanded state) */
.sidebar-nav .menu-item.submenu.active > ul {
    max-height: 1000px !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

/* --- ARROW ROTATION LOGIC (UPDATED WITH DIRECT CHILD SELECTOR) --- */

/* Default arrow direction (pointing right) */
.submenu > .menu-link .arrow {
    transition: transform var(--transition-speed) ease;
    stroke-width: 2.5;
    color: var(--color-primary-light);
    transform: rotate(0deg) !important;
}

/* Arrow direction when its OWN submenu is active (pointing down) */
.submenu.active > .menu-link .arrow {
    transform: rotate(90deg) !important;
    color: var(--color-accent);
}

/* --- END COLLAPSIBLE MENU & ARROW LOGIC --- */

.api-endpoint {
    display: flex;
    align-items: center;
    /* Changed justify-content to start to allow badges to flow naturally */
    justify-content: flex-start;
    padding: 0.7rem 1.5rem;
    font-size: 0.9em;
    color: var(--text-muted);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    position: relative; /* Essential for positioning the 'SOON' badge */
    overflow: hidden; /* Ensures the 'SOON' badge doesn't spill out */
    padding-right: 50px; /* Make space for the "SOON" banner */
}

.api-endpoint .method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 20px;
    padding: 0 0.4rem;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 1px solid transparent;
    margin-right: 0.5rem; /* Space after the badge */
}


.api-endpoint:hover {
    background: rgba(42, 36, 90, 0.6); /* Lighter hover for sub-items */
    color: var(--text-light);
    transform: translateX(5px); /* Subtle slide on hover */
}

/* =============================== */
/* ACTIVE SIDEBAR LINK — ENHANCED */
/* =============================== */
.sidebar-nav a.active { /* This targets <a> tags specifically */
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-accent));
    background-size: 300% 300%;
    animation: gradientShift 6s ease-in-out infinite alternate;

    color: #fff;
    font-weight: 900;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
    padding: 0.6rem 1rem;
    margin: 0.25rem 0;
    border-left: 4px solid var(--color-accent-light);
    border-radius: 0 12px 12px 0;

    box-shadow:
        inset 0 0 8px var(--color-accent-light),
        0 0 16px rgba(0, 212, 255, 0.4);

    display: flex;
    align-items: center;
    gap: 0.6rem;

    transform: translateX(0);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Gradient background animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Hover effect on active for subtle feedback */
.sidebar-nav a.active:hover {
    transform: scale(1.02);
    box-shadow:
        inset 0 0 10px var(--color-accent-light),
        0 0 20px rgba(0, 212, 255, 0.5);
}

/* ============================= */
/* METHOD BADGE WITH CONTRAST   */
/* ============================= */
.sidebar-nav a.active .method-badge {
    background-color: var(--bg-dark-2);
    color: var(--color-accent-light);
    font-weight: 600;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;

    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 212, 255, 0.3);
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Method badge overrides */
.sidebar-nav a.active .method-badge.GET,
.sidebar-nav a.active .method-badge.POST,
.sidebar-nav a.active .method-badge.PUT,
.sidebar-nav a.active .method-badge.DELETE {
    background-color: var(--bg-dark-2);
}

/* ====================== */
/* Feather Icon Enhancer */
/* ====================== */
.sidebar-nav a.active i[data-feather] {
    color: #fff;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* ====================== */
/* Status Badge + Lock   */
/* ====================== */
.sidebar-nav a.active .status-badge {
    background-color: var(--color-accent-light);
    color: var(--bg-dark-1);
    box-shadow: 0 0 8px var(--color-accent-light), inset 0 0 5px #00000088;
    border-radius: 6px;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    transform: scale(1.05);
}

.sidebar-nav a.active .lock-icon {
    color: #fff;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.6));
    transform: scale(1.2);
    transition: all 0.3s ease;
}

.sidebar-nav a.active.disabled .lock-icon {
    filter: none;
    color: #666;
    transform: scale(1);
}

.method-badge {
    /* Core layout and sizing */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38em 0.9em;
    border-radius: 10px;
    min-width: 65px;
    text-align: center;
    margin-right: 15px;

    /* Typography */
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    font-size: 0.82em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);

    /* Visuals */
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    border: none;

    /* Interactivity & Performance */
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: default;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* IMPORTANT ADDITION FOR CHANGELOG BADGE VISIBILITY WHEN ACTIVE */
/* Ensure the version badge is always visible and styled correctly when its parent menu-link is active */
.sidebar-nav a.menu-link.active .version-badge {
    background-color: var(--bg-dark-2); /* Dark background for contrast */
    color: var(--color-accent-light); /* Accent color for text */
    font-weight: 600;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4), inset 0 0 3px rgba(0, 212, 255, 0.3);
    transform: scale(1.05);
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}


/* style.css or changelog.css */

.sidebar-nav .menu-item .version-badge {
    background-color: var(--color-primary); /* Use your primary color or a distinct one */
    color: var(--color-background); /* White or light text on the badge */
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65em; /* Smaller font size */
    font-weight: 700;
    margin-left: auto; /* Push to the right */
    display: inline-flex;
    align-items: center;
    height: fit-content;
    line-height: 1; /* Adjust line height for better vertical alignment */
    flex-shrink: 0; /* Prevent it from shrinking */
}

/* Optional: Style for when the menu link is hovered */
.sidebar-nav .menu-item .menu-link:hover .version-badge {
    filter: brightness(1.1); /* Slightly brighten on hover */
}

/* Specific colors and gradients for different HTTP methods */
.method-badge.GET {
    background-image: linear-gradient(to right, #1a719c 0%, #3498db 100%);
}

.method-badge.POST {
    background-image: linear-gradient(to right, #208e48 0%, #2ecc71 100%);
}

.method-badge.PUT {
    background-image: linear-gradient(to right, #c07d0f 0%, #f39c12 100%);
}

.method-badge.DELETE {
    background-image: linear-gradient(to right, #b43d30 0%, #e74c3c 100%);
}

/* Hover effects */
.method-badge:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    filter: brightness(1.2);
}

/* Styling for disabled API endpoints */
.api-endpoint.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
    color: #7f8c8d;
}

.api-endpoint.disabled .method-badge {
    filter: grayscale(100%) opacity(0.5);
    box-shadow: none;
    transform: none;
    border: none;
}

/* Styling for the lock icon for ADMIN_ONLY endpoints */
.api-endpoint .lock-icon {
    margin-left: -25px; /* Consistent spacing */
    width: 18px;
    height: 18px;
    color: #f1c40f;
    flex-shrink: 0;
    transition: color 0.3s ease;
    filter: drop-shadow(0 0 3px rgba(255, 204, 0, 0.5));
}

.api-endpoint.disabled .lock-icon {
    color: #b0b0b0;
    filter: none;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

/* Disabled State for Admin Only links */
.api-endpoint.disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(100%);
}

.submenu.nested-api-group > .menu-link {
    padding-left: 2.2rem;
    background: rgba(42, 36, 90, 0.7);
    color: var(--color-primary-light);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.25rem;
    border: 1px solid rgba(138, 99, 237, 0.1);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2);
}

.submenu.nested-api-group > .menu-link:hover {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: white;
    border-color: var(--color-primary-light);
}

/* Style for the UL containing the sub-sub-menu items */
.submenu.nested-api-group > ul {
    /* These styles apply in addition to the general .submenu ul styles, not overriding display/max-height */
    padding-left: 0.5rem;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-base);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Style for the individual API endpoint links within the nested group */
.submenu.nested-api-group .api-endpoint {
    padding-left: 2.8rem;
}

/* Adjust general api-endpoint active state to look good in nested menus */
.sidebar-nav a.active {
    box-shadow: var(--shadow-glow-accent);
    /* Removed padding-left: inherit; to keep the default <a>.active padding */
}

/* --- Styles for API Endpoint Status Badges --- */

/* Base style for all status badges (e.g., SOON, MAINTENANCE) */
.status-badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 999px; /* This makes it pill-shaped */
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase; /* Ensures text like 'SOON' is uppercase */
    letter-spacing: 0.05em;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); /* Adds a subtle inner shadow */
    white-space: nowrap; /* Prevents text from wrapping inside the badge */
    flex-shrink: 0; /* Prevents the badge from shrinking */
    margin-left: 8px; /* Provides consistent spacing from the endpoint name */
    vertical-align: middle; /* Helps align the badge vertically with the endpoint text */
    line-height: 1; /* Ensures consistent line height within the badge */
    color: #fff; /* White text color for both */
}

/* Specific style for MAINTENANCE badge */
.maintenance-badge {
    background-color: #555; /* A consistent grey background */
}

/* Specific style for COMING SOON badge */
.coming-soon-badge {
    background-color: #555; /* **This is the key change:** Set to the same grey as MAINTENANCE */
}

/* Styles for disabled API endpoint list items */
.api-endpoint.disabled {
    opacity: 0.5; /* Fades out the entire list item */
    pointer-events: none; /* Prevents any mouse events (clicks) on the disabled item */
}

/* Lock Icon for Admin Only */
.lock-icon {
    color: var(--color-danger);
    animation: blink 1.2s infinite ease-in-out;
    margin-left: -80px; /* Adjust as needed for alignment */
    flex-shrink: 0;
    filter: drop-shadow(0 0 5px var(--color-danger));
}


/* --- Global Sidebar Maintenance Mode Styles (from your previous code) --- */
.sidebar.maintenance-mode {
    filter: blur(3px); /* Adjust blur as needed */
    pointer-events: none; /* Make sidebar non-interactive */
    user-select: none; /* Prevent text selection */
}

.sidebar.maintenance-mode .sidebar-logo,
.sidebar.maintenance-mode .sidebar-search {
    opacity: 0.5;
}

.sidebar.maintenance-mode .sidebar-nav {
    opacity: 0.5;
}