/* Modern Design System */
:root {
    /* Color Palette - Modern Sophisticated */
    --primary-gradient: linear-gradient(135deg, #3256f8 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: #a0aec0;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --bg-dark: #1a202c;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
}

/* Modern Navigation Bar */
.navbar-modern {
    background: var(--primary-gradient);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.navbar-modern.navbar-scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-lg);
}

/* Brand Styling */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-1px);
}

.brand-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-text {
    background: linear-gradient(45deg, #ffffff, #f0f8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Navigation Links */
.navbar-modern .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
}

.navbar-modern .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-modern .nav-link.active,
.navbar-modern .nav-link:focus {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
}

/* User Avatar */
.user-avatar, .user-avatar-large {
    width: 32px;
    height: 32px;
    background: var(--secondary-gradient);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

.user-dropdown {
    display: flex;
    align-items: center;
}

/* Modern Dropdown Menus */
.dropdown-menu-modern {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.dropdown-menu-modern .dropdown-item {
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.dropdown-menu-modern .dropdown-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.dropdown-menu-modern .dropdown-item i {
    width: 18px;
    opacity: 0.7;
}

.dropdown-menu-modern .dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

.user-info {
    text-align: center;
}

.dropdown-menu-modern .dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-light);
}

/* CTA Button in Navbar */
.navbar-btn {
    padding: 0.5rem 1.5rem !important;
    font-weight: 600;
    border-radius: var(--radius-lg);
    background: white !important;
    color: var(--primary-color) !important;
    border: none !important;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.navbar-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--bg-secondary) !important;
}

/* Main Content Layout */
.main-content {
    padding-top: 80px;
    min-height: calc(100vh - 140px);
}

.content-wrapper {
    padding: 2rem 0;
}

.content-section {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

/* Modern Alerts/Messages */
.modern-alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
}

.alert-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border-left-color: #22c55e;
}

.alert-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    color: #991b1b;
    border-left-color: #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border-left-color: #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border-left-color: #3b82f6;
}

/* Modern Buttons */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-gradient);
    filter: brightness(1.05);
}

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Form Styling */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: var(--bg-primary);
}

.form-check-input:checked {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
}

/* Modern Footer */
.footer-modern {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: 2rem 0;
    margin-top: 3rem;
    color: var(--text-secondary);
}

/* Cards and Lists */
.review-list-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.review-list-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Navigation Pills */
.nav-pills .nav-link {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.nav-pills .nav-link.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

.nav-pills .nav-link:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* Tables */
.table {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.table thead {
    background: var(--bg-tertiary);
}

.table th {
    font-weight: 600;
    color: var(--text-primary);
    border: none;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    border-color: var(--border-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-section {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: var(--radius-lg);
}
    
    .navbar-modern .navbar-nav {
        padding: 1rem 0;
}

    .dropdown-menu-modern {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: 1px solid var(--border-light);
        margin: 0.5rem 0;
    }
    
    .user-dropdown span {
        display: inline !important;
    }
    
    /* Stack credits info on mobile */
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .d-flex.align-items-center:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        width: 100%;
    }
    
    .d-flex.align-items-center .gap-2 {
        margin-top: 0.5rem;
        align-self: flex-start;
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.bg-gradient-primary {
    background: var(--primary-gradient);
}

.bg-gradient-secondary {
    background: var(--secondary-gradient);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Accessibility */
.focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a202c;
        --bg-secondary: #2d3748;
        --bg-tertiary: #4a5568;
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --text-muted: #a0aec0;
        --border-color: #4a5568;
        --border-light: #2d3748;
}
    
    /* Override Bootstrap's text utilities for dark mode */
    .text-muted {
        color: var(--text-muted) !important;
}
    
    .text-primary {
        color: var(--primary-color) !important;
    }
    
    .text-secondary {
        color: var(--text-secondary) !important;
}
    
    .text-dark {
        color: var(--text-primary) !important;
    }
    
    .text-success {
        color: #22c55e !important;
}

    .text-danger {
        color: #ef4444 !important;
    }
    
    .text-warning {
        color: #f59e0b !important;
    }
    
    .text-info {
        color: #3b82f6 !important;
    }
    
    /* Override Bootstrap background utilities */
    .bg-light {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
}

    .bg-white {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    .bg-secondary {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
}

    /* Card components */
    .card {
        background-color: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .card-header {
        background-color: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .card-body {
        color: var(--text-primary) !important;
    }
    
    .card-title {
        color: var(--text-primary) !important;
}

    .card-text {
        color: var(--text-secondary) !important;
    }
    
    /* Accordion components */
    .accordion-item {
        background-color: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
}

    .accordion-button {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
}

    .accordion-button:not(.collapsed) {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    .accordion-button:focus {
        border-color: var(--primary-color) !important;
        box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25) !important;
    }
    
    .accordion-body {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    /* List groups */
    .list-group-item {
        background-color: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    /* Badge overrides */
    .badge.bg-secondary {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

    .badge.bg-light {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Border utilities */
    .border {
        border-color: var(--border-color) !important;
    }

    .border-bottom {
        border-bottom-color: var(--border-color) !important;
    }
    
    .border-top {
        border-top-color: var(--border-color) !important;
    }

    /* Report specific styles */
.report-container {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
}

.report-content-markdown {
        color: var(--text-primary) !important;
}

.report-content-markdown h1,
.report-content-markdown h2,
.report-content-markdown h3,
    .report-content-markdown h4,
    .report-content-markdown h5,
    .report-content-markdown h6 {
        color: var(--text-primary) !important;
}

    .report-content-markdown p {
        color: var(--text-primary) !important;
}

    .report-content-markdown li {
        color: var(--text-primary) !important;
}

.report-content-markdown code {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
}

.report-content-markdown pre {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    .report-content-markdown blockquote {
        border-left-color: var(--border-color) !important;
        color: var(--text-muted) !important;
    }
    
    /* Additional Bootstrap overrides for specific pages */
    .fst-italic {
        color: var(--text-secondary) !important;
    }
    
    .fw-bold, .fw-semibold {
        color: var(--text-primary) !important;
    }
    
    .lead {
        color: var(--text-secondary) !important;
    }
    
    .h1, .h2, .h3, .h4, .h5, .h6,
    h1, h2, h3, h4, h5, h6 {
        color: var(--text-primary) !important;
    }
    
    .alert-heading {
        color: var(--text-primary) !important;
    }
    
    .visually-hidden {
        color: inherit !important;
    }
    
    small, .small {
        color: var(--text-muted) !important;
    }
    
    /* Badge variations */
    .badge.bg-primary {
        background: var(--primary-gradient) !important;
        color: white !important;
    }
    
    .badge.bg-success {
        background: linear-gradient(135deg, #22c55e, #16a34a) !important;
        color: white !important;
    }
    
    .badge.bg-danger {
        background: linear-gradient(135deg, #ef4444, #dc2626) !important;
        color: white !important;
    }
    
    .badge.bg-warning {
        background: linear-gradient(135deg, #f59e0b, #d97706) !important;
        color: white !important;
    }
    
    .badge.bg-info {
        background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
        color: white !important;
    }
    
    /* Status badges for tickets/reviews */
    .badge.bg-open { background: var(--primary-gradient) !important; }
    .badge.bg-closed { background: var(--bg-tertiary) !important; color: var(--text-primary) !important; }
    .badge.bg-resolved { background: linear-gradient(135deg, #22c55e, #16a34a) !important; }
    
        /* Spinner component */
    .spinner-border {
        border-color: var(--border-color);
        border-top-color: var(--primary-color);
    }
    
    /* Button variations for dark mode */
    .btn-outline-primary {
        color: var(--primary-color) !important;
        border-color: var(--primary-color) !important;
    }
    
    .btn-outline-primary:hover {
        background-color: var(--primary-color) !important;
        border-color: var(--primary-color) !important;
        color: white !important;
    }
    
    .btn-outline-secondary {
        color: var(--text-secondary) !important;
        border-color: var(--border-color) !important;
    }
    
    .btn-outline-secondary:hover {
        background-color: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    /* Modal components */
    .modal-content {
        background-color: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .modal-header {
        background-color: var(--bg-primary) !important;
        border-bottom-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .modal-body {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    .modal-footer {
        background-color: var(--bg-primary) !important;
        border-top-color: var(--border-color) !important;
    }
    
    .modal-title {
        color: var(--text-primary) !important;
    }
    
    .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }
    
    /* Toast components */
    .toast {
        background-color: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .toast-header {
        background-color: var(--bg-tertiary) !important;
        border-bottom-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .toast-body {
        color: var(--text-primary) !important;
    }
    
    /* Warning/Success toast overrides */
    .toast-header.bg-success {
        background: linear-gradient(135deg, #22c55e, #16a34a) !important;
        color: white !important;
    }
    
    /* Small text and muted content */
    .small, small {
        color: var(--text-muted) !important;
    }
    
    .text-muted.ms-2 {
        color: var(--text-muted) !important;
    }
    
    /* HR elements */
    hr, .hr {
        border-color: var(--border-color) !important;
        opacity: 0.3;
    }
    
    /* Warning and alert card headers */
    .card-header.bg-warning {
        background: linear-gradient(135deg, #f59e0b, #d97706) !important;
        color: white !important;
        border-color: var(--border-color) !important;
    }
    
    .card-header.bg-warning .h5,
    .card-header.bg-warning h3,
    .card-header.bg-warning h5 {
        color: white !important;
    }
    
    .border-warning {
        border-color: #f59e0b !important;
    }
    
    /* Success card headers */
    .card-header.bg-success {
        background: linear-gradient(135deg, #22c55e, #16a34a) !important;
        color: white !important;
    }
    
    .card-header.bg-success .h5,
    .card-header.bg-success h3,
    .card-header.bg-success h5 {
        color: white !important;
    }
    
    .border-success {
        border-color: #22c55e !important;
    }
    
    /* Danger card headers */
    .card-header.bg-danger {
        background: linear-gradient(135deg, #ef4444, #dc2626) !important;
        color: white !important;
    }
    
    .card-header.bg-danger .h5,
    .card-header.bg-danger h3,
    .card-header.bg-danger h5 {
        color: white !important;
    }
    
    .border-danger {
        border-color: #ef4444 !important;
    }
    
    /* Text elements that need explicit dark mode handling */
    .text-dark {
        color: var(--text-primary) !important;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        background-color: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    .dropdown-item {
        color: var(--text-primary) !important;
    }
    
    .dropdown-item:hover,
    .dropdown-item:focus {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Button close in dark mode */
    .btn-close:hover {
        opacity: 0.75;
    }

    /* Fix table-light header in dark mode - more specific selectors */
    .table thead.table-light {
        background-color: var(--bg-tertiary) !important;
    }
    
    .table thead.table-light th {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
        border-color: var(--border-color) !important;
    }
    
    /* Fix table hover effects in dark mode */
    .table-hover tbody tr:hover {
        background-color: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }
    
    .table-hover tbody tr:hover td {
        color: var(--text-primary) !important;
    }
    
    .table-hover tbody tr:hover td a {
        color: var(--primary-color) !important;
    }
    
    .table-hover tbody tr:hover td .text-dark {
        color: var(--text-primary) !important;
    }

    /* Fix btn-light in dark mode for guest banner */
    .btn-light {
        background-color: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }
    
    .btn-light:hover,
    .btn-light:focus {
        background-color: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    /* Ensure all text elements use proper variables */
    body, .container, .content-section, p, h1, h2, h3, h4, h5, h6 {
        color: var(--text-primary);
    }
    
    /* Feature cards text */
    .feature-card p,
    .feature-col p {
        color: var(--text-secondary) !important;
    }
    
    .feature-card h3,
    .feature-col h3 {
        color: var(--text-primary) !important;
    }
    
    /* Section titles */
    .section-title {
        color: var(--text-primary) !important;
    }
    
    /* Final CTA section */
    .final-cta-reimagined h2 {
        color: var(--text-primary) !important;
    }
    
    .final-cta-reimagined .lead {
        color: var(--text-secondary) !important;
    }
    
    /* Navigation */
    .navbar-modern {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    /* Cards and content sections */
    .content-section {
        background: var(--bg-primary);
        border-color: var(--border-color);
    }
    
    .feature-card {
        background: var(--bg-primary);
        border-color: var(--border-color);
    }
    
    .review-list-item {
        background: var(--bg-primary);
        border-color: var(--border-color);
    }
    
    /* Dropdown menus */
    .dropdown-menu-modern {
        background: var(--bg-primary);
        border-color: var(--border-color);
    }
    
    .dropdown-menu-modern .dropdown-item {
        color: var(--text-primary);
    }
    
    .dropdown-menu-modern .dropdown-item:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }
    
    /* Forms */
    .form-control {
        background: var(--bg-primary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .form-control:focus {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .form-control::placeholder {
        color: var(--text-muted) !important;
        opacity: 0.8;
    }
    
    /* Help text for forms */
    .form-text,
    .help-block,
    small.form-text {
        color: var(--text-muted) !important;
    }
    
    /* Crispy forms help text */
    .form-control + .form-text,
    .form-control + small,
    .crispy-help-text,
    .helptext,
    #hint_id_user_topic {
        color: var(--text-muted) !important;
    }
    
    /* Django form labels */
    .control-label,
    label {
        color: var(--text-primary) !important;
    }
    
    /* Form group styling */
    .form-group {
        color: var(--text-primary);
    }
    
    /* Select elements */
    .form-select,
    select.form-control {
        background: var(--bg-primary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .form-select:focus,
    select.form-control:focus {
        background: var(--bg-primary);
        border-color: var(--primary-color);
        color: var(--text-primary);
    }
    
    /* Textarea specific */
    textarea.form-control {
        background: var(--bg-primary);
        color: var(--text-primary);
    }
    
    textarea.form-control::placeholder {
        color: var(--text-muted) !important;
        opacity: 0.7;
    }
    
    /* Tables - Enhanced for better dark mode support */
    .table {
        color: var(--text-primary) !important;
        border-color: var(--border-color);
        background-color: var(--bg-primary);
    }
    
    .table thead {
        background: var(--bg-tertiary);
    }
    
    .table th {
        color: var(--text-primary) !important;
        background-color: var(--bg-tertiary) !important;
    }
    
    .table td {
        border-color: var(--border-color);
        color: var(--text-primary) !important;
        background-color: var(--bg-primary);
    }
    
    .table td a {
        color: var(--primary-color) !important;
    }
    
    .table td .text-dark {
        color: var(--text-primary) !important;
    }
    
    /* Footer */
    .footer-modern {
        background: var(--bg-primary);
        border-color: var(--border-color);
        color: var(--text-secondary);
    }
}

/* Favorite Button Styling */
.favorite-btn {
    border: 1px solid #dee2e6;
    background: transparent;
    transition: all 0.2s ease;
    padding: 0.375rem 0.75rem;
}

.favorite-btn:hover {
    border-color: #adb5bd;
    background: rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.favorite-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

.favorite-btn i {
    font-size: 1rem;
    transition: all 0.2s ease;
}

.favorite-btn i.bi-star {
    color: #6c757d;
}

.favorite-btn i.bi-star-fill {
    color: #ffc107;
}

.favorite-btn:hover i.bi-star {
    color: #495057;
}

.favorite-btn:hover i.bi-star-fill {
    color: #ffb307;
}

/* Favorite button in dark mode */
@media (prefers-color-scheme: dark) {
    .favorite-btn {
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .favorite-btn:hover {
        border-color: #6c757d;
        background: rgba(255,255,255,0.05);
    }
    
    .favorite-btn i.bi-star {
        color: var(--text-muted);
    }
    
    .favorite-btn:hover i.bi-star {
        color: var(--text-secondary);
    }
} 

.pro-plan {
    border: 2px solid #be8a1a;  /* Or your accent color */
    box-shadow: 0 0 20px rgba(123, 97, 255, 0.2); 
    border-radius: 0.5rem;
}

.basic-plan {
    border: 2px solid #7b61ff;  /* Or your accent color */
    box-shadow: 0 0 20px rgba(123, 97, 255, 0.2); 
    border-radius: 0.5rem;
}

/* ===== Enhanced Field of Study Dropdown Styling ===== */
.field-of-study-dropdown {
    position: relative;
}

/* Select2 Custom Styling for Field of Study */
.select2-container--bootstrap-5 .field-of-study-dropdown + .select2-container .select2-selection--single {
    height: 48px !important;
    border: 2px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    padding: 8px 16px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    position: relative;
}

.select2-container--bootstrap-5 .field-of-study-dropdown + .select2-container .select2-selection--single:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    transform: translateY(-1px) !important;
}

.select2-container--bootstrap-5 .field-of-study-dropdown + .select2-container.select2-container--focus .select2-selection--single {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15) !important;
}

/* Custom Search Icon Integration */
.select2-container--bootstrap-5 .field-of-study-dropdown + .select2-container .select2-selection__rendered {
    padding-left: 12px !important;
    line-height: 32px !important;
    color: var(--text-primary) !important;
    font-weight: 500 !important;
}

.select2-container--bootstrap-5 .field-of-study-dropdown + .select2-container .select2-selection__placeholder {
    color: var(--text-muted) !important;
    font-style: italic !important;
}

.select2-container--bootstrap-5 .field-of-study-dropdown + .select2-container .select2-selection__arrow {
    height: 46px !important;
    right: 12px !important;
}

.select2-container--bootstrap-5 .field-of-study-dropdown + .select2-container .select2-selection__arrow b {
    border-color: var(--primary-color) transparent transparent transparent !important;
    border-width: 6px 6px 0 6px !important;
}

/* Enhanced Dropdown Menu Styling */
.select2-container--bootstrap-5 .select2-dropdown {
    border: 2px solid var(--primary-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    z-index: 9999 !important;
    margin-top: 4px !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown {
    padding: 8px !important;
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-light) !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    border: 2px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 16px 12px 40px !important;
    font-size: 1rem !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23718096" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: 12px center !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
    outline: none !important;
}

/* Enhanced Results Styling with Visual Hierarchy */
.select2-container--bootstrap-5 .select2-results__options {
    max-height: 400px !important;
    padding: 0 !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 12px 16px !important;
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
    border-bottom: 1px solid var(--border-light) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.select2-container--bootstrap-5 .select2-results__option:last-child {
    border-bottom: none !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    transform: translateX(4px) !important;
}

/* Special styling for root disciplines (with book icon) */
.select2-container--bootstrap-5 .select2-results__option[id*="📚"] {
    font-weight: 600 !important;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    color: var(--text-primary) !important;
    border-left: 4px solid var(--primary-color) !important;
    margin: 2px 0 !important;
}

.select2-container--bootstrap-5 .select2-results__option[id*="📚"]:hover,
.select2-container--bootstrap-5 .select2-results__option[id*="📚"].select2-results__option--highlighted {
    background: var(--primary-gradient) !important;
    color: white !important;
}

/* Special styling for sub-disciplines (with book icon) */
.select2-container--bootstrap-5 .select2-results__option[id*="📖"] {
    font-weight: 400 !important;
    color: var(--text-secondary) !important;
    padding-left: 24px !important;
    font-size: 0.9rem !important;
}

/* Special styling for popular disciplines (with star icon) */
.select2-container--bootstrap-5 .select2-results__option[id*="⭐"] {
    font-weight: 500 !important;
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%) !important;
    color: #c2410c !important;
    border-left: 4px solid #ea580c !important;
    margin: 1px 0 !important;
}

.select2-container--bootstrap-5 .select2-results__option[id*="⭐"]:hover,
.select2-container--bootstrap-5 .select2-results__option[id*="⭐"].select2-results__option--highlighted {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%) !important;
    color: white !important;
}

/* Styling for section dividers */
.select2-container--bootstrap-5 .select2-results__option[id*="━━━━━━"] {
    background: var(--bg-tertiary) !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    cursor: default !important;
    border-top: 2px solid var(--border-color) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.select2-container--bootstrap-5 .select2-results__option[id*="━━━━━━"]:hover {
    background: var(--bg-tertiary) !important;
    color: var(--text-muted) !important;
    transform: none !important;
}

.select2-container--bootstrap-5 .select2-results__option[id*="├──"] {
    border-left: 2px solid var(--border-color) !important;
    background: rgba(102, 126, 234, 0.03) !important;
}

.select2-container--bootstrap-5 .select2-results__option[id*="└──"] {
    border-left: 2px solid var(--border-color) !important;
    background: rgba(102, 126, 234, 0.03) !important;
    border-bottom: 2px solid var(--border-light) !important;
}

/* Loading state */
.select2-container--bootstrap-5 .select2-results__message {
    padding: 20px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
    font-style: italic !important;
}

/* Clear button styling */
.select2-container--bootstrap-5 .select2-selection__clear {
    color: var(--text-muted) !important;
    font-size: 1.2rem !important;
    padding: 0 8px !important;
    margin-right: 8px !important;
    transition: color 0.2s ease !important;
}

.select2-container--bootstrap-5 .select2-selection__clear:hover {
    color: var(--danger-color, #dc3545) !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .select2-container--bootstrap-5 .field-of-study-dropdown + .select2-container .select2-selection--single {
        height: 44px !important;
        padding: 6px 12px !important;
        font-size: 0.9rem !important;
    }
    
    .select2-container--bootstrap-5 .select2-results__option {
        padding: 10px 12px !important;
        font-size: 0.9rem !important;
    }
    
    .select2-container--bootstrap-5 .select2-dropdown {
        max-height: 60vh !important;
    }
    
    .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
        padding: 10px 12px 10px 36px !important;
        font-size: 0.9rem !important;
    }
}

/* Keyboard shortcut hint styling */
.field-of-study-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

.field-of-study-hint .kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.75rem;
    font-family: monospace;
    font-weight: 600;
}

/* Styling for context disambiguation in field names */
.select2-container--bootstrap-5 .select2-results__option {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Style the context part (text in parentheses) to be more subtle */
.select2-container--bootstrap-5 .select2-results__option[title*="("] {
    position: relative;
}

/* Custom styling for items with context - make context text lighter */
.select2-container--bootstrap-5 .select2-results__option:not([id*="━━━━━━"]) {
    font-family: 'Inter', sans-serif;
}

/* Enhanced tooltip functionality for long field names */
.select2-container--bootstrap-5 .select2-results__option[title] {
    cursor: help !important;
    position: relative;
}

/* Ensure text truncation works properly */
.select2-container--bootstrap-5 .select2-results__option {
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Ensure tooltips work properly on hover */
.select2-container--bootstrap-5 .select2-results__option[title]:hover {
    overflow: visible !important;
    z-index: 1001 !important;
}

/* Ensure long text in selected item also gets truncated with tooltip */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered[title] {
    max-width: calc(100% - 20px) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    cursor: help !important;
}

/* Enhanced tooltip styling for better readability */
.select2-container--bootstrap-5 .select2-results__option[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 10px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1002;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

/* Custom field search styling */
.field-search-container {
    position: relative;
}

/* Ensure no emoji rendering in search input */
.field-search-input::placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    color: #6c757d !important;
}

.field-search-input::-webkit-input-placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.field-search-input::-moz-placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.field-search-input:-ms-input-placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.field-search-input {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px 12px 40px;
    background-color: white !important;
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%236c757d" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: 12px center !important;
    background-size: 16px 16px !important;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-variant-emoji: text !important;
}

.field-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    outline: none;
    background-color: white !important;
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23667eea" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') !important;
    background-size: 16px 16px !important;
}

.field-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.field-dropdown-section {
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-align: center;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.field-dropdown-divider {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    text-align: center;
    padding: 4px 16px;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.field-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.field-dropdown-item:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateX(2px);
}

.field-dropdown-item[data-field-name*="Computer Science"],
.field-dropdown-item[data-field-name*="Psychology"],
.field-dropdown-item[data-field-name*="Biology"] {
    font-weight: 500;
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    color: #c2410c;
    border-left: 3px solid #ea580c;
}

.field-dropdown-item[data-field-name*="Computer Science"]:hover,
.field-dropdown-item[data-field-name*="Psychology"]:hover,
.field-dropdown-item[data-field-name*="Biology"]:hover {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
}

.field-dropdown-no-results {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.field-dropdown-more {
    padding: 8px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
    background: var(--bg-light);
}

.select2-container--bootstrap-5 .examples-field-selector + .select2-container .select2-selection--multiple {
    min-height: 120px !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 8px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    transition: all 0.2s ease !important;
}

/* Enhanced search box styling for examples dropdown */
.examples-dropdown .select2-search--dropdown {
    padding: 12px !important;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border-bottom: 2px solid var(--primary-color) !important;
}

.examples-dropdown .select2-search--dropdown .select2-search__field {
    width: 100% !important;
    padding: 12px 16px 12px 40px !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 8px !important;
    font-size: 0.95rem !important;
    background-color: white !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%236c757d" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: 12px center !important;
    transition: all 0.2s ease !important;
}

.examples-dropdown .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
    outline: none !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23667eea" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') !important;
}

.examples-dropdown .select2-search--dropdown .select2-search__field::placeholder {
    color: var(--text-muted) !important;
    font-style: italic !important;
}

/* Examples dropdown results styling */
.examples-dropdown .select2-results__options {
    max-height: 300px !important;
    padding: 0 !important;
}

.examples-dropdown .select2-results__option {
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    border-bottom: 1px solid var(--border-light) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.examples-dropdown .select2-results__option:last-child {
    border-bottom: none !important;
}

.examples-dropdown .select2-results__option--highlighted {
    background: var(--primary-gradient) !important;
    color: white !important;
    transform: translateX(2px) !important;
}

/* Special styling for popular fields in examples dropdown */
.examples-dropdown .select2-results__option[id*="⭐"] {
    font-weight: 500 !important;
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%) !important;
    color: #c2410c !important;
    border-left: 3px solid #ea580c !important;
}

.examples-dropdown .select2-results__option[id*="⭐"]:hover,
.examples-dropdown .select2-results__option[id*="⭐"].select2-results__option--highlighted {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%) !important;
    color: white !important;
}

/* Section headers in examples dropdown */
.examples-dropdown .select2-results__option[id*="🌟"],
.examples-dropdown .select2-results__option[id*="📚"] {
    font-weight: 600 !important;
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    text-align: center !important;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    cursor: default !important;
    border-top: 2px solid var(--border-color) !important;
    border-bottom: 2px solid var(--border-color) !important;
}

.examples-dropdown .select2-results__option[id*="━━━━━━"] {
    background: var(--bg-tertiary) !important;
    color: var(--text-muted) !important;
    text-align: center !important;
    padding: 4px 16px !important;
    font-size: 0.75rem !important;
    cursor: default !important;
    border: 1px solid var(--border-color) !important;
}

.select2-container--bootstrap-5 .examples-field-selector + .select2-container.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
}

.select2-container--bootstrap-5 .examples-field-selector + .select2-container .select2-selection__choice {
    background: var(--primary-gradient) !important;
    border: none !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    margin: 2px !important;
}

.select2-container--bootstrap-5 .examples-field-selector + .select2-container .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1rem !important;
    margin-right: 4px !important;
}

.select2-container--bootstrap-5 .examples-field-selector + .select2-container .select2-selection__choice__remove:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .select2-container--bootstrap-5 .field-of-study-dropdown + .select2-container .select2-selection--single {
        background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%) !important;
        color: var(--text-primary) !important;
    }
    
    .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
        background-color: var(--bg-primary) !important;
        background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23a0aec0" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') !important;
        color: var(--text-primary) !important;
    }
    
    .select2-container--bootstrap-5 .select2-results__option[id*="📚"] {
        background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%) !important;
        color: var(--text-primary) !important;
    }
    
    /* Dark mode tooltip styling */
    .select2-container--bootstrap-5 .select2-results__option[title]:hover::after {
        background: rgba(255, 255, 255, 0.95) !important;
        color: var(--text-primary) !important;
        border: 1px solid var(--border-color) !important;
    }

    /* Dark mode custom field search */
    .field-search-input {
        background-color: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
        background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23a0aec0" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') !important;
    }

    .field-search-input:focus {
        background-color: var(--bg-primary) !important;
        background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23667eea" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>') !important;
    }

    .field-search-dropdown {
        background: var(--bg-primary) !important;
        border-color: var(--border-color) !important;
    }

    .field-dropdown-section,
    .field-dropdown-divider {
        background: var(--bg-tertiary) !important;
        border-color: var(--border-color) !important;
    }

    .field-dropdown-item {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
        border-bottom-color: var(--border-color) !important;
    }

    .field-dropdown-more {
        background: var(--bg-secondary) !important;
    }
}