/* FlashClips - Dark Theme Customizations */
/* Unified dark theme using Radzen CSS variables */

:root {
    /* === Custom Properties (reusable values) === */
    --fc-bg-dark: #0f0f1a;
    --fc-bg-card: #1a1a2e;
    --fc-bg-card-hover: #1f1f35;
    --fc-bg-input: rgba(255, 255, 255, 0.05);
    --fc-bg-input-hover: rgba(255, 255, 255, 0.08);
    --fc-border-subtle: rgba(255, 255, 255, 0.1);
    --fc-border-medium: rgba(255, 255, 255, 0.15);
    --fc-border-strong: rgba(255, 255, 255, 0.2);
    --fc-text-primary: #ffffff;
    --fc-text-secondary: rgba(255, 255, 255, 0.6);
    --fc-text-muted: rgba(255, 255, 255, 0.4);
    --fc-accent: #667eea;
    --fc-accent-secondary: #764ba2;
    --fc-accent-glow: rgba(102, 126, 234, 0.2);
    --fc-accent-active: #64b5f6;
    --fc-radius: 8px;
    --fc-radius-lg: 12px;

    /* === Radzen Base Colors === */
    --rz-base-background-color: var(--fc-bg-dark);
    --rz-base-50: var(--fc-bg-card);
    --rz-base-100: var(--fc-bg-card-hover);
    --rz-base-200: var(--fc-border-subtle);
    --rz-base-300: var(--fc-border-medium);
    --rz-base-400: var(--fc-border-strong);
    --rz-base-500: rgba(255, 255, 255, 0.3);
    --rz-base-600: rgba(255, 255, 255, 0.5);
    --rz-base-700: var(--fc-text-secondary);
    --rz-base-800: rgba(255, 255, 255, 0.8);
    --rz-base-900: var(--fc-text-primary);

    /* === Radzen Text Colors === */
    --rz-text-color: var(--fc-text-primary);
    --rz-text-secondary-color: var(--fc-text-secondary);
    --rz-text-tertiary-color: var(--fc-text-muted);

    /* === Radzen Brand Colors === */
    --rz-primary: var(--fc-accent);
    --rz-primary-light: #7c91ed;
    --rz-primary-lighter: #99a9f1;
    --rz-primary-dark: #5468c7;
    --rz-primary-darker: #4254a4;
    --rz-secondary: var(--fc-accent-secondary);

    /* === Radzen Layout === */
    --rz-sidebar-background-color: var(--fc-bg-card);
    --rz-body-background-color: var(--fc-bg-dark);
    --rz-border-color: var(--fc-border-subtle);

    /* === Radzen Card === */
    --rz-card-background-color: var(--fc-bg-card);
    --rz-card-border: 1px solid var(--fc-border-subtle);
    --rz-card-border-radius: var(--fc-radius-lg);

    /* === Radzen Dialog === */
    --rz-dialog-background-color: var(--fc-bg-card);
    --rz-dialog-border: 1px solid var(--fc-border-subtle);
    --rz-dialog-border-radius: 16px;
    --rz-dialog-titlebar-background-color: transparent;

    /* === Radzen Dropdown === */
    --rz-dropdown-background-color: var(--fc-bg-input);
    --rz-dropdown-border: 1px solid var(--fc-border-subtle);
    --rz-dropdown-border-radius: var(--fc-radius);
    --rz-dropdown-panel-background-color: var(--fc-bg-card);
    --rz-dropdown-item-hover-background-color: var(--fc-border-subtle);

    /* === Radzen Notification === */
    --rz-notification-background-color: var(--fc-bg-card);
    --rz-notification-border: 1px solid var(--fc-border-subtle);
    --rz-notification-border-radius: var(--fc-radius-lg);

    /* === Radzen Button === */
    --rz-button-border-radius: var(--fc-radius);

    /* === Radzen Input/Form Fields === */
    --rz-input-background-color: var(--fc-bg-input);
    --rz-input-border: 1px solid var(--fc-border-strong);
    --rz-input-value-color: var(--fc-text-primary);
    --rz-input-placeholder-color: var(--fc-text-muted);
    --rz-input-hover-background-color: var(--fc-bg-input-hover);
    --rz-input-hover-border: 1px solid rgba(255, 255, 255, 0.3);
    --rz-input-focus-background-color: var(--fc-bg-input-hover);
    --rz-input-focus-border: 1px solid var(--fc-accent);
    --rz-input-focus-shadow: 0 0 0 3px var(--fc-accent-glow);
    --rz-input-border-radius: var(--fc-radius);

    /* === Radzen Form Field Labels === */
    --rz-form-field-label-color: var(--fc-text-secondary);
    --rz-form-field-label-focus-color: rgba(255, 255, 255, 0.8);
    --rz-form-field-label-floating-background-color: transparent;

    /* === Radzen Form Field Filled Variant === */
    --rz-form-field-filled-background-color: var(--fc-bg-input);
    --rz-form-field-filled-hover-background-color: var(--fc-bg-input-hover);
    --rz-form-field-filled-border: 1px solid var(--fc-border-subtle);
    --rz-form-field-filled-hover-border: 1px solid var(--fc-border-medium);
    --rz-form-field-filled-focus-border: 1px solid var(--fc-accent);
    --rz-form-field-filled-border-radius: var(--fc-radius);
    --rz-form-field-filled-underline-display: none;
    --rz-form-field-filled-hover-shadow: none;
    --rz-form-field-filled-focus-shadow: 0 0 0 3px var(--fc-accent-glow);

    /* === Radzen DataGrid === */
    --rz-grid-background-color: transparent;
    --rz-grid-stripe-background-color: rgba(255, 255, 255, 0.03);
    --rz-grid-stripe-odd-background-color: var(--fc-bg-card);
    --rz-grid-hover-background-color: rgba(102, 126, 234, 0.15);
    --rz-grid-selected-background-color: rgba(102, 126, 234, 0.25);
    --rz-grid-header-background-color: var(--fc-bg-card);
    --rz-grid-header-sorted-background-color: var(--fc-bg-card-hover);
    --rz-grid-cell-border: 1px solid var(--fc-border-subtle);
    --rz-grid-header-cell-border: 1px solid var(--fc-border-subtle);
    --rz-grid-header-cell-border-bottom: 1px solid var(--fc-border-medium);
    --rz-grid-border: 1px solid var(--fc-border-subtle);
    --rz-grid-cell-focus-background-color: var(--fc-accent-glow);
    --rz-grid-frozen-cell-background-color: var(--fc-bg-card);

    /* === Radzen Panel Menu === */
    --rz-panel-menu-background-color: transparent;
    --rz-panel-menu-item-hover-background-color: var(--fc-border-subtle);
}

html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--fc-bg-dark);
}

/* Layout */
.rz-layout {
    min-height: 100vh;
    background: var(--fc-bg-dark);
}

/* Sidebar gradient */
.rz-sidebar {
    background: linear-gradient(180deg, var(--fc-bg-card) 0%, #16213e 100%) !important;
    border-right: 1px solid var(--fc-border-subtle) !important;
}

.sidebar-full-height {
    height: 100vh !important;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-top {
    flex: 1;
}

.sidebar-bottom {
    border-top: 1px solid var(--fc-border-subtle) !important;
}

/* Sidebar header */
.rz-sidebar .rz-p-2 {
    border-bottom: 1px solid var(--fc-border-subtle) !important;
}

/* App logo with gradient */
.app-logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--fc-accent) 0%, var(--fc-accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Panel menu styling */
.rz-panel-menu {
    background: transparent !important;
}

.rz-panel-menu-item {
    color: var(--fc-text-secondary) !important;
    border-radius: var(--fc-radius);
    margin: 2px 8px;
    transition: all 0.2s ease;
}

.rz-panel-menu-item:hover {
    background: var(--fc-border-subtle) !important;
    color: var(--fc-text-primary) !important;
}

.rz-panel-menu-item.rz-state-active,
.rz-panel-menu-item-selected,
.rz-panel-menu-item.rz-navigation-item-active {
    background: var(--fc-accent-glow) !important;
    color: var(--fc-accent-active) !important;
}

.rz-panel-menu-item.rz-state-active *,
.rz-panel-menu-item-selected *,
.rz-panel-menu-item.rz-navigation-item-active *,
.rz-panel-menu-item.rz-state-active .rz-navigation-item-text,
.rz-panel-menu-item-selected .rz-navigation-item-text,
.rz-panel-menu-item.rz-navigation-item-active .rz-navigation-item-text {
    color: var(--fc-accent-active) !important;
}

/* Fix for active navigation item wrapper */
.rz-navigation-item-wrapper-active {
    background: var(--fc-accent-glow) !important;
}

.rz-navigation-item-wrapper-active .rz-navigation-item-link,
.rz-navigation-item-wrapper-active .rz-navigation-item-text,
.rz-navigation-item-wrapper-active .rz-navigation-item-icon {
    color: var(--fc-accent-active) !important;
}

.rz-panel-menu-item-icon {
    color: inherit !important;
}

/* Navigation item text */
.rz-navigation-item-text {
    color: inherit !important;
}

/* Main body */
.rz-body {
    background: var(--fc-bg-dark) !important;
}

/* Cards */
.rz-card {
    background: var(--fc-bg-card) !important;
    border: 1px solid var(--fc-border-subtle) !important;
    border-radius: var(--fc-radius-lg) !important;
    color: var(--fc-text-primary) !important;
}

.rz-card:hover {
    background: var(--fc-bg-card-hover) !important;
    border-color: var(--fc-border-medium) !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6,
.rz-text-h1, .rz-text-h2, .rz-text-h3, .rz-text-h4, .rz-text-h5, .rz-text-h6 {
    color: var(--fc-text-primary) !important;
}

/* Card title */
.rz-card-title {
    color: var(--fc-text-primary) !important;
}

/* Text */
.rz-text-secondary-color {
    color: var(--fc-text-secondary) !important;
}

/* Buttons */
.rz-button {
    border-radius: var(--fc-radius) !important;
    transition: all 0.2s ease !important;
}

.rz-button.rz-primary {
    background: linear-gradient(135deg, var(--fc-accent) 0%, var(--fc-accent-secondary) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

.rz-button.rz-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

.rz-button.rz-light {
    background: var(--fc-bg-input-hover) !important;
    color: var(--fc-text-primary) !important;
    border: 1px solid var(--fc-border-subtle) !important;
}

.rz-button.rz-light:hover {
    background: var(--fc-border-medium) !important;
}

/* Sidebar toggle */
.rz-sidebar-toggle {
    color: var(--fc-text-primary) !important;
}

.rz-sidebar-toggle:hover {
    background: var(--fc-border-subtle) !important;
}

/* Radzen textarea specific */
.rz-textarea {
    resize: vertical;
}

/* Bootstrap form controls - for Identity pages */
.form-control {
    background: var(--fc-bg-input) !important;
    border: 1px solid var(--fc-border-subtle) !important;
    color: var(--fc-text-primary) !important;
    border-radius: var(--fc-radius) !important;
}

.form-control:focus {
    background: var(--fc-bg-input-hover) !important;
    border-color: var(--fc-accent) !important;
    box-shadow: 0 0 0 3px var(--fc-accent-glow) !important;
    color: var(--fc-text-primary) !important;
}

/* Hide browser credential/webauthn icons */
input::-webkit-credentials-auto-fill-button,
input::-webkit-contacts-auto-fill-button,
input::-webkit-credit-card-auto-fill-button,
input::-ms-reveal,
input::-ms-clear {
    visibility: hidden !important;
    display: none !important;
    pointer-events: none !important;
    position: absolute !important;
    right: 0;
    width: 0 !important;
    height: 0 !important;
}

/* Hide Chrome autofill decoration */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: var(--fc-text-primary) !important;
    transition: background-color 5000s ease-in-out 0s !important;
    box-shadow: inset 0 0 20px 20px var(--fc-bg-input) !important;
}

.form-control::placeholder {
    color: transparent !important;
}

.form-control:focus::placeholder {
    color: var(--fc-text-muted) !important;
}

/* Form labels */
.form-label,
label {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Bootstrap floating labels */
.form-floating > label {
    color: rgba(255, 255, 255, 0.5) !important;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Override Bootstrap floating label background */
.form-floating > .form-control:focus ~ label::after,
.form-floating > .form-control:not(:placeholder-shown) ~ label::after {
    background-color: transparent !important;
}

/* Form check (checkboxes) */
.form-check-input {
    background-color: var(--fc-bg-input) !important;
    border-color: var(--fc-border-strong) !important;
}

.form-check-input:checked {
    background-color: var(--fc-accent) !important;
    border-color: var(--fc-accent) !important;
}

.form-check-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Dropdown - uses CSS variables from :root */
.rz-dropdown {
    background: var(--fc-bg-input) !important;
    border: 1px solid var(--fc-border-subtle) !important;
    border-radius: var(--fc-radius) !important;
}

.rz-dropdown-panel {
    background: var(--fc-bg-card) !important;
    border: 1px solid var(--fc-border-subtle) !important;
    border-radius: var(--fc-radius) !important;
}

.rz-dropdown-item {
    color: var(--fc-text-primary) !important;
}

.rz-dropdown-item:hover {
    background: var(--fc-border-subtle) !important;
    color: var(--fc-text-primary) !important;
}

/* Dialog - uses CSS variables from :root */
.rz-dialog {
    background: var(--fc-bg-card) !important;
    border: 1px solid var(--fc-border-subtle) !important;
    border-radius: 16px !important;
}

.rz-dialog-titlebar {
    background: transparent !important;
    border-bottom: 1px solid var(--fc-border-subtle) !important;
}

.rz-dialog-content {
    color: var(--fc-text-primary) !important;
}

.rz-dialog .rz-dialog-content,
.rz-dialog .rz-dialog-content p,
.rz-dialog .rz-dialog-content span,
.rz-dialog .rz-dialog-content div,
.rz-dialog-confirm .rz-dialog-content,
.rz-dialog-confirm .rz-dialog-content p,
.rz-dialog-confirm-message,
.rz-dialog-alert-message {
    color: var(--fc-text-primary) !important;
}

.rz-dialog-title,
.rz-dialog .rz-dialog-titlebar {
    color: var(--fc-text-primary) !important;
}

/* HTML dialog element */
dialog {
    background: var(--fc-bg-card) !important;
    color: var(--fc-text-primary) !important;
    border: 1px solid var(--fc-border-subtle) !important;
    border-radius: var(--fc-radius-lg) !important;
}

/* Notifications - uses CSS variables from :root */
.rz-notification {
    background: var(--fc-bg-card) !important;
    border: 1px solid var(--fc-border-subtle) !important;
    border-radius: var(--fc-radius-lg) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--fc-bg-input);
}

::-webkit-scrollbar-thumb {
    background: var(--fc-border-strong);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #22c55e;
}

.invalid {
    outline: 1px solid #ef4444;
}

.validation-message,
.text-danger {
    color: #ef4444 !important;
}

/* Alerts */
.alert {
    border-radius: var(--fc-radius) !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #86efac !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.alert-warning {
    background: rgba(234, 179, 8, 0.15) !important;
    color: #fde047 !important;
    border: 1px solid rgba(234, 179, 8, 0.3) !important;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

/* Blazor error UI - colors only (positioning in MainLayout.razor.css) */
#blazor-error-ui {
    background: #b32121 !important;
    color: var(--fc-text-primary) !important;
}

#blazor-error-ui a {
    color: #fca5a5 !important;
}

#blazor-error-ui .dismiss {
    color: var(--fc-text-primary) !important;
}

/* Error boundary */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--fc-radius);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* Logout button styled as menu item */
.logout-form {
    margin: 0;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--fc-text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    text-align: left;
    transition: background-color 0.2s ease;
}

.logout-button:hover {
    background: var(--fc-border-subtle);
}

.logout-button .rz-navigation-item-icon {
    font-size: 1.25rem;
    color: var(--fc-text-secondary);
}

.logout-button .rz-navigation-item-text {
    color: var(--fc-text-primary);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Hidden checkbox for mobile menu toggle */
.mobile-menu-checkbox {
    display: none;
}

/* Mobile: Show top navbar, hide sidebar */
@media (max-width: 768px) {
    .rz-sidebar {
        display: none !important;
    }

    .rz-body {
        margin-left: 0 !important;
    }

    .mobile-header {
        display: flex !important;
    }

    .mobile-nav {
        display: block !important;
    }

    /* Adjust body padding for mobile header */
    .rz-layout > .rz-body {
        padding-top: 56px;
    }
}

/* Desktop: Hide mobile header and nav, show sidebar */
@media (min-width: 769px) {
    .mobile-header,
    .mobile-nav,
    .mobile-menu-checkbox {
        display: none !important;
    }
}

/* Mobile Header Styles */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(180deg, var(--fc-bg-card) 0%, #16213e 100%);
    border-bottom: 1px solid var(--fc-border-subtle);
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 1000;
}

.mobile-header .app-logo {
    font-size: 1.1rem;
}

.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--fc-text-primary);
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: var(--fc-radius);
    transition: background 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: var(--fc-border-subtle);
}

/* Toggle icon visibility based on checkbox state */
.mobile-menu-toggle .close-icon {
    display: none;
}

.mobile-menu-toggle .menu-icon {
    display: block;
}

.mobile-menu-checkbox:checked ~ .mobile-header .mobile-menu-toggle .close-icon {
    display: block;
}

.mobile-menu-checkbox:checked ~ .mobile-header .mobile-menu-toggle .menu-icon {
    display: none;
}

/* Mobile Navigation Dropdown */
.mobile-nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--fc-bg-card);
    border-bottom: 1px solid var(--fc-border-subtle);
    padding: 0.5rem 0;
    z-index: 999;
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

/* Show mobile nav when checkbox is checked */
.mobile-menu-checkbox:checked ~ .mobile-nav {
    max-height: 500px;
    opacity: 1;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--fc-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-nav-item:hover {
    background: var(--fc-border-subtle);
    color: var(--fc-text-primary);
}

.mobile-nav-item.active {
    background: var(--fc-accent-glow);
    color: var(--fc-accent-active);
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-divider {
    height: 1px;
    background: var(--fc-border-subtle);
    margin: 0.5rem 0;
}

/* ========================================
   DESKTOP SIDEBAR (CSS-only collapse)
   ======================================== */

/* Hidden checkbox for sidebar toggle */
.sidebar-checkbox {
    display: none;
}

/* Main Content - adapts to mobile/desktop */
.main-content {
    min-height: 100vh;
    background: var(--fc-bg-dark);
    margin-top: 56px; /* Mobile: space for header */
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

@media (min-width: 769px) {
    .main-content {
        margin-top: 0;
        margin-left: 240px; /* Desktop: space for sidebar */
    }

    .sidebar-checkbox:not(:checked) ~ .main-content {
        margin-left: 60px; /* Collapsed sidebar */
    }

    /* Study page follows sidebar state */
    .main-content .study-page {
        left: 240px;
        top: 0;
        transition: left 0.3s ease;
    }

    .sidebar-checkbox:not(:checked) ~ .main-content .study-page {
        left: 60px; /* Collapsed sidebar */
    }
}

/* Desktop Sidebar */
.desktop-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: linear-gradient(180deg, var(--fc-bg-card) 0%, #16213e 100%);
    border-right: 1px solid var(--fc-border-subtle);
    transition: width 0.3s ease;
    flex-shrink: 0;
    z-index: 100;
}

/* Collapsed state */
.sidebar-checkbox:not(:checked) ~ .desktop-sidebar {
    width: 60px;
}

.sidebar-checkbox:not(:checked) ~ .desktop-sidebar .sidebar-logo,
.sidebar-checkbox:not(:checked) ~ .desktop-sidebar .nav-text,
.sidebar-checkbox:not(:checked) ~ .desktop-sidebar .user-name {
    display: none;
}

.sidebar-checkbox:not(:checked) ~ .desktop-sidebar .sidebar-nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-checkbox:not(:checked) ~ .desktop-sidebar .sidebar-header {
    justify-content: center;
}

/* Sidebar Content */
.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-top {
    flex: 1;
}

.sidebar-bottom {
    border-top: 1px solid var(--fc-border-subtle);
    padding-top: 0.5rem;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--fc-border-subtle);
    gap: 0.5rem;
}

.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--fc-text-primary);
    cursor: pointer;
    border-radius: var(--fc-radius);
    transition: background 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: var(--fc-border-subtle);
}

.sidebar-toggle-btn i {
    font-size: 1.25rem;
}

.sidebar-logo {
    font-size: 1.25rem;
    transition: opacity 0.3s ease;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 2px 8px;
    color: var(--fc-text-secondary);
    text-decoration: none;
    border-radius: var(--fc-radius);
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: calc(100% - 16px);
}

.sidebar-nav-item:hover {
    background: var(--fc-border-subtle);
    color: var(--fc-text-primary);
}

.sidebar-nav-item.active {
    background: var(--fc-accent-glow);
    color: var(--fc-accent-active);
    font-weight: 500;
}

.sidebar-nav-item.active i {
    color: var(--fc-accent-active);
}

.sidebar-nav-item i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.nav-text {
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

/* User name */
.user-name {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--fc-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Logout button */
.logout-btn {
    font-size: 0.875rem;
}

/* Hide desktop sidebar on mobile */
@media (max-width: 768px) {
    .desktop-sidebar {
        display: none;
    }
}

/* Deck Card Hover Effect */
.deck-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.deck-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--fc-accent) !important;
}

/* Toast Notifications - Bottom Right */
.rz-notification-container {
    top: auto !important;
    bottom: 1rem !important;
    right: 1rem !important;
    left: auto !important;
}

/* ========================================
   ACCOUNT PAGES STYLING
   ======================================== */

/* Auth pages (Login, Register) - centered card */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem !important;
}

.auth-link {
    color: var(--fc-accent) !important;
    text-decoration: none !important;
    font-weight: 500;
}

.auth-link:hover {
    color: var(--fc-accent-active) !important;
    text-decoration: underline !important;
}

.auth-passkey-link {
    color: var(--fc-text-secondary) !important;
    font-size: 0.875rem;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.auth-passkey-link:hover {
    color: var(--fc-text-primary) !important;
    text-decoration: underline;
}

/* Manage pages */
.manage-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Account Manage Navigation */
.manage-nav-card {
    padding: 0.75rem !important;
    position: sticky;
    top: 1rem;
}

.manage-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--fc-text-secondary);
    text-decoration: none !important;
    border-radius: var(--fc-radius);
    transition: all 0.2s ease;
}

.manage-nav-item:hover {
    background: var(--fc-border-subtle);
    color: var(--fc-text-primary);
}

.manage-nav-item.active {
    background: var(--fc-accent-glow);
    color: var(--fc-accent-active);
}

.manage-nav-item .rzi,
.manage-nav-item .rz-icon {
    font-size: 1.25rem;
}

/* Links in manage pages */
.manage-page a:not(.rz-button):not(.manage-nav-item) {
    color: var(--fc-accent);
    text-decoration: none;
}

.manage-page a:not(.rz-button):not(.manage-nav-item):hover {
    color: var(--fc-accent-active);
    text-decoration: underline;
}

/* Mobile: Stack nav on top */
@media (max-width: 991px) {
    .manage-nav-card {
        position: static;
        margin-bottom: 1rem;
    }
}

/* External login button with Google icon */
.external-login-google {
    background: #ffffff !important;
    color: #1f1f1f !important;
    border: 1px solid var(--fc-border-medium) !important;
}

.external-login-google:hover {
    background: #f8f9fa !important;
    border-color: var(--fc-border-strong) !important;
}

.external-login-google .google-icon {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
}

/* External login item in manage page */
.external-login-item {
    padding: 1rem;
    background: var(--fc-bg-input);
    border-radius: var(--fc-radius);
    border: 1px solid var(--fc-border-subtle);
}

/* === Language Menu === */
.language-menu {
    margin-bottom: 0.5rem;
}

.language-menu-header {
    cursor: pointer;
}

.language-menu-items {
    padding-left: 1rem;
}

.language-menu-item {
    font-size: 0.9rem;
}

.language-flag-img {
    width: 24px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 2px;
    object-fit: cover;
}
