/* ========================================
   DARK THEME OVERRIDES
   Apply dark theme styling when body has 'dark-theme' class
   ======================================== */

body.dark-theme {
    /* Override color variables for dark theme */
    --color-primary: #5dade2;
    --color-primary-dark: #3498db;
    --color-primary-light: #85c1e9;

    --color-secondary: #ecf0f1;
    --color-secondary-dark: #bdc3c7;
    --color-secondary-light: #ffffff;

    --color-success: #2ecc71;
    --color-error: #e74c3c;
    --color-warning: #f39c12;

    /* Card Type Colors - Brighter for dark theme */
    --type-unit: #5dade2;
    --type-command: #ff6b6b;
    --type-event: #ffd93d;
    --type-base: #6bcf7f;
    --type-unknown: #b8c5d0;

    /* Dark backgrounds */
    --bg-body: #1a1a1a;
    --bg-container: #2c2c2c;
    --bg-section: #333333;
    --bg-filter: #3a3a3a;
    --modal-bg: #2c2c2c;
    --card-bg: #2c2c2c;
    --bg-secondary: #333333;

    /* Text colors */
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-tertiary: #95a5a6;
    --text-muted: #95a5a6;

    /* Border colors */
    --border-color: #444444;
    --border-color-light: #555555;
    --border-primary: #444444;

    /* Card colors - darker versions */
    --color-gray-50: #2c2c2c;
    --color-gray-100: #333333;
    --color-gray-200: #3a3a3a;
    --color-gray-300: #444444;
    --color-gray-400: #555555;
    --color-gray-500: #666666;
    --color-gray-600: #bdc3c7;
    --color-gray-700: #ecf0f1;
    --color-gray-800: #ffffff;

    /* Shadows for dark theme */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);

    /* Page header */
    --page-header-bg: linear-gradient(135deg, #2c3e50, #34495e);
    --page-header-color: var(--color-white);

    /* Filter section */
    --filter-bg: #3a3a3a;
    --filter-border: #444444;

    /* Button colors */
    --btn-primary-bg: #3498db;
    --btn-primary-bg-hover: #5dade2;
    --btn-secondary-bg: #555555;
    --btn-secondary-bg-hover: #666666;
}

/* Base styling overrides */
body.dark-theme {
    background-color: var(--bg-body);
    color: var(--text-primary);
}

/* Container elements */
body.dark-theme .container,
body.dark-theme .card-browser,
body.dark-theme .collection-container,
body.dark-theme .deck-builder-container {
    background-color: var(--bg-container);
    color: var(--text-primary);
}

/* Headers */
body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6 {
    color: var(--text-primary);
}

/* Page headers */
body.dark-theme .page-header {
    background: var(--page-header-bg);
    color: var(--page-header-color);
}

/* Filter sections */
body.dark-theme .filter-section,
body.dark-theme .filters {
    background: var(--filter-bg);
    border-color: var(--filter-border);
}

body.dark-theme .filter-group label,
body.dark-theme .search-group label {
    color: var(--text-primary);
}

body.dark-theme select,
body.dark-theme input[type="text"],
body.dark-theme input[type="search"],
body.dark-theme input[type="number"],
body.dark-theme textarea {
    background-color: #3a3a3a;
    border-color: #555555;
    color: var(--text-primary);
}

body.dark-theme select:focus,
body.dark-theme input:focus,
body.dark-theme textarea:focus {
    border-color: var(--color-primary);
    background-color: #404040;
}

/* Card items */
body.dark-theme .card-item {
    background: #333333;
    border-color: #444444;
}

body.dark-theme .card-item:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    border-color: var(--color-primary);
}

body.dark-theme .card-details {
    color: var(--text-primary);
}

body.dark-theme .card-name {
    color: var(--text-primary);
}

body.dark-theme .card-number,
body.dark-theme .stat-label,
body.dark-theme .price-label {
    color: var(--text-secondary);
}

/* Tables */
body.dark-theme .text-view-table {
    background: var(--bg-container);
}

body.dark-theme .text-view-table th {
    background: #3a3a3a;
    color: var(--text-primary);
    border-color: #444444;
}

body.dark-theme .text-view-table td {
    border-color: #444444;
    color: var(--text-primary);
}

body.dark-theme .text-view-table tr:hover {
    background: #3a3a3a;
}

body.dark-theme .text-view-table .card-number,
body.dark-theme .text-view-table .card-name,
body.dark-theme .text-view-table .set-id,
body.dark-theme .text-view-table .card-type,
body.dark-theme .text-view-table .card-level,
body.dark-theme .text-view-table .card-cost,
body.dark-theme .text-view-table .card-ap,
body.dark-theme .text-view-table .card-hp {
    color: var(--text-primary);
}

/* Fix White color badge visibility in dark mode */
body.dark-theme .text-view-table .card-color.White {
    background-color: #d0d0d0;
    color: #1a1a1a;
}

/* Fix Yellow color badge visibility in dark mode */
body.dark-theme .text-view-table .card-color.Yellow {
    background-color: #f1c40f;
    color: #1a1a1a;
}

/* Price link styling in dark mode */
body.dark-theme .text-view-table .price-link {
    color: var(--text-primary);
}

body.dark-theme .text-view-table .price-link:hover {
    color: var(--color-primary);
}

/* Fix card-type badge visibility in dark mode */
body.dark-theme .card-type {
    background-color: #4a4a4a;
    color: #e0e0e0;
}

/* List View - Card Browser */
body.dark-theme .card-grid.list-view {
    background: transparent;
}

body.dark-theme .card-grid.list-view .card-item {
    background: var(--bg-container);
    border-color: #444444;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

body.dark-theme .card-grid.list-view .card-item:hover {
    background: #2c2c2c;
}

body.dark-theme .card-grid.text-view {
    background: var(--bg-container);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .alt-art-row {
    background: #2c2c2c;
}

body.dark-theme .alt-art-row:hover {
    background: #333333;
}

/* Buttons */
body.dark-theme button,
body.dark-theme .btn {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
    border-color: #555555;
}

body.dark-theme button:hover,
body.dark-theme .btn:hover {
    background: var(--btn-secondary-bg-hover);
}

body.dark-theme .btn-primary,
body.dark-theme button.primary {
    background: var(--btn-primary-bg);
    color: white;
}

body.dark-theme .btn-primary:hover,
body.dark-theme button.primary:hover {
    background: var(--btn-primary-bg-hover);
}

body.dark-theme button:disabled {
    background: #2c2c2c;
    color: #666666;
    border-color: #444444;
}

/* Modals */
body.dark-theme #cardModal .modal-content {
    background: var(--bg-container);
    border-color: #444444;
}

body.dark-theme #deckModal .modal-content,
body.dark-theme #deckModal .deck-modal-content,
body.dark-theme .deck-modal-content {
    background: var(--bg-container);
    border-color: #444444;
}

body.dark-theme #creatorModal .modal-content,
body.dark-theme .creator-modal {
    background: var(--bg-container);
    border-color: #444444;
}

body.dark-theme #msaInstructionsModal .modal-content,
body.dark-theme #msaInstructionsModal .msa-modal-content,
body.dark-theme #gdSimInstructionsModal .modal-content,
body.dark-theme #gdSimInstructionsModal .msa-modal-content,
body.dark-theme .msa-modal-content {
    background: var(--bg-container);
    border-color: #444444;
}

body.dark-theme .msa-instructions {
    background: var(--bg-section);
}

body.dark-theme .msa-instructions h3,
body.dark-theme .msa-steps li strong {
    color: var(--color-primary);
}

body.dark-theme .msa-steps li p {
    color: var(--text-primary);
}

body.dark-theme #cardModal .modal-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-bottom-color: var(--border-primary);
}

body.dark-theme #cardModal .modal-header h2,
body.dark-theme #cardModal .modal-header h3 {
    color: white;
}

body.dark-theme #cardModal .modal-footer {
    border-top-color: var(--border-primary);
}

body.dark-theme #cardModal .close,
body.dark-theme #cardModal .close-modal {
    color: var(--text-primary);
}

body.dark-theme #cardModal .close:hover,
body.dark-theme #cardModal .close-modal:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .cardModal-link-card {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .cardModal-link-card:hover {
    background: #3a3a3a;
    border-color: var(--border-color);
}

body.dark-theme .cardModal-link-card.expanded {
    background: #3a3a3a;
    border-color: var(--border-color);
}

body.dark-theme .cardModal-link-card-info {
    background: transparent;
}

body.dark-theme .cardModal-link-card-name,
body.dark-theme .cardModal-link-card-number {
    color: var(--text-primary);
}

body.dark-theme .cardModal-link-card-drawer {
    background: var(--bg-container);
    border-top-color: var(--border-color);
}

body.dark-theme .cardModal-link-card-description {
    color: var(--text-secondary);
}

body.dark-theme .cardModal-header {
    background: rgba(44, 44, 44, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-theme .cardModal-card-name {
    color: var(--text-primary);
}

body.dark-theme .cardModal-pills-container .cardModal-pill {
    background: var(--bg-section);
    color: var(--text-primary);
}

body.dark-theme .cardModal-price-container {
    border-color: var(--border-color);
}

body.dark-theme .cardModal-price-sub {
    color: var(--text-secondary);
}

body.dark-theme .cardModal-stat-item {
    background: var(--bg-section);
}

body.dark-theme .cardModal-stat-label {
    color: var(--text-secondary);
}

body.dark-theme .cardModal-stat-value {
    color: var(--text-primary);
}

body.dark-theme .cardModal-section-content {
    color: var(--text-primary);
}

body.dark-theme .cardModal-section-title {
    color: var(--text-primary);
    border-left-color: var(--color-primary);
}

body.dark-theme #cardModal .modal-stats,
body.dark-theme #cardModal .modal-card-info {
    background: transparent;
}

body.dark-theme #cardModal .modal-label {
    color: var(--text-secondary);
}

body.dark-theme #cardModal .modal-value {
    color: var(--text-primary);
}

/* Modal scrollbar */
body.dark-theme #cardModal .modal-body::-webkit-scrollbar-track {
    background: #2c2c2c;
}

body.dark-theme #cardModal .modal-body::-webkit-scrollbar-thumb {
    background: #555555;
}

body.dark-theme #cardModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

/* Modal image placeholders */
body.dark-theme #cardModal .modal-image-placeholder,
body.dark-theme #cardModal .pilot-image-placeholder {
    background: var(--bg-section);
    color: var(--text-secondary);
}

body.dark-theme #cardModal .pilot-image-container {
    background: var(--bg-section);
}

body.dark-theme #cardModal .pilot-image-container img {
    background: var(--bg-section);
}

/* Modal carousels */
body.dark-theme #cardModal .alt-art-carousel {
    background: var(--bg-section);
    border-color: var(--border-primary);
}

body.dark-theme #cardModal .alt-art-caption {
    color: var(--text-primary);
}

body.dark-theme #cardModal .pilot-carousel {
    background: var(--bg-section);
    border-color: var(--border-primary);
}

body.dark-theme #cardModal .pilot-carousel-title {
    color: var(--text-primary);
}

body.dark-theme #cardModal .pilot-caption {
    color: var(--text-primary);
}

/* Modal description and sections */
body.dark-theme #cardModal .modal-card-description {
    background: var(--bg-section) !important;
    border-left-color: var(--color-primary);
}

body.dark-theme #cardModal .modal-card-description p {
    color: var(--text-primary);
}

body.dark-theme #cardModal .modal-linking-section,
body.dark-theme #cardModal .modal-source-section,
body.dark-theme #modalLinkableSection,
body.dark-theme #modalCompatibleSection,
body.dark-theme #modalLinkingSection,
body.dark-theme #modalTokensSection,
body.dark-theme #modalUnitsSection,
body.dark-theme #modalSourceSection {
    background: var(--bg-section) !important;
    border-left-color: var(--color-success);
}

body.dark-theme #cardModal .modal-linking-section .modal-label,
body.dark-theme #cardModal .modal-source-section .modal-label {
    color: var(--text-primary);
}

body.dark-theme #cardModal .modal-linking-section p,
body.dark-theme #cardModal .modal-source-section p {
    color: var(--text-primary);
}

/* Modal card header */
body.dark-theme #cardModal .modal-card-header h2 {
    color: var(--text-primary);
}

body.dark-theme #cardModal .modal-card-number {
    color: var(--color-primary);
}

/* TCGPlayer Edit Button */
body.dark-theme .tcg-edit-btn {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

body.dark-theme .tcg-edit-btn:hover {
    background: var(--color-primary);
    color: white;
}

/* Navigation */
body.dark-theme header {
    background: #2c2c2c;
    border-bottom: 1px solid #444444;
}

body.dark-theme nav {
    background: transparent;
}

body.dark-theme .nav-link {
    color: white;
}

body.dark-theme .nav-link:hover,
body.dark-theme .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Dropdown menus in dark theme */
body.dark-theme .dropdown-menu {
    background: #333333;
    border-color: #555555;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

body.dark-theme .dropdown-menu a {
    color: var(--text-primary);
}

body.dark-theme .dropdown-menu a:hover {
    background: #3a3a3a;
}

/* Mobile navigation in dark theme */
body.dark-theme .mobile-navigation {
    background: #2c2c2c;
}

body.dark-theme .mobile-nav-link {
    color: var(--text-primary);
    border-bottom-color: #444444;
}

body.dark-theme .mobile-nav-link:hover {
    background: #3a3a3a;
}

body.dark-theme .mobile-dropdown-toggle {
    color: var(--text-primary);
}

body.dark-theme .mobile-dropdown-toggle:hover {
    background: #3a3a3a;
}

body.dark-theme .mobile-dropdown-menu {
    background: #3a3a3a;
}

body.dark-theme .mobile-dropdown-menu a {
    color: var(--text-secondary);
}

body.dark-theme .mobile-dropdown-menu a:hover {
    background: #444444;
    color: var(--text-primary);
}

body.dark-theme .mobile-nav-close {
    color: var(--text-primary);
}

/* User menu dropdown */
body.dark-theme #userDropdown {
    background: #333333;
    border-color: #555555;
}

body.dark-theme #userDropdown a {
    color: var(--text-primary);
}

body.dark-theme #userDropdown a:hover {
    background: #3a3a3a;
}

/* Badges and labels */
body.dark-theme .badge {
    background: #3a3a3a;
    border-color: #555555;
}

/* Keep rarity and color badges with their specific colors in dark theme */
/* The rounded corners need the colored background to avoid dark corners showing through */

/* Stats and progress */
body.dark-theme .stat-card {
    background: #333333;
    border-color: #444444;
}

body.dark-theme .stat-value {
    color: var(--text-primary);
}

body.dark-theme .progress-bar {
    background: #2c2c2c;
}

body.dark-theme .progress-fill {
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
}

/* Collection specific */
body.dark-theme .set-card {
    background: #333333;
    border-color: #444444;
}

body.dark-theme .set-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-theme .set-name {
    color: var(--text-primary);
}

body.dark-theme .set-stats {
    color: var(--text-secondary);
}

body.dark-theme .progress-label {
    color: var(--text-secondary);
}

body.dark-theme .progress-percentage {
    color: var(--text-primary);
}

body.dark-theme .progress-bar {
    background: #2c2c2c;
}

/* All Cards tile - special visibility fixes */
body.dark-theme .all-cards-card {
    background: linear-gradient(135deg, rgba(93, 173, 226, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-color: rgba(93, 173, 226, 0.4);
}

body.dark-theme .all-cards-card:hover {
    border-color: rgba(93, 173, 226, 0.6);
    box-shadow: 0 6px 12px rgba(93, 173, 226, 0.3);
}

body.dark-theme .all-cards-card .set-name {
    color: var(--text-primary);
    font-weight: 700;
}

body.dark-theme .all-cards-card .set-prefix {
    background: rgba(93, 173, 226, 0.3);
    color: var(--text-primary);
    border-color: rgba(93, 173, 226, 0.5);
}

body.dark-theme .all-cards-card .progress-label,
body.dark-theme .all-cards-card .progress-percentage {
    color: var(--text-primary);
}

body.dark-theme .all-cards-card .set-stats {
    color: var(--text-secondary);
}

/* Set Detail View */
body.dark-theme .set-detail {
    background: var(--bg-container);
}

body.dark-theme .set-detail-header {
    border-bottom-color: var(--border-color);
}

body.dark-theme .set-detail-title {
    color: var(--text-primary);
}

body.dark-theme .back-button {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
}

body.dark-theme .back-button:hover {
    background: var(--btn-secondary-bg-hover);
}

/* Set Analytics */
body.dark-theme .set-analytics-container {
    background: var(--bg-container);
}

body.dark-theme .set-analytics-container h3 {
    color: var(--text-primary);
}

body.dark-theme .set-stats-grid .set-stat-card {
    background: var(--bg-section);
    border-left-color: var(--color-primary);
}

body.dark-theme .set-value-card {
    border-left-color: var(--color-success);
}

body.dark-theme .set-stat-card .stat-number {
    color: var(--text-primary);
}

body.dark-theme .set-stat-card .stat-label {
    color: var(--text-primary);
}

body.dark-theme .set-stat-card .stat-subtitle {
    color: var(--text-secondary);
}

body.dark-theme .set-stat-card .progress-bar {
    background: #2c2c2c;
}

body.dark-theme .set-stat-card .progress-text {
    color: var(--text-primary);
}

/* Rarity Breakdown */
body.dark-theme .rarity-breakdown h4 {
    color: var(--text-primary);
}

body.dark-theme .rarity-stat {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .rarity-label {
    color: var(--text-primary);
}

body.dark-theme .rarity-progress {
    color: var(--text-secondary);
}

body.dark-theme .mini-progress-bar {
    background: #2c2c2c;
}

/* Collection Controls */
body.dark-theme .collection-controls {
    color: var(--text-primary);
}

body.dark-theme .show-alt-art {
    color: var(--text-primary);
}

/* Deck builder specific */
body.dark-theme .deck-card {
    background: #333333;
    border-color: #444444;
}

body.dark-theme .deck-stats-panel {
    background: #333333;
    border-color: #444444;
}

body.dark-theme .mana-curve-bar {
    background: #2c2c2c;
}

/* Trading lists */
body.dark-theme .trade-card {
    background: #333333;
    border-color: #444444;
}

/* Admin panel */
body.dark-theme .admin-panel {
    background: #333333;
}

body.dark-theme .stat-card-admin {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

/* Footer */
body.dark-theme .site-footer {
    background: #2c2c2c;
    border-top-color: #444444;
    color: var(--text-secondary);
}

body.dark-theme .footer-link {
    color: var(--text-secondary);
}

body.dark-theme .footer-link:hover {
    color: var(--color-primary);
}

body.dark-theme .social-link {
    background: #3a3a3a;
    border-color: #555555;
}

/* Loading states */
body.dark-theme .loading-spinner {
    background: rgba(44, 44, 44, 0.9);
}

body.dark-theme .spinner {
    border-color: #444444;
    border-top-color: var(--color-primary);
}

/* Error states */
body.dark-theme .error-message {
    background: #3a1a1a;
    border-color: var(--color-error);
    color: #ffcccc;
}

body.dark-theme .no-results {
    color: var(--text-secondary);
}

/* Scrollbars (webkit browsers) */
body.dark-theme ::-webkit-scrollbar {
    background: #2c2c2c;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #555555;
    border-color: #2c2c2c;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

/* Image placeholders */
body.dark-theme .image-placeholder {
    background: #3a3a3a !important;
}

body.dark-theme .image-placeholder span {
    color: var(--text-secondary) !important;
}

/* Profile modal specific */
body.dark-theme .profile-section {
    background: #333333;
    border-color: #444444;
}

body.dark-theme .help-text {
    color: var(--text-muted);
}

body.dark-theme .danger-zone {
    background: #3a1a1a;
    border-color: #a04040;
}

/* Theme selection - now uses dropdown instead of toggle */
.theme-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.theme-selection label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

/* Smooth theme transition */
body.theme-transition,
body.theme-transition *,
body.theme-transition *:before,
body.theme-transition *:after {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease !important;
}

/* ========================================
   ADDITIONAL PANEL & ELEMENT FIXES
   ======================================== */

/* All white panels/cards */
body.dark-theme .panel,
body.dark-theme .info-panel,
body.dark-theme .stats-panel,
body.dark-theme .content-panel,
body.dark-theme .sidebar-panel,
body.dark-theme .info-card,
body.dark-theme .stats-card {
    background: var(--bg-container);
    border-color: var(--border-color);
}

/* Results info bar */
body.dark-theme .results-info {
    background: transparent;
    color: var(--text-primary);
}

/* Infinite scroll loader */
body.dark-theme .infinite-scroll-loader p {
    color: var(--text-secondary);
}

body.dark-theme .infinite-scroll-loader .loader-spinner {
    border-color: var(--border-color);
    border-top-color: var(--color-primary);
}

/* View options */
body.dark-theme .view-options label {
    color: var(--text-primary);
}

/* Auth/Login elements */
body.dark-theme .auth-container,
body.dark-theme .login-box {
    background: var(--bg-container);
    border-color: var(--border-color);
}

/* Notification toasts */
body.dark-theme .notification,
body.dark-theme .toast {
    background: #333333;
    border-color: #555555;
    color: var(--text-primary);
}

body.dark-theme .notification.success,
body.dark-theme .toast-success {
    background: var(--color-success, #27ae60) !important;
    border-color: var(--color-success);
    color: white;
}

body.dark-theme .notification.error,
body.dark-theme .toast-error {
    background: var(--color-error, #e74c3c) !important;
    border-color: var(--color-error);
    color: white;
}

body.dark-theme .toast-warning {
    background: var(--color-warning, #f39c12) !important;
    color: white;
}

body.dark-theme .toast-info {
    background: var(--color-primary, #3498db) !important;
    color: white;
}

/* Tabs */
body.dark-theme .tabs,
body.dark-theme .tab-list {
    background: transparent;
    border-bottom-color: #444444;
}

body.dark-theme .tab {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

body.dark-theme .tab:hover {
    background: #3a3a3a;
    color: var(--text-primary);
}

body.dark-theme .tab.active {
    background: var(--bg-container);
    color: var(--color-primary);
    border-color: var(--color-primary);
    border-bottom-color: transparent;
}

/* Form elements in panels */
body.dark-theme .form-group,
body.dark-theme .input-group {
    background: transparent;
}

body.dark-theme .form-label {
    color: var(--text-primary);
}

/* White overlays */
body.dark-theme .overlay,
body.dark-theme .backdrop {
    background: rgba(0, 0, 0, 0.8);
}

/* Pagination */
body.dark-theme .pagination {
    background: transparent;
}

body.dark-theme .pagination button,
body.dark-theme .pagination a {
    background: #333333;
    border-color: #555555;
    color: var(--text-primary);
}

body.dark-theme .pagination button:hover,
body.dark-theme .pagination a:hover {
    background: #3a3a3a;
    border-color: var(--color-primary);
}

body.dark-theme .pagination button.active,
body.dark-theme .pagination a.active {
    background: var(--color-primary);
    color: white;
}

/* Charts and graphs */
body.dark-theme .chart-container,
body.dark-theme .graph-panel {
    background: var(--bg-container);
}

body.dark-theme .chart-legend {
    color: var(--text-primary);
}

/* Info boxes */
body.dark-theme .info-box,
body.dark-theme .alert-box {
    background: #3a3a3a;
    border-color: #555555;
    color: var(--text-primary);
}

body.dark-theme .info-box.info {
    background: #1e3a4d;
    border-color: var(--color-primary);
}

body.dark-theme .info-box.warning {
    background: #4d3a1e;
    border-color: var(--color-warning);
}

/* User profile avatar */
body.dark-theme .profile-avatar,
body.dark-theme .user-avatar {
    border-color: #555555;
}

/* Dividers */
body.dark-theme hr,
body.dark-theme .divider {
    border-color: #444444;
}

/* Code blocks */
body.dark-theme code,
body.dark-theme pre {
    background: #2c2c2c;
    color: #e0e0e0;
    border-color: #444444;
}

/* Tooltips */
body.dark-theme .tooltip {
    background: #333333;
    color: var(--text-primary);
    border-color: #555555;
}

/* Checkbox and radio custom styling */
body.dark-theme input[type="checkbox"],
body.dark-theme input[type="radio"] {
    border-color: #555555;
}

body.dark-theme input[type="checkbox"]:checked,
body.dark-theme input[type="radio"]:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* Select dropdowns */
body.dark-theme select option {
    background: #333333;
    color: var(--text-primary);
}

/* ========================================
   PAGE-SPECIFIC PANEL FIXES
   ======================================== */

/* HOME PAGE - Feature items */
body.dark-theme .feature-item {
    background: var(--bg-container);
    border-color: var(--border-color);
}

body.dark-theme .feature-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

body.dark-theme .feature-item h3 {
    color: var(--text-primary);
}

body.dark-theme .feature-item p {
    color: var(--text-secondary);
}

body.dark-theme .features-overview h2 {
    color: var(--text-primary);
}

body.dark-theme .updates-section {
    background: var(--bg-section);
    border-left-color: var(--color-success);
}

body.dark-theme .updates-section h2 {
    color: var(--text-primary);
}

body.dark-theme .update-card {
    background: var(--bg-container);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .update-content h3 {
    color: var(--text-primary);
}

body.dark-theme .update-content p {
    color: var(--text-secondary);
}

/* ABOUT PAGE - Sections and feature cards */
body.dark-theme .about-section {
    background: var(--bg-container);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-theme .about-section h2,
body.dark-theme .about-section h3 {
    color: var(--text-primary);
}

body.dark-theme .about-content {
    color: var(--text-primary);
}

body.dark-theme .feature-card {
    background: var(--bg-section);
    border-left-color: var(--color-primary);
}

body.dark-theme .feature-card h3 {
    color: var(--text-primary);
}

body.dark-theme .feature-card p {
    color: var(--text-secondary);
}

body.dark-theme .rules-summary {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .page-header {
    background: var(--bg-container);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .page-header h1 {
    color: var(--text-primary);
}

body.dark-theme .page-description {
    color: var(--text-secondary);
}

/* ABOUT PAGE - Disclaimer box fix */
body.dark-theme .disclaimer {
    background: #4d3a1e;
    border-left-color: var(--color-warning);
    color: #f0e6d2;
}

/* COLLECTION PAGE - Overview and stats */
body.dark-theme .collection-overview {
    background: var(--bg-container);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .collection-overview h2 {
    color: var(--text-primary);
}

body.dark-theme .stat-card {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .stat-card:hover {
    border-color: var(--color-primary);
}

/* DECK BUILDER - Info panel and deck panels */
body.dark-theme .deck-info-panel {
    background: var(--bg-container);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .deck-title-section h2 {
    color: var(--text-primary);
}

body.dark-theme .deck-stats {
    background: transparent;
}

body.dark-theme .deck-stat-label {
    color: var(--text-secondary);
}

body.dark-theme .deck-stat-value {
    color: var(--text-primary);
}

body.dark-theme .deck-validation {
    background: var(--bg-section);
    border-color: var(--border-color);
}

/* Analytics toggle button */
body.dark-theme .analytics-toggle-btn {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.5);
    color: #5dade2;
}

body.dark-theme .analytics-toggle-btn:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.7);
}

body.dark-theme .analytics-toggle-btn.hidden-state {
    background: rgba(149, 165, 166, 0.2);
    border-color: rgba(149, 165, 166, 0.5);
    color: #95a5a6;
}

body.dark-theme .analytics-toggle-btn.hidden-state:hover {
    background: rgba(149, 165, 166, 0.3);
    border-color: rgba(149, 165, 166, 0.7);
}

body.dark-theme .deck-list-container {
    background: var(--bg-container);
}

body.dark-theme .deck-card-item {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .deck-card-item:hover {
    background: #3a3a3a;
    border-color: var(--color-primary);
}

body.dark-theme .deck-card-name {
    color: var(--text-primary);
}

body.dark-theme .deck-card-number {
    color: var(--text-secondary);
}

/* DECK BUILDER - Analytics Section */
body.dark-theme .deck-analytics {
    background: var(--bg-section);
    border-top-color: var(--border-color);
}

body.dark-theme .deck-analytics h4 {
    color: var(--text-primary);
}

body.dark-theme .analytics-chart {
    background: var(--bg-container);
    border-color: var(--border-color);
}

body.dark-theme .analytics-chart h5 {
    color: var(--text-secondary);
}

body.dark-theme .chart-bar {
    background: var(--color-primary);
}

body.dark-theme .chart-bar:hover {
    background: var(--color-primary-dark);
}

body.dark-theme .chart-bar-label {
    color: var(--text-secondary);
}

/* ANNOUNCEMENTS (Home page) */
body.dark-theme #announcementsContainer .announcement-card {
    background: var(--bg-container);
    border-color: var(--border-color);
}

body.dark-theme .announcement-title {
    color: var(--text-primary);
}

body.dark-theme .announcement-content {
    color: var(--text-secondary);
}

body.dark-theme .announcement-date {
    color: var(--text-muted);
}

/* ========================================
   ADMIN DASHBOARD
   ======================================== */

/* Admin sections */
body.dark-theme .admin-section {
    background: var(--bg-container);
    border-left-color: var(--color-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .section-header h2 {
    color: var(--text-primary);
}

body.dark-theme .section-description {
    color: var(--text-secondary);
}

/* Admin buttons */
body.dark-theme .admin-btn {
    background: var(--bg-section);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

body.dark-theme .admin-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Admin forms */
body.dark-theme .announcement-form {
    background: var(--bg-section);
    border-color: var(--border-primary);
}

body.dark-theme .announcement-form h3 {
    color: var(--text-primary);
}

body.dark-theme .form-group label {
    color: var(--text-primary);
}

body.dark-theme .form-input,
body.dark-theme .form-textarea {
    background: var(--bg-section);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

body.dark-theme .form-input:focus,
body.dark-theme .form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(93, 173, 226, 0.2);
}

/* Users table */
body.dark-theme .users-table-wrapper {
    background: var(--bg-container);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .users-table {
    color: var(--text-primary);
}

body.dark-theme .users-table thead {
    background: var(--bg-section);
    color: var(--text-primary);
}

body.dark-theme .users-table thead th {
    color: var(--text-primary);
    border-bottom-color: var(--border-primary);
}

body.dark-theme .users-table tbody tr {
    border-bottom-color: var(--border-primary);
}

body.dark-theme .users-table tbody tr:hover {
    background: var(--bg-section);
}

body.dark-theme .users-table tbody td {
    color: var(--text-primary);
}

/* Announcements list */
body.dark-theme .announcements-list-wrapper {
    background: var(--bg-container);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .announcements-table {
    color: var(--text-primary);
}

body.dark-theme .announcements-table thead {
    background: var(--bg-section);
    border-bottom-color: var(--border-primary);
}

body.dark-theme .announcements-table thead th {
    color: var(--text-primary);
}

body.dark-theme .announcements-table tbody tr {
    border-bottom-color: var(--border-primary);
}

body.dark-theme .announcements-table tbody tr:hover {
    background: var(--bg-section);
}

body.dark-theme .announcements-table tbody td {
    color: var(--text-primary);
}

/* Sets management */
body.dark-theme .sets-list-wrapper {
    background: var(--bg-container);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .sets-table {
    color: var(--text-primary);
}

body.dark-theme .sets-table thead {
    background: var(--bg-section);
    border-bottom-color: var(--border-primary);
}

body.dark-theme .sets-table thead th {
    color: var(--text-primary);
}

body.dark-theme .sets-table tbody tr {
    border-bottom-color: var(--border-primary);
}

body.dark-theme .sets-table tbody tr:hover {
    background: var(--bg-section);
}

body.dark-theme .sets-table tbody td {
    color: var(--text-primary);
}

body.dark-theme .set-form {
    background: var(--bg-container);
    border-color: var(--border-primary);
}

/* Products management */
body.dark-theme .products-list-wrapper {
    background: var(--bg-container);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .products-table {
    color: var(--text-primary);
}

body.dark-theme .products-table thead {
    background: var(--bg-section);
    border-bottom-color: var(--border-primary);
}

body.dark-theme .products-table thead th {
    color: var(--text-primary);
}

body.dark-theme .products-table tbody tr {
    border-bottom-color: var(--border-primary);
}

body.dark-theme .products-table tbody tr:hover {
    background: var(--bg-section);
}

body.dark-theme .products-table tbody td {
    color: var(--text-primary);
}

body.dark-theme .product-form {
    background: var(--bg-container);
    border-color: var(--border-primary);
}

body.dark-theme .product-cards-table-wrapper {
    background: var(--bg-container);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .product-cards-table {
    color: var(--text-primary);
}

body.dark-theme .product-cards-table thead {
    background: var(--bg-section);
    border-bottom-color: var(--border-primary);
}

body.dark-theme .product-cards-table thead th {
    color: var(--text-primary);
}

body.dark-theme .product-cards-table tbody tr {
    border-bottom-color: var(--border-primary);
}

body.dark-theme .product-cards-table tbody tr:hover {
    background: var(--bg-section);
}

body.dark-theme .product-cards-table tbody td {
    color: var(--text-primary);
}

/* Scraper modal */
body.dark-theme .scraper-status {
    background: var(--bg-section);
    border-color: var(--border-primary);
}

body.dark-theme .scraper-output {
    background: var(--bg-section);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

body.dark-theme .users-search .form-input {
    background: var(--bg-section);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

/* ========================================
   DECK BUILDER PANELS
   ======================================== */

/* Card browser panel */
body.dark-theme .card-browser-panel {
    background: var(--bg-container);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .current-deck-panel {
    background: var(--bg-container);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .deck-panel-header {
    border-bottom-color: var(--border-color);
}

body.dark-theme .deck-panel-header h3 {
    color: var(--text-primary);
}

body.dark-theme .clear-deck-btn,
body.dark-theme .validate-btn {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .mobile-header-save-btn {
    background: var(--bg-section);
    border-color: var(--color-primary, #3498db);
    color: var(--color-primary, #3498db);
}

body.dark-theme .mobile-header-save-btn:active {
    background: var(--color-primary, #3498db);
    color: white;
}

body.dark-theme .deck-list-container {
    background: transparent;
}

body.dark-theme .deck-inline-fields {
    background: transparent;
    border: none;
}

body.dark-theme .deck-card-item {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .deck-card-item:hover {
    background: #3a3a3a;
    border-color: var(--color-primary);
}

body.dark-theme .deck-card-quantity {
    color: var(--color-primary);
}

body.dark-theme .deck-card-name {
    color: var(--text-primary);
}

body.dark-theme .deck-card-number {
    color: var(--text-secondary);
}

body.dark-theme .card-item-deck {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .card-item-deck:hover {
    background: #3a3a3a;
    border-color: var(--color-primary);
}

body.dark-theme .view-btn {
    background: var(--bg-section);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .view-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* ========================================
   MY DECKS & PUBLIC DECKS PAGES
   ======================================== */

/* Filter section */
body.dark-theme .deck-filters {
    background: var(--bg-container);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .deck-filters label {
    color: var(--text-primary);
}

/* Deck card actions background */
body.dark-theme .deck-actions {
    border-top-color: var(--border-color);
}

body.dark-theme .deck-action-btn {
    background: var(--bg-container);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .deck-action-btn.primary {
    background: var(--color-primary);
    color: white;
}

body.dark-theme .deck-action-btn.primary:hover {
    background: var(--color-primary-dark);
}

body.dark-theme .deck-action-btn:hover {
    background: #3a3a3a;
}

/* ========================================
   DECK CREATORS PAGE
   ======================================== */

body.dark-theme .creators-results-section {
    background: var(--bg-container);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-theme .creator-card {
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .creator-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-theme .creator-name {
    color: var(--text-primary);
}

body.dark-theme .creator-stats {
    border-top-color: var(--border-color);
    border-bottom-color: var(--border-color);
}

body.dark-theme .stat-label {
    color: var(--text-secondary);
}

body.dark-theme .stat-value {
    color: var(--color-primary);
}

body.dark-theme .view-profile-btn {
    background: var(--color-primary);
}

body.dark-theme .view-profile-btn:hover {
    background: var(--color-primary-dark);
}

/* ========================================
   DECK MODALS
   ======================================== */

/* Deck Statistics Row */
body.dark-theme .deck-stat-item {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .deck-stat-item .stat-icon {
    color: var(--text-secondary);
}

body.dark-theme .deck-stat-item .stat-value {
    color: var(--text-primary);
}

body.dark-theme .deck-stat-item .stat-label {
    color: var(--text-secondary);
}

body.dark-theme .deck-info-section {
    background: transparent;
}

body.dark-theme .deck-metadata {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .deck-metadata .creator-details {
    color: var(--text-primary);
}

body.dark-theme .deck-metadata .creator-name {
    color: var(--text-primary);
}

body.dark-theme .deck-metadata .creation-date {
    color: var(--text-secondary);
}

body.dark-theme .deck-description {
    color: var(--text-primary);
}

body.dark-theme .deck-cards-section {
    background: transparent;
}

body.dark-theme .cards-tabs {
    border-bottom-color: var(--border-color);
}

body.dark-theme .tab-btn {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

body.dark-theme .tab-btn:hover {
    background: #3a3a3a;
    color: var(--text-primary);
}

body.dark-theme .tab-btn.active {
    background: var(--bg-container);
    color: var(--color-primary);
    border-bottom-color: transparent;
}

body.dark-theme .cards-list {
    background: transparent;
}

/* ========================================
   SEARCH & FILTER SECTIONS
   ======================================== */

body.dark-theme .search-section {
    background: var(--bg-container);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Inline Search Wrapper */
body.dark-theme .search-wrapper {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .search-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

body.dark-theme .search-input-inline {
    color: var(--text-primary);
}

body.dark-theme .search-input-inline::placeholder {
    color: var(--text-muted);
}

body.dark-theme .filter-toggle-btn {
    background: #666666;
}

body.dark-theme .filter-toggle-btn:hover {
    background: #777777;
}

body.dark-theme .clear-btn {
    background: #555555;
}

body.dark-theme .clear-btn:hover {
    background: #666666;
}

body.dark-theme .filter-tabs {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .filter-tab {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

body.dark-theme .filter-tab:hover {
    background: #3a3a3a;
    color: var(--text-primary);
}

body.dark-theme .filter-tab.active {
    background: var(--color-primary);
    color: white;
    border-bottom-color: transparent;
}

/* ========================================
   COLLECTION TEXT VIEW HOVER FIX
   ======================================== */

/* Fix hover state for collection text view rows */
body.dark-theme .collection-text-view .text-view-table tbody tr:hover {
    background-color: #3a3a3a;
}

/* ========================================
   MODAL CARD DETAILS FIX
   ======================================== */

/* Fix modal info sections that may have light backgrounds */
body.dark-theme .modal-card-info,
body.dark-theme .modal-stats {
    background: transparent;
}

body.dark-theme .modal-info-item {
    background: transparent;
}

/* Ensure all modal content sections use dark theme */
body.dark-theme .modal-content-section {
    background: transparent;
}

/* Modal stat items */
body.dark-theme .modal-stat-item {
    background: var(--bg-section);
    border-color: var(--border-color);
}

/* Modal sections with white backgrounds */
body.dark-theme .modal-section {
    background: transparent;
}

body.dark-theme .modal-divider {
    border-color: var(--border-color);
}

/* Modal Price Section */
body.dark-theme .modal-price-section,
body.dark-theme #modalPriceSection {
    background: var(--bg-section) !important;
}

body.dark-theme .price-section-header h4 {
    color: var(--text-primary);
}

body.dark-theme .price-main {
    background: var(--bg-container);
}

body.dark-theme .price-detail-label {
    color: var(--text-secondary);
}

body.dark-theme .price-detail-value {
    color: var(--text-primary);
}

body.dark-theme .tcgplayer-buy-btn {
    background: #3498db;
    color: white;
}

body.dark-theme .tcgplayer-buy-btn:hover {
    background: #2980b9;
}

body.dark-theme .market-price-link:hover .market-price-value {
    color: #3498db;
}

/* Modal Trading Section */
body.dark-theme .modal-trading-section {
    background: transparent;
}

body.dark-theme .trading-controls-compact,
body.dark-theme #modalTradingSection .trading-controls-compact {
    background: var(--bg-section) !important;
}

body.dark-theme .trading-label {
    color: var(--text-secondary);
}

body.dark-theme .trading-compact-btn {
    background: var(--bg-container);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .trading-compact-btn:hover {
    background: #3a3a3a;
    border-color: var(--color-primary);
}

/* Trading Hub Page */
body.dark-theme .trading-section {
    background: var(--bg-container);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-theme .section-header h2 {
    color: var(--text-primary);
}

body.dark-theme .section-description {
    color: var(--text-secondary);
}

body.dark-theme .trading-card-enhanced {
    background: var(--bg-container);
    border-color: #444444;
}

body.dark-theme .trading-card-enhanced:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

body.dark-theme .card-number,
body.dark-theme .card-name {
    color: var(--text-primary);
}

body.dark-theme .card-set {
    background: #3a3a3a;
    color: var(--text-primary);
}

body.dark-theme .qty-btn {
    background: var(--bg-section);
    color: var(--text-primary);
    border-color: #555555;
}

body.dark-theme .qty-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

body.dark-theme .qty-input {
    background: var(--bg-section);
    color: var(--text-primary);
    border-color: #555555;
}

body.dark-theme .qty-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

body.dark-theme .trading-card-footer {
    border-top-color: #444444;
}

body.dark-theme .quantity-label {
    color: var(--text-secondary);
}

body.dark-theme .empty-list {
    background: var(--bg-section);
    border-color: #444444;
    color: var(--text-secondary);
}

body.dark-theme .empty-state {
    background: var(--bg-container);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-theme .empty-state h3 {
    color: var(--text-primary);
}

body.dark-theme .empty-state p {
    color: var(--text-secondary);
}

body.dark-theme .error {
    background: #3a1f1f;
    border-color: #e74c3c;
    color: #ff6b6b;
}

body.dark-theme .card-price {
    background: #27ae60;
    color: white;
}

/* ========================================
   CARD BROWSER TILE FIXES
   ======================================== */

/* Fix card-details section background in card tiles */
body.dark-theme .card-details {
    background: transparent;
}

/* Fix card stats badges in tiles */
body.dark-theme .card-stats span {
    background: var(--bg-section);
    color: var(--text-primary);
}

/* ========================================
   MODAL PILOT CAROUSEL FIX
   ======================================== */

/* Fix pilot carousel light blue background */
body.dark-theme .pilot-carousel {
    background: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .pilot-carousel-title {
    color: var(--text-primary);
}

body.dark-theme .pilot-image-container {
    background: var(--bg-container);
}

body.dark-theme .pilot-image-container img {
    background: var(--bg-container);
}

body.dark-theme .pilot-description {
    background: var(--bg-container);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

/* ========================================
   BATCH IMPORT MODAL
   ======================================== */

/* Import instructions section */
body.dark-theme .import-instructions {
    background-color: #1e3a4d;
    border-left-color: var(--color-primary);
}

body.dark-theme .import-instructions p,
body.dark-theme .import-instructions ol,
body.dark-theme .import-instructions li {
    color: var(--text-primary);
}

/* Template download section */
body.dark-theme .template-download-section {
    border-top-color: var(--border-color);
    border-bottom-color: var(--border-color);
}

/* File upload section */
body.dark-theme .file-upload-label {
    color: var(--text-primary);
}

body.dark-theme .file-input {
    border-color: #555555;
    background-color: var(--bg-section);
    color: var(--text-primary);
}

body.dark-theme .file-input:hover {
    border-color: var(--color-primary);
    background-color: #3a3a3a;
}

body.dark-theme .file-name-display {
    background-color: #1e4d2b;
    color: var(--color-success);
}

/* Import warnings */
body.dark-theme .import-warnings {
    background-color: #4d3a1e;
    border-left-color: var(--color-warning);
}

body.dark-theme .import-warnings h4,
body.dark-theme .import-warnings ul,
body.dark-theme .import-warnings li {
    color: #f0e6d2;
}

/* Product select dropdown */
body.dark-theme .product-select {
    background-color: var(--bg-section);
    border-color: #555555;
    color: var(--text-primary);
}

body.dark-theme .product-select:focus {
    border-color: var(--color-primary);
    background-color: #3a3a3a;
}

body.dark-theme .product-select:disabled {
    background-color: #2c2c2c;
    color: #666666;
}

/* Import info box */
body.dark-theme .import-info {
    background-color: #1e4d2b;
    border-left-color: var(--color-success);
}

body.dark-theme .import-info p {
    color: var(--text-primary);
}

/* Card preview section */
body.dark-theme .card-preview-section {
    background-color: var(--bg-section);
    border-color: var(--border-color);
}

body.dark-theme .card-preview-section h4 {
    color: var(--text-primary);
}

body.dark-theme .card-preview-list {
    background-color: var(--bg-container);
    border-color: var(--border-color);
}

body.dark-theme .card-preview-item {
    border-bottom-color: #444444;
}

body.dark-theme .card-preview-item:hover {
    background-color: var(--bg-section);
}

body.dark-theme .card-preview-number,
body.dark-theme .card-preview-name {
    color: var(--text-primary);
}

body.dark-theme .card-preview-loading {
    color: var(--text-secondary);
}

body.dark-theme .card-preview-error {
    background-color: #3a1a1a;
    color: #ff6b6b;
}

/* ============================================
   Deck Builder - Current Deck Grid Cards
   ============================================ */
body.dark-theme .deck-grid-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

body.dark-theme .deck-grid-card:hover {
    background: var(--hover-bg);
    border-color: var(--color-primary);
}

body.dark-theme .deck-grid-image {
    background: var(--bg-section);
}

body.dark-theme .deck-grid-placeholder {
    background: var(--bg-section);
    color: var(--text-muted);
}

/* Current deck controls - positioned below image */
body.dark-theme .deck-grid-card .card-deck-controls {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

body.dark-theme .deck-grid-card .quantity-btn {
    background: var(--color-primary);
    color: white;
}

body.dark-theme .deck-grid-card .quantity-btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

body.dark-theme .deck-grid-card .quantity-btn:disabled {
    background: #444;
    color: #666;
}

body.dark-theme .deck-grid-card .quantity-display,
body.dark-theme .deck-grid-card .quantity-display-alt {
    color: var(--text-color);
}

/* List view dark theme */
body.dark-theme .deck-card-controls-wrapper {
    background: transparent;
}

body.dark-theme .deck-card-controls-wrapper .quantity-btn {
    background: var(--color-primary);
    color: white;
}

body.dark-theme .deck-card-controls-wrapper .quantity-btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

body.dark-theme .deck-card-controls-wrapper .quantity-btn:disabled {
    background: #444;
    color: #666;
}

/* ============================================
   Quick Filters - Dark Theme
   ============================================ */

/* Filters drawer container */
body.dark-theme .filters-drawer {
    background: var(--bg-container);
    border-color: var(--border-color);
}

body.dark-theme .quick-filter-label {
    color: var(--text-primary);
}

body.dark-theme .quick-filter-btn {
    background: var(--bg-section);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .quick-filter-select {
    background: var(--bg-section);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .quick-filter-select:hover {
    border-color: var(--color-primary);
    background: #3a3a3a;
}

body.dark-theme .quick-filter-select:focus {
    border-color: var(--color-primary);
    background: #3a3a3a;
}

body.dark-theme .clear-filters-btn {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-theme .clear-filters-btn:hover {
    background: var(--btn-secondary-bg-hover);
}

body.dark-theme .quick-filter-btn:hover:not(.active) {
    background: var(--hover-bg);
    border-color: var(--color-primary);
}

body.dark-theme .quick-filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Color-specific dark theme (colors remain the same) */
body.dark-theme .color-filter[data-value="Blue"].active {
    background: var(--card-color-blue);
    border-color: var(--card-color-blue);
}

body.dark-theme .color-filter[data-value="Green"].active {
    background: var(--card-color-green);
    border-color: var(--card-color-green);
}

body.dark-theme .color-filter[data-value="Red"].active {
    background: var(--card-color-red);
    border-color: var(--card-color-red);
}

body.dark-theme .color-filter[data-value="Purple"].active {
    background: var(--card-color-purple);
    border-color: var(--card-color-purple);
}

body.dark-theme .color-filter[data-value="White"].active {
    background: #ecf0f1;
    border-color: #bdc3c7;
    color: #333;
}

/* Mobile Bottom Tabs - Dark Theme */
body.dark-theme .mobile-bottom-tabs {
    background: #2c2c2c;
    border-top-color: #444444;
}

body.dark-theme .mobile-tab-button {
    color: #999999;
}

body.dark-theme .mobile-tab-button.active {
    color: var(--color-primary, #3498db);
}


/* Mobile Deck Header - Dark Theme */
body.dark-theme .mobile-deck-header {
    background: #2c2c2c;
    border-bottom-color: #444444;
}

body.dark-theme .mobile-deck-title {
    color: var(--text-primary);
}

body.dark-theme .mobile-deck-menu-btn {
    color: #999999;
}

body.dark-theme .mobile-deck-menu-btn:active {
    color: var(--color-primary, #3498db);
}

/* Mobile Menu Dropdown - Dark Theme */
body.dark-theme .menu-dropdown {
    background: #2c2c2c;
    border-color: #444444;
}

/* Mobile Menu - Dark Theme */
body.dark-theme .mobile-menu-dropdown {
    background: #2c2c2c;
}

body.dark-theme .mobile-menu-header {
    border-bottom-color: #444444;
}

body.dark-theme .mobile-menu-header h3 {
    color: var(--text-primary);
}

body.dark-theme .mobile-menu-close {
    color: #999999;
}

body.dark-theme .mobile-menu-close:active {
    color: var(--text-primary);
}

body.dark-theme .mobile-menu-item {
    background: #2c2c2c;
    border-bottom-color: #444444;
    color: var(--text-primary);
}

body.dark-theme .mobile-menu-item:active {
    background: #3a3a3a;
}

body.dark-theme .mobile-menu-item.delete {
    color: #e74c3c;
}

/* ========================================
   COLLECTION SHARING SECTION
   ======================================== */

/* Collection sharing cards - match set-card styling */
body.dark-theme .sharing-card {
    background: #333333;
    border-color: #444444;
}

body.dark-theme .sharing-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-theme .sharing-card h3 {
    color: var(--text-primary);
}

/* Share items within cards */
body.dark-theme .share-item {
    background: var(--bg-container);
    border-color: var(--border-color);
}

/* Input fields in sharing section */
body.dark-theme .invite-form .input-field {
    background: #3a3a3a;
    border-color: #555555;
    color: var(--text-primary);
}

body.dark-theme .invite-form .input-field:focus {
    border-color: var(--color-primary);
    background: #404040;
}

/* ========================================
   NOTIFICATION BELL
   ======================================== */

body.dark-theme .notification-bell {
    background: transparent;
}

body.dark-theme .notification-bell:focus {
    background: transparent;
}

body.dark-theme .notification-bell:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .notification-dropdown {
    background: #2a2a2a;
    border-color: #444444;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-theme .notification-header {
    border-bottom-color: #444444;
}

body.dark-theme .notification-item {
    border-bottom-color: #444444;
}

body.dark-theme .notification-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .notification-message {
    background: #1e1e1e;
    border-left-color: var(--color-primary);
}

body.dark-theme .notification-actions .btn-decline {
    background: #3a3a3a;
    border-color: #555555;
    color: var(--text-secondary);
}

body.dark-theme .notification-actions .btn-decline:hover:not(:disabled) {
    background: #444444;
}

body.dark-theme .notification-toast {
    background: #2a2a2a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

body.dark-theme .notification-list::-webkit-scrollbar-track {
    background: #1e1e1e;
}

body.dark-theme .notification-list::-webkit-scrollbar-thumb {
    background: #555555;
}

body.dark-theme .notification-list::-webkit-scrollbar-thumb:hover {
    background: #666666;
}
