/* ========================================= */
/* General UI Components (e.g., Code Blocks, Buttons, Alerts)
/* ========================================= */

/* Code Highlighting (Prism.js adjustments) */
pre[class*="language-"] {
    background-color: #1a1a2e !important; /* Darker background for code */
    border-radius: var(--border-radius-base) !important;
    padding: 1.5rem !important;
    margin-bottom: 2rem !important;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(138, 99, 237, 0.2);
    overflow-x: auto;
    font-family: var(--font-family-mono) !important; /* Ensure monospace font */
    font-size: 0.95rem; /* Consistent font size */
    line-height: 1.6; /* Consistent line height */
}

code[class*="language-"] {
    font-family: var(--font-family-mono) !important; /* Ensure monospace font for all code */
}

:not(pre)>code[class*="language-"] {
    background-color: rgba(0, 0, 0, 0.4) !important;
    padding: 0.2em 0.4em !important;
    border-radius: 4px !important;
    color: var(--color-accent) !important;
    font-family: var(--font-family-mono) !important; /* Ensure monospace font for inline code */
    white-space: nowrap; /* Prevent inline code from wrapping */
}

/* Prism.js specific token colors - adjust to match your theme */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #85859e; }
.token.punctuation { color: #ccd6f6; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #ff675a; } /* Reddish-orange */
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #a4e062; } /* Green */
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #ffbe6a; } /* Orange */
.token.atrule, .token.keyword { color: #8a63ed; } /* Primary Purple */
.token.function { color: #00d4ff; } /* Accent Cyan */
.token.regex, .token.important, .token.variable { color: #e99000; } /* Darker Orange */

/* --- Coming Soon Badge --- */
.coming-soon-wrapper {
    position: relative;
    pointer-events: none; /* Disable clicks on wrapper */
    opacity: 0.6;
    filter: grayscale(80%);
    display: block; /* Ensure it takes up space even if inner elements are flex/inline */
}
.blurred-for-coming-soon {
    filter: blur(2px);
    transition: filter var(--transition-speed) ease;
}

/* --- Responsive Table --- */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: var(--border-radius-base);
    box-shadow: var(--shadow-card);
}

.table {
    width: 100%;
    border-collapse: separate; /* For rounded corners */
    border-spacing: 0;
    font-size: 0.95em;
    background-color: var(--bg-card); /* Table background */
    border-radius: var(--border-radius-base);
}

.table thead th {
    background-color: var(--color-primary-dark);
    color: var(--text-light);
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

.table tbody tr:hover {
    background-color: rgba(138, 99, 237, 0.1); /* Subtle hover effect */
}

.table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    vertical-align: top;
}

.table tr:last-child td {
    border-bottom: none;
}

.table th:first-child,
.table td:first-child {
    border-top-left-radius: var(--border-radius-base);
    border-bottom-left-radius: var(--border-radius-base);
}

.table th:last-child,
.table td:last-child {
    border-top-right-radius: var(--border-radius-base);
    border-bottom-right-radius: var(--border-radius-base);
}

/* --- General Navigation Link Styles --- */
.nav-link {
    color: var(--text-muted); /* Default link color, slightly muted */
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-sm);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    display: flex; /* For icon and text alignment */
    align-items: center;
    font-size: 1rem; /* Base font size */
    font-weight: 500; /* Medium weight */
}

.nav-link i {
    margin-right: 0.5rem; /* Space between icon and text */
    color: var(--text-dark); /* Default icon color, darker */
    transition: color 0.2s ease;
    font-size: 1.1rem; /* Slightly larger icon */
}

.nav-link:hover {
    background-color: var(--bg-dark-3); /* Subtle background on hover */
    color: var(--color-primary-light); /* Brighter text on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: var(--shadow-card-sm); /* Subtle shadow on hover */
}

.nav-link:hover i {
    color: var(--color-primary); /* Brighter icon color on hover */
}

/* Active state for navigation links */
.nav-link.active {
    color: var(--color-accent); /* Vibrant accent color for active link */
    font-weight: 700; /* Bold for active */
    background-color: rgba(var(--color-accent-rgb), 0.1); /* Light accent background */
    border-bottom: 2px solid var(--color-accent); /* Strong underline effect */
    padding-bottom: calc(0.6rem - 2px); /* Adjust padding to make space for the border */
    transform: translateY(0); /* Remove hover lift if active */
}

.nav-link.active i {
    color: var(--color-accent); /* Icon matches active text color */
}

/* ========================================= */
/* Mobile Menu Button Styles (Highest Priority & Z-Index Control)
/* ========================================= */

/* General mobile menu button styles */
.mobile-menu-button {
    background: none; /* Ensure no default background */
    border: none;
    color: var(--text-light); /* Your default icon color */
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* IMPORTANT Z-INDEX: Higher than sidebar (100) and overlay (99) */
    z-index: 105; /* Give it a very high z-index to be absolutely on top */
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease; /* Add background-color to transition */
    outline: none; /* Crucial to remove default browser outline on focus */
    -webkit-tap-highlight-color: transparent; /* Remove the tap highlight on mobile devices */
}

.mobile-menu-button:hover {
    color: var(--color-accent); /* A brighter color on hover */
    background-color: transparent; /* Ensure hover doesn't add background either */
    box-shadow: none;
}

/* **THE FIX FOR ACTIVE/FOCUS BACKGROUND** */
/* Target the button itself by its ID and class for maximum specificity, and its icon for absolute certainty */
/* This section should ideally be at the very bottom of your components.css or an even later loaded file. */
button#sidebarToggle:active,
button#sidebarToggle:focus,
.mobile-menu-button:active, /* General class active */
.mobile-menu-button:focus, /* General class focus */
.mobile-menu-button.d-lg-none:active, /* Specific class active (if using Bootstrap d-lg-none) */
.mobile-menu-button.d-lg-none:focus { /* Specific class focus */
    background-color: transparent !important; /* Force transparent background */
    background: none !important; /* Force no background image/gradient */
    border: none !important; /* Force no border */
    box-shadow: none !important; /* Force no box shadow */
    color: var(--color-accent-light) !important; /* Keep the subtle visual feedback */
    outline: none !important; /* Force removal of default focus outlines */
    -webkit-tap-highlight-color: transparent !important; /* Re-apply with !important for mobile */
}

/* Also, target the icon inside the button for absolute certainty */
button#sidebarToggle:active i,
button#sidebarToggle:focus i,
.mobile-menu-button:active i,
.mobile-menu-button:focus i,
.mobile-menu-button.d-lg-none:active i,
.mobile-menu-button.d-lg-none:focus i {
    background-color: transparent !important;
    background: none !important;
    box-shadow: none !important;
    color: var(--color-accent-light) !important; /* Keep the subtle visual feedback */
}


/* ========================================= */
/* Overlay Styles (Ensure correct Z-Index)
/* ========================================= */
.overlay {
    position: fixed; /* Important: must be fixed or absolute for z-index to work */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Standard dark overlay color */
    z-index: 99; /* Ensure this is LESS than mobile-menu-button (105) and main-header (102) */
    opacity: 0;
    visibility: hidden; /* Start hidden */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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