/* ==============================================
   SNARE Admin - Dark Theme (macOS Style)
   Stile grigio elegante, no colori vivaci
   ============================================== */

/* ===== ADMIN-ONLY ELEMENTS ===== */
/* Hide admin-only elements by default, show only for admin role */
.admin-only { display: none !important; }
body.role-admin .admin-only { display: flex !important; }

/* ===== BASE ===== */
html[data-bs-theme="dark"] body {
    background: #1c1c1e !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] {
    color-scheme: dark;
}

/* ===== SIDEBAR ===== */
html[data-bs-theme="dark"] .sidebar {
    background: #2c2c2e !important;
    border-right: 1px solid #3a3a3c !important;
}

html[data-bs-theme="dark"] .nav-icon {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .nav-icon:hover {
    background: #3a3a3c !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .nav-icon.active {
    background: #48484a !important;
    color: #ffffff !important;
}

/* ===== HEADER ===== */
html[data-bs-theme="dark"] .header {
    background: #2c2c2e !important;
    border-bottom: 1px solid #3a3a3c !important;
}

html[data-bs-theme="dark"] .header-title h1,
html[data-bs-theme="dark"] .header h1 {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .header-title span,
html[data-bs-theme="dark"] .header span {
    color: #98989d !important;
}

/* ===== CARDS ===== */
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .stat-card,
html[data-bs-theme="dark"] .search-card,
html[data-bs-theme="dark"] .recent-searches,
html[data-bs-theme="dark"] .content-card {
    background: #2c2c2e !important;
    border: 1px solid #3a3a3c !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

html[data-bs-theme="dark"] .card:hover,
html[data-bs-theme="dark"] .stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .card-header,
html[data-bs-theme="dark"] .card-title {
    background: transparent !important;
    border-bottom: 1px solid #3a3a3c !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .stat-card .value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .stat-card .label {
    color: #b0b0b5 !important;
}

/* ===== MAIN CONTENT AREA ===== */
html[data-bs-theme="dark"] .main,
html[data-bs-theme="dark"] .content,
html[data-bs-theme="dark"] .page-content {
    background: #1c1c1e !important;
}

/* ===== TABLES ===== */
html[data-bs-theme="dark"] table {
    color: #f5f5f7 !important;
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] th {
    background: #3a3a3c !important;
    color: #f5f5f7 !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] td {
    border-color: #3a3a3c !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] tr:hover {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] tbody tr {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] tbody tr:nth-child(even) {
    background: #323234 !important;
}

/* Sortable table headers */
html[data-bs-theme="dark"] .sortable-th:hover {
    background: rgba(254, 44, 85, 0.2) !important;
}

html[data-bs-theme="dark"] .sort-indicator::after {
    color: #98989d;
}

html[data-bs-theme="dark"] .sort-indicator.asc::after,
html[data-bs-theme="dark"] .sort-indicator.desc::after {
    color: #FE2C55 !important;
}

html[data-bs-theme="dark"] .sticky-top {
    background: #3a3a3c !important;
}

/* TikTok data page - sentiment charts and table sections */
html[data-bs-theme="dark"] .sentiment-charts-section,
html[data-bs-theme="dark"] .videos-table-section,
html[data-bs-theme="dark"] .ai-section,
html[data-bs-theme="dark"] .filters-section,
html[data-bs-theme="dark"] .chart-card {
    background: #2c2c2e !important;
    border: 1px solid #3a3a3c !important;
}

html[data-bs-theme="dark"] .sentiment-charts-header h3,
html[data-bs-theme="dark"] .videos-table-header h3,
html[data-bs-theme="dark"] .ai-header h3 {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .sentiment-chart-item h6,
html[data-bs-theme="dark"] .chart-card h4 {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .videos-table th {
    background: #3a3a3c !important;
    color: #f5f5f7 !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .videos-table td {
    border-color: #3a3a3c !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .videos-table tr:hover {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .sticky-header {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .filter-group label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .toggle-label {
    color: #98989d !important;
}

/* ===== INPUTS & FORMS ===== */
html[data-bs-theme="dark"] input,
html[data-bs-theme="dark"] textarea,
html[data-bs-theme="dark"] select,
html[data-bs-theme="dark"] .form-control {
    background: #3a3a3c !important;
    border: 1px solid #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] input::placeholder,
html[data-bs-theme="dark"] textarea::placeholder {
    color: #6e6e73 !important;
}

html[data-bs-theme="dark"] input:focus,
html[data-bs-theme="dark"] textarea:focus,
html[data-bs-theme="dark"] select:focus,
html[data-bs-theme="dark"] .form-control:focus {
    border-color: #636366 !important;
    box-shadow: 0 0 0 3px rgba(99, 99, 102, 0.3) !important;
    outline: none !important;
}

/* ===== BUTTONS ===== */
html[data-bs-theme="dark"] .btn-primary,
html[data-bs-theme="dark"] button[type="submit"] {
    background: #48484a !important;
    border: 1px solid #636366 !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-primary:hover,
html[data-bs-theme="dark"] button[type="submit"]:hover {
    background: #636366 !important;
    border-color: #8e8e93 !important;
}

html[data-bs-theme="dark"] .btn-secondary,
html[data-bs-theme="dark"] button[type="button"] {
    background: #3a3a3c !important;
    border: 1px solid #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-secondary:hover,
html[data-bs-theme="dark"] button[type="button"]:hover {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .btn-logout {
    border-color: #48484a !important;
    color: #98989d !important;
    background: transparent !important;
}

html[data-bs-theme="dark"] .btn-logout:hover {
    background: #3a3a3c !important;
    border-color: #636366 !important;
    color: #f5f5f7 !important;
}

/* ===== TABS ===== */
html[data-bs-theme="dark"] .tab-btn,
html[data-bs-theme="dark"] .platform-btn,
html[data-bs-theme="dark"] .type-btn,
html[data-bs-theme="dark"] .page-tab {
    background: #3a3a3c !important;
    color: #98989d !important;
    border: 1px solid #48484a !important;
}

html[data-bs-theme="dark"] .tab-btn:hover,
html[data-bs-theme="dark"] .platform-btn:hover,
html[data-bs-theme="dark"] .type-btn:hover,
html[data-bs-theme="dark"] .page-tab:hover {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tab-btn.active,
html[data-bs-theme="dark"] .platform-btn.active,
html[data-bs-theme="dark"] .type-btn.active,
html[data-bs-theme="dark"] .page-tab.active {
    background: #48484a !important;
    color: #ffffff !important;
    border-color: #636366 !important;
}

/* ===== MODALS ===== */
html[data-bs-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .modal-overlay > div,
html[data-bs-theme="dark"] .modal {
    background: #2c2c2e !important;
    border: 1px solid #3a3a3c !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .modal-header {
    border-bottom: 1px solid #3a3a3c !important;
}

html[data-bs-theme="dark"] .modal-footer {
    border-top: 1px solid #3a3a3c !important;
}

/* ===== DROPDOWNS ===== */
html[data-bs-theme="dark"] .dropdown-menu,
html[data-bs-theme="dark"] .user-dropdown {
    background: #2c2c2e !important;
    border: 1px solid #3a3a3c !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}

html[data-bs-theme="dark"] .dropdown-item {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .dropdown-item:hover {
    background: #3a3a3c !important;
}

/* ===== RECENT ITEMS / LIST ITEMS ===== */
html[data-bs-theme="dark"] .recent-item,
html[data-bs-theme="dark"] .list-item,
html[data-bs-theme="dark"] .activity-item {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .recent-item:hover,
html[data-bs-theme="dark"] .list-item:hover,
html[data-bs-theme="dark"] .activity-item:hover {
    background: #3a3a3c !important;
}

/* ===== STATUS BADGES ===== */
html[data-bs-theme="dark"] .status-icon.pending,
html[data-bs-theme="dark"] .recent-item-status.pending {
    background: #3a3a3c !important;
    color: #ffd60a !important;
}

html[data-bs-theme="dark"] .status-icon.processing,
html[data-bs-theme="dark"] .recent-item-status.processing {
    background: #3a3a3c !important;
    color: #64d2ff !important;
}

html[data-bs-theme="dark"] .status-icon.completed,
html[data-bs-theme="dark"] .recent-item-status.completed {
    background: #3a3a3c !important;
    color: #30d158 !important;
}

html[data-bs-theme="dark"] .status-icon.failed,
html[data-bs-theme="dark"] .recent-item-status.failed {
    background: #3a3a3c !important;
    color: #ff453a !important;
}

/* ===== TAGS & BADGES ===== */
html[data-bs-theme="dark"] .badge,
html[data-bs-theme="dark"] .tag {
    background: #3a3a3c !important;
    color: #f5f5f7 !important;
}

/* Light theme badges - ensure text visibility */
html[data-bs-theme="light"] .badge.bg-secondary {
    color: #ffffff !important;
}

/* ===== SCROLLBAR (macOS style) ===== */
html[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: transparent;
}

html[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #48484a;
    border-radius: 4px;
}

html[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #636366;
}

/* ===== TEXT COLORS ===== */
html[data-bs-theme="dark"] .text-muted,
html[data-bs-theme="dark"] .text-secondary {
    color: #98989d !important;
}

html[data-bs-theme="dark"] h1,
html[data-bs-theme="dark"] h2,
html[data-bs-theme="dark"] h3,
html[data-bs-theme="dark"] h4,
html[data-bs-theme="dark"] h5,
html[data-bs-theme="dark"] h6 {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] p {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] label {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] small {
    color: #98989d !important;
}

/* ===== LINKS ===== */
html[data-bs-theme="dark"] a {
    color: #98989d !important;
}

html[data-bs-theme="dark"] a:hover {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .nav-icon a,
html[data-bs-theme="dark"] .sidebar a {
    color: inherit !important;
}

/* ===== DIVIDERS ===== */
html[data-bs-theme="dark"] hr {
    border-color: #3a3a3c !important;
}

/* ===== ALERTS ===== */
html[data-bs-theme="dark"] .alert {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .alert-success {
    background: rgba(48, 209, 88, 0.15) !important;
    border-color: rgba(48, 209, 88, 0.3) !important;
    color: #30d158 !important;
}

html[data-bs-theme="dark"] .alert-error,
html[data-bs-theme="dark"] .alert-danger {
    background: rgba(255, 69, 58, 0.15) !important;
    border-color: rgba(255, 69, 58, 0.3) !important;
    color: #ff453a !important;
}

/* ===== SEARCH BOX ===== */
html[data-bs-theme="dark"] .search-box,
html[data-bs-theme="dark"] .search-input {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

/* ===== WATERMARK ===== */
html[data-bs-theme="dark"] .snare-watermark {
    opacity: 0.05 !important;
    z-index: 1 !important;
    filter: invert(1) brightness(1.5);
}

/* Watermark responsive - smaller on narrow screens */
@media (max-width: 1200px) {
    .snare-watermark {
        width: 400px !important;
        height: 400px !important;
        bottom: 10px !important;
        right: 10px !important;
    }
}

@media (max-width: 800px) {
    .snare-watermark {
        display: none !important;
    }
}

/* ===== RAG PAGE STATS ===== */
html[data-bs-theme="dark"] .stat {
    background: #2c2c2e !important;
    border: 1px solid #3a3a3c !important;
}

html[data-bs-theme="dark"] .stat-value {
    color: #60a5fa !important;
}

html[data-bs-theme="dark"] .stat-label {
    color: #a1a1aa !important;
}

/* ===== SALVATAGGI PAGE STATS ===== */
html[data-bs-theme="dark"] .stat-icon {
    background: #2c2c2e !important;
    color: #60a5fa !important;
    border: 1px solid #3a3a3c;
}

/* ===== FOOTER ===== */
html[data-bs-theme="dark"] footer {
    background: #2c2c2e !important;
    border-top: 1px solid #3a3a3c !important;
}

/* ===== LOGIN PAGE ===== */
html[data-bs-theme="dark"] .login-container,
html[data-bs-theme="dark"] .login-box {
    background: #2c2c2e !important;
}

/* ===== CHARTS ===== */
html[data-bs-theme="dark"] canvas {
    filter: brightness(0.9) saturate(0.9);
}

/* ===== USER MENU ===== */
html[data-bs-theme="dark"] .user-menu {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .user-info .name {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .user-info .role {
    color: #98989d !important;
}

/* ===== PLUGIN/QUEUE CARDS ===== */
html[data-bs-theme="dark"] .plugin-card,
html[data-bs-theme="dark"] .queue-item {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

/* ===== EMPTY STATE ===== */
html[data-bs-theme="dark"] .empty-state {
    color: #636366 !important;
}

/* ===== SPECIFIC OVERRIDES ===== */
html[data-bs-theme="dark"] .recent-item-icon {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .delete-btn {
    color: #636366 !important;
}

html[data-bs-theme="dark"] .delete-btn:hover {
    color: #ff453a !important;
    background: transparent !important;
}

/* ===== DATE INPUTS ===== */
html[data-bs-theme="dark"] input[type="date"] {
    color-scheme: dark;
}

/* ===== QUICK ACTIONS (Dashboard) ===== */
html[data-bs-theme="dark"] .quick-action {
    background: #3a3a3c !important;
    color: #f5f5f7 !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .quick-action:hover {
    background: #48484a !important;
    border-color: #636366 !important;
}

html[data-bs-theme="dark"] .quick-action span {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .quick-action.twitter .icon {
    background: rgba(29, 155, 240, 0.2) !important;
    color: #1d9bf0 !important;
}

html[data-bs-theme="dark"] .quick-action.instagram .icon {
    background: rgba(225, 48, 108, 0.2) !important;
    color: #E1306C !important;
}

html[data-bs-theme="dark"] .quick-action.rag .icon {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #10b981 !important;
}

html[data-bs-theme="dark"] .quick-action.factcheck .icon {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #f59e0b !important;
}

/* ===== SYSTEM STATUS (Dashboard) ===== */
html[data-bs-theme="dark"] .status-item {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .status-item .label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .status-value {
    color: #f5f5f7 !important;
}

/* ===== ACTIVITY ITEMS / RECENT ACTIVITY ===== */
html[data-bs-theme="dark"] .activity-item,
html[data-bs-theme="dark"] .recent-item {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .activity-item:hover,
html[data-bs-theme="dark"] .recent-item:hover {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .activity-text,
html[data-bs-theme="dark"] .recent-item-text,
html[data-bs-theme="dark"] .activity-item *,
html[data-bs-theme="dark"] .recent-item * {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .activity-time,
html[data-bs-theme="dark"] .recent-item-time {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .activity-title,
html[data-bs-theme="dark"] .recent-item-title,
html[data-bs-theme="dark"] .activity-item strong,
html[data-bs-theme="dark"] .recent-item strong {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .activity-meta,
html[data-bs-theme="dark"] .recent-item-meta {
    color: #98989d !important;
}

/* Activity content specifics */
html[data-bs-theme="dark"] .activity-content .title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .activity-content .meta {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .activity-badge {
    background: #3a3a3c !important;
}

/* Activity icons */
html[data-bs-theme="dark"] .activity-icon {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .activity-icon.twitter {
    background: rgba(29, 155, 240, 0.2) !important;
    color: #1d9bf0 !important;
}

html[data-bs-theme="dark"] .activity-icon.instagram {
    background: rgba(225, 48, 108, 0.2) !important;
    color: #E1306C !important;
}

html[data-bs-theme="dark"] .activity-icon.rag {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #10b981 !important;
}

html[data-bs-theme="dark"] .activity-icon.factcheck {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #f59e0b !important;
}

html[data-bs-theme="dark"] .activity-icon svg {
    color: inherit !important;
}

/* Twitter X icon uses fill, Instagram uses stroke */
html[data-bs-theme="dark"] .activity-icon.twitter svg {
    fill: currentColor !important;
}

html[data-bs-theme="dark"] .activity-icon.instagram svg {
    fill: none !important;
    stroke: currentColor !important;
}

/* ===== TWITTER SEARCH PAGE ===== */
html[data-bs-theme="dark"] .search-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .search-card-header {
    background: transparent !important;
}

html[data-bs-theme="dark"] .search-card-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .search-card-subtitle {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .search-card-icon {
    background: #3a3a3c !important;
}

/* Platform buttons (X/Twitter, Instagram) */
html[data-bs-theme="dark"] .platform-btn {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .platform-btn:hover {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .platform-btn.active.twitter {
    background: #1d9bf0 !important;
    border-color: #1d9bf0 !important;
    color: white !important;
}

html[data-bs-theme="dark"] .platform-btn.active.instagram {
    background: linear-gradient(45deg, #f09433, #dc2743) !important;
    border-color: transparent !important;
    color: white !important;
}

/* Search type tabs (Query/Hashtag, User Profile) */
html[data-bs-theme="dark"] .search-tab {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .search-tab:hover {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .search-tab.active {
    background: #48484a !important;
    border-color: #636366 !important;
    color: #f5f5f7 !important;
}

/* Recent searches card */
html[data-bs-theme="dark"] .recent-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .recent-header {
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .recent-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-clear-all {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .btn-clear-all:hover {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

/* Recent search items */
html[data-bs-theme="dark"] .recent-item {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .recent-item:hover {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .recent-item-icon {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .recent-item-query {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .recent-item-meta {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .recent-item-status {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .recent-item-status.completed {
    background: rgba(48, 209, 88, 0.2) !important;
    color: #30d158 !important;
}

html[data-bs-theme="dark"] .recent-item-status.pending {
    background: rgba(255, 214, 10, 0.2) !important;
    color: #ffd60a !important;
}

html[data-bs-theme="dark"] .recent-item-status.processing {
    background: rgba(100, 210, 255, 0.2) !important;
    color: #64d2ff !important;
}

html[data-bs-theme="dark"] .recent-item-status.failed {
    background: rgba(255, 69, 58, 0.2) !important;
    color: #ff453a !important;
}

/* Delete button in recent items */
html[data-bs-theme="dark"] .recent-item .delete-btn,
html[data-bs-theme="dark"] .btn-delete {
    color: #636366 !important;
}

html[data-bs-theme="dark"] .recent-item .delete-btn:hover,
html[data-bs-theme="dark"] .btn-delete:hover {
    color: #ff453a !important;
}

/* Search form labels */
html[data-bs-theme="dark"] .form-label,
html[data-bs-theme="dark"] .search-label,
html[data-bs-theme="dark"] .form-group label {
    color: #f59e0b !important;
}

html[data-bs-theme="dark"] .form-hint,
html[data-bs-theme="dark"] .search-hint,
html[data-bs-theme="dark"] .input-hint {
    color: #8e8e93 !important;
}

/* Search tabs container */
html[data-bs-theme="dark"] .search-tabs {
    background: transparent !important;
}

/* Search status / scanning progress */
html[data-bs-theme="dark"] .search-status {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .status-header {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .status-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .status-info {
    background: transparent !important;
}

html[data-bs-theme="dark"] .status-item {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .status-item .value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .status-item .label {
    color: #98989d !important;
}

/* Input icons */
html[data-bs-theme="dark"] .input-with-icon i {
    color: #636366 !important;
}

/* ===== X DATA PAGE ===== */
/* History cards (AI Analysis History) */
html[data-bs-theme="dark"] .history-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .history-card:hover {
    border-color: #48484a !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

html[data-bs-theme="dark"] .history-card.expanded {
    border-color: #636366 !important;
    box-shadow: 0 2px 12px rgba(99,99,102,0.2) !important;
}

html[data-bs-theme="dark"] .history-header {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .history-info {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .history-type {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .history-meta {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .history-preview {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .history-content {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #e5e5e7 !important;
}

/* Image analysis cards */
html[data-bs-theme="dark"] .image-analysis-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .image-analysis-card:hover {
    border-color: #48484a !important;
    background: #3a3a3c !important;
}

/* Analysis badges - Sublime Text/Monokai colors */
html[data-bs-theme="dark"] .analysis-badge.image { background: rgba(249, 38, 114, 0.2) !important; color: #F92672 !important; }
html[data-bs-theme="dark"] .analysis-badge.image.authentic { background: rgba(166, 226, 46, 0.2) !important; color: #A6E22E !important; }
html[data-bs-theme="dark"] .analysis-badge.image.manipulated { background: rgba(249, 38, 114, 0.3) !important; color: #F92672 !important; }

html[data-bs-theme="dark"] .analysis-badge.video { background: rgba(102, 217, 239, 0.2) !important; color: #66D9EF !important; }
html[data-bs-theme="dark"] .analysis-badge.video.authentic { background: rgba(166, 226, 46, 0.2) !important; color: #A6E22E !important; }
html[data-bs-theme="dark"] .analysis-badge.video.manipulated { background: rgba(249, 38, 114, 0.3) !important; color: #F92672 !important; }

html[data-bs-theme="dark"] .analysis-badge.fact-check { background: rgba(253, 151, 31, 0.2) !important; color: #FD971F !important; }
html[data-bs-theme="dark"] .analysis-badge.fact-check.authentic { background: rgba(166, 226, 46, 0.2) !important; color: #A6E22E !important; }
html[data-bs-theme="dark"] .analysis-badge.fact-check.manipulated { background: rgba(249, 38, 114, 0.3) !important; color: #F92672 !important; }

/* Type badges in Analysis column - Sublime Text/Monokai colors */
html[data-bs-theme="dark"] .type-badge.image { background: rgba(249, 38, 114, 0.25) !important; color: #F92672 !important; }
html[data-bs-theme="dark"] .type-badge.video { background: rgba(102, 217, 239, 0.25) !important; color: #66D9EF !important; }
html[data-bs-theme="dark"] .type-badge.fact-check { background: rgba(253, 151, 31, 0.25) !important; color: #FD971F !important; }

html[data-bs-theme="dark"] .model-badge {
    background: #3a3a3c !important;
    color: #98989d !important;
}

/* Expand button/icon */
html[data-bs-theme="dark"] .expand-icon {
    color: #636366 !important;
}

html[data-bs-theme="dark"] .click-to-expand {
    color: #636366 !important;
}

/* Page wrapper */
html[data-bs-theme="dark"] .page-wrapper {
    background: #1c1c1e !important;
}

/* User header (entity user page) */
html[data-bs-theme="dark"] .user-header {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .user-header h4,
html[data-bs-theme="dark"] .user-header #userName {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .user-header .text-muted {
    color: #b0b0b5 !important;
}

html[data-bs-theme="dark"] .user-stat-value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .user-stat-label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .user-avatar {
    border-color: #3a3a3c !important;
}

/* Section titles */
html[data-bs-theme="dark"] .section-title,
html[data-bs-theme="dark"] .card-title {
    color: #f5f5f7 !important;
}

/* Analysis select dropdown */
html[data-bs-theme="dark"] .analysis-select {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

/* Analyze button */
html[data-bs-theme="dark"] .btn-analyze {
    background: #48484a !important;
    border-color: #636366 !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-analyze:hover {
    background: #636366 !important;
}

/* Text muted */
html[data-bs-theme="dark"] .text-muted {
    color: #8e8e93 !important;
}

/* Recent Posts table */
html[data-bs-theme="dark"] .posts-table,
html[data-bs-theme="dark"] .table-container,
html[data-bs-theme="dark"] .table-responsive {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .posts-table table,
html[data-bs-theme="dark"] .card-table,
html[data-bs-theme="dark"] .table {
    background: #2c2c2e !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .posts-table th,
html[data-bs-theme="dark"] .card-table th,
html[data-bs-theme="dark"] .table th {
    background: #3a3a3c !important;
    color: #98989d !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .posts-table td,
html[data-bs-theme="dark"] .card-table td,
html[data-bs-theme="dark"] .table td {
    background: #2c2c2e !important;
    color: #e5e5e7 !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .posts-table tr:hover td,
html[data-bs-theme="dark"] .card-table tr:hover td,
html[data-bs-theme="dark"] .table tr:hover td {
    background: #3a3a3c !important;
}

/* Card footer */
html[data-bs-theme="dark"] .card-footer {
    background: #2c2c2e !important;
    border-top-color: #3a3a3c !important;
}

/* Outline buttons */
html[data-bs-theme="dark"] .btn-outline-primary {
    background: transparent !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .btn-outline-primary:hover {
    background: #3a3a3c !important;
    border-color: #636366 !important;
    color: #f5f5f7 !important;
}

/* Sortable column headers */
html[data-bs-theme="dark"] .sortable {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .sort-icon {
    color: #636366 !important;
}

/* Load More / Load All buttons */
html[data-bs-theme="dark"] .btn-load-more,
html[data-bs-theme="dark"] .btn-load-all,
html[data-bs-theme="dark"] .load-more-btn {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-load-more:hover,
html[data-bs-theme="dark"] .btn-load-all:hover,
html[data-bs-theme="dark"] .load-more-btn:hover {
    background: #48484a !important;
}

/* Pagination info */
html[data-bs-theme="dark"] .pagination-info {
    color: #98989d !important;
}

/* User cell in table */
html[data-bs-theme="dark"] .user-cell {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .user-cell a {
    color: #f5f5f7 !important;
}

/* Emotion tags */
html[data-bs-theme="dark"] .emotion-tag {
    background: #3a3a3c !important;
    color: #98989d !important;
}

/* Media Gallery */
html[data-bs-theme="dark"] .media-gallery {
    background: #2c2c2e !important;
}

/* Image Analysis History specific */
html[data-bs-theme="dark"] .image-analysis-card,
html[data-bs-theme="dark"] .analysis-history-item {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .image-analysis-card:hover,
html[data-bs-theme="dark"] .analysis-history-item:hover {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .image-analysis-card .description,
html[data-bs-theme="dark"] .analysis-description {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .image-analysis-card .date,
html[data-bs-theme="dark"] .analysis-date {
    color: #636366 !important;
}

/* Image analysis expanded content */
html[data-bs-theme="dark"] .image-analysis-full > div {
    background: #3a3a3c !important;
    color: #e5e5e7 !important;
}

/* Copy button */
html[data-bs-theme="dark"] .btn-copy,
html[data-bs-theme="dark"] .copy-btn {
    background: transparent !important;
    color: #636366 !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .btn-copy:hover,
html[data-bs-theme="dark"] .copy-btn:hover {
    color: #f5f5f7 !important;
    background: #3a3a3c !important;
}

/* ===== INSTAGRAM DATA PAGE ===== */
/* Empty state */
html[data-bs-theme="dark"] .empty-state {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .empty-state-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .empty-state-text {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .empty-state-hint {
    background: #3a3a3c !important;
    color: #98989d !important;
}

/* Stat cards (Total Posts, Unique Users, etc) */
html[data-bs-theme="dark"] .stat-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .stat-card h4 {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .stat-card .value {
    color: #f5f5f7 !important;
}

/* Charts Section container */
html[data-bs-theme="dark"] .charts-section {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .charts-section h3 {
    color: #f5f5f7 !important;
}

/* Chart cards */
html[data-bs-theme="dark"] .chart-card {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .chart-card h4 {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .charts-grid {
    background: transparent !important;
}

/* Sentiment cards */
html[data-bs-theme="dark"] .sentiment-card {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .sentiment-card h4 {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .sentiment-charts {
    background: transparent !important;
}

/* AI Section */
html[data-bs-theme="dark"] .ai-section {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .ai-section h3 {
    color: #f5f5f7 !important;
}

/* AI Tabs */
html[data-bs-theme="dark"] .ai-tabs {
    background: transparent !important;
}

html[data-bs-theme="dark"] .ai-tab {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .ai-tab:hover {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .ai-tab.active {
    background: #E1306C !important;
    border-color: #E1306C !important;
    color: white !important;
}

/* AI Controls */
html[data-bs-theme="dark"] .ai-controls {
    background: transparent !important;
}

html[data-bs-theme="dark"] .ai-select {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-ai {
    background: #E1306C !important;
    border-color: #E1306C !important;
    color: white !important;
}

html[data-bs-theme="dark"] .btn-ai:hover {
    background: #c72a5e !important;
}

/* AI Panel */
html[data-bs-theme="dark"] .ai-panel {
    background: transparent !important;
}

html[data-bs-theme="dark"] .ai-result {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #e5e5e7 !important;
}

/* Filters section */
html[data-bs-theme="dark"] .filters {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .filter-input {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .filter-input::placeholder {
    color: #636366 !important;
}

html[data-bs-theme="dark"] .btn-filter {
    background: #E1306C !important;
    border-color: #E1306C !important;
    color: white !important;
}

/* Map controls */
html[data-bs-theme="dark"] .map-controls {
    background: transparent !important;
}

html[data-bs-theme="dark"] .btn-map {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-map.active {
    background: #E1306C !important;
    border-color: #E1306C !important;
}

html[data-bs-theme="dark"] .map-size-btn {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .map-size-btn.active {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

/* Post cards */
html[data-bs-theme="dark"] .post-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .post-card:hover {
    border-color: #48484a !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}

html[data-bs-theme="dark"] .post-header {
    background: #2c2c2e !important;
    border-bottom-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .post-card .username,
html[data-bs-theme="dark"] .post-username {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .post-card .caption,
html[data-bs-theme="dark"] .post-caption {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .post-card .meta,
html[data-bs-theme="dark"] .post-meta {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .post-card .hashtag {
    color: #E1306C !important;
}

html[data-bs-theme="dark"] .post-footer {
    background: #2c2c2e !important;
    border-top-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .post-stats {
    color: #98989d !important;
}

/* Posts grid */
html[data-bs-theme="dark"] .posts-grid {
    background: transparent !important;
}

/* Progress bar */
html[data-bs-theme="dark"] .progress-bar {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .progress-bar-fill {
    background: #E1306C !important;
}

/* Pagination */
html[data-bs-theme="dark"] .pagination-btn,
html[data-bs-theme="dark"] .page-btn {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .pagination-btn:hover,
html[data-bs-theme="dark"] .page-btn:hover {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .pagination-btn.active,
html[data-bs-theme="dark"] .page-btn.active {
    background: #E1306C !important;
    border-color: #E1306C !important;
    color: white !important;
}

html[data-bs-theme="dark"] .pagination span {
    color: #98989d !important;
}

/* ===== DATABASE PAGE ===== */
html[data-bs-theme="dark"] .collection-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .collection-card:hover {
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .collection-header {
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .collection-name {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .collection-meta {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .collection-icon {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .collection-badge {
    background: #3a3a3c !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .collection-badge.current {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .collection-body {
    background: transparent !important;
}

html[data-bs-theme="dark"] .collection-stats {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .section-title {
    color: #f5f5f7 !important;
}

/* ===== SALVATAGGI PAGE ===== */
html[data-bs-theme="dark"] .folder-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .folder-card:hover {
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .folder-header {
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .folder-name {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .folder-meta {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .folder-icon {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .folder-body {
    background: transparent !important;
}

html[data-bs-theme="dark"] .folder-stats {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .folder-stat {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .stat-icon {
    /* Keep colorful gradients in dark mode for Instagram stat icons */
    color: white !important;
}

html[data-bs-theme="dark"] .stat-icon.posts { background: linear-gradient(135deg, #833AB4, #C13584) !important; }
html[data-bs-theme="dark"] .stat-icon.users { background: linear-gradient(135deg, #405DE6, #5851DB) !important; }
html[data-bs-theme="dark"] .stat-icon.likes { background: linear-gradient(135deg, #FD1D1D, #E1306C) !important; }
html[data-bs-theme="dark"] .stat-icon.comments { background: linear-gradient(135deg, #F77737, #FCAF45) !important; }

html[data-bs-theme="dark"] .stat-label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .stat-value {
    color: #f5f5f7 !important;
}

/* ===== SETTINGS PAGE ===== */
html[data-bs-theme="dark"] .settings-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .settings-card-header {
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .settings-card-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .settings-card-subtitle {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .settings-card-icon {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .form-group label {
    color: #c7c7cc !important;
}

html[data-bs-theme="dark"] .settings-grid {
    background: transparent !important;
}

html[data-bs-theme="dark"] .folder-stat {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .folder-stat .value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .folder-stat .label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .folder-icon.twitter {
    background: rgba(29, 161, 242, 0.2) !important;
}

html[data-bs-theme="dark"] .folder-icon.instagram {
    background: rgba(225, 48, 108, 0.2) !important;
}

html[data-bs-theme="dark"] .folder-icon.unknown {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .folder-actions .btn,
html[data-bs-theme="dark"] .collection-actions .btn {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .folder-actions .btn:hover,
html[data-bs-theme="dark"] .collection-actions .btn:hover {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .folder-actions .btn-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ff453a !important;
}

html[data-bs-theme="dark"] .page-header-actions .btn {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

/* ===== RAG PAGE ===== */
html[data-bs-theme="dark"] .card.chat-container,
html[data-bs-theme="dark"] .main .card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .doc-item {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .doc-item:hover {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .doc-icon {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .doc-name {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .doc-meta {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .doc-delete {
    color: #636366 !important;
}

html[data-bs-theme="dark"] .doc-delete:hover {
    color: #ff453a !important;
}

/* ===== CHARTS (Chart.js) ===== */
html[data-bs-theme="dark"] .chart-container,
html[data-bs-theme="dark"] .chart-wrapper {
    background: transparent !important;
}

html[data-bs-theme="dark"] canvas {
    filter: none !important;
}

/* ==============================================
   THEME TOGGLE BUTTON
   ============================================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 18px;
}

.theme-toggle:hover {
    background: #f1f5f9;
    color: #1e293b;
}

html[data-bs-theme="dark"] .theme-toggle {
    border-color: #48484a;
    color: #98989d;
}

html[data-bs-theme="dark"] .theme-toggle:hover {
    background: #3a3a3c;
    color: #f5f5f7;
}

/* ===== VIDEO ANALYSIS PAGE ===== */
html[data-bs-theme="dark"] .upload-area {
    background: #2c2c2e !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .upload-area:hover,
html[data-bs-theme="dark"] .upload-area.dragover {
    border-color: #636366 !important;
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .upload-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .upload-input {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .upload-input::placeholder {
    color: #636366 !important;
}

html[data-bs-theme="dark"] .upload-input:focus {
    border-color: #636366 !important;
    background: #48484a !important;
}

html[data-bs-theme="dark"] .lang-select-container label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .lang-select {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .platforms-info {
    color: #636366 !important;
}

html[data-bs-theme="dark"] .btn-analyze {
    background: #f5f5f7 !important;
    color: #1c1c1e !important;
}

html[data-bs-theme="dark"] .btn-analyze:hover {
    background: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .btn-upload {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-upload:hover {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .progress-container {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .progress-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .progress-percent {
    color: #60a5fa !important;
}

html[data-bs-theme="dark"] .progress-bar-wrapper {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .progress-bar-wrapper .progress-bar {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6) !important;
}

html[data-bs-theme="dark"] .step-item {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .step-item.pending {
    color: #636366 !important;
}

html[data-bs-theme="dark"] .step-item.active {
    color: #60a5fa !important;
}

html[data-bs-theme="dark"] .step-item.completed {
    color: #30d158 !important;
}

html[data-bs-theme="dark"] .estimated-time {
    color: #636366 !important;
}

html[data-bs-theme="dark"] .history-section {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .history-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .history-table th {
    background: #3a3a3c !important;
    color: #98989d !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .history-table td {
    background: #2c2c2e !important;
    color: #e5e5e7 !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .history-row:hover td {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .video-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .thumbnail {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .btn-delete {
    background: rgba(255, 69, 58, 0.15) !important;
    border-color: rgba(255, 69, 58, 0.3) !important;
    color: #ff453a !important;
}

html[data-bs-theme="dark"] .btn-delete:hover {
    background: rgba(255, 69, 58, 0.25) !important;
}

/* Video Analysis Report Page */
html[data-bs-theme="dark"] .hero-section {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .video-thumbnail {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .video-info .video-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .meta-item {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .scores-section,
html[data-bs-theme="dark"] .report-section {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .score-card {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .score-card-title {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .score-value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .score-bar-wrapper {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .chart-container {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .chart-title {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .report-summary {
    background: #3a3a3c !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .findings-card {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .findings-title {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .findings-list li {
    color: #c7c7cc !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .explanation-card {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .explanation-card h4 {
    color: #60a5fa !important;
}

html[data-bs-theme="dark"] .explanation-card p {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .technical-notes {
    background: #3a3a3c !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .technical-notes strong {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-back {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-back:hover {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .btn-export {
    background: #f5f5f7 !important;
    color: #1c1c1e !important;
}

html[data-bs-theme="dark"] .btn-export:hover {
    background: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .btn-print {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .btn-print:hover {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .confidence-bar {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .confidence-fill {
    background: #60a5fa !important;
}

html[data-bs-theme="dark"] .loading {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .loading-spinner {
    border-color: #3a3a3c !important;
    border-top-color: #60a5fa !important;
}

/* ===== FACT CHECK PAGE ===== */
html[data-bs-theme="dark"] .history-item {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .history-item:hover {
    background: #48484a !important;
    border-color: #636366 !important;
}

html[data-bs-theme="dark"] .history-item-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .history-item-meta {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .history-item-verdict {
    color: white !important;
}

/* Fact check form card */
html[data-bs-theme="dark"] .fact-check-card,
html[data-bs-theme="dark"] .verify-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .fact-check-title,
html[data-bs-theme="dark"] .section-header {
    color: #f5f5f7 !important;
}

/* Tabs */
html[data-bs-theme="dark"] .tab-btn {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tab-btn:hover {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tab-btn.active {
    background: #f5f5f7 !important;
    color: #1c1c1e !important;
}

/* Recent checks section */
html[data-bs-theme="dark"] .recent-checks,
html[data-bs-theme="dark"] .history-section {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .recent-checks-title {
    color: #f5f5f7 !important;
}

/* Verify button */
html[data-bs-theme="dark"] .btn-verify {
    background: #f5f5f7 !important;
    color: #1c1c1e !important;
}

html[data-bs-theme="dark"] .btn-verify:hover {
    background: #e5e5e7 !important;
}

/* OR divider */
html[data-bs-theme="dark"] .divider,
html[data-bs-theme="dark"] .or-divider {
    color: #636366 !important;
}

/* Delete button in fact check */
html[data-bs-theme="dark"] .history-item .btn-delete,
html[data-bs-theme="dark"] .history-item .delete-btn {
    color: #636366 !important;
    background: transparent !important;
}

html[data-bs-theme="dark"] .history-item .btn-delete:hover,
html[data-bs-theme="dark"] .history-item .delete-btn:hover {
    color: #ff453a !important;
}

/* Verdict badges - ensure readable text */
html[data-bs-theme="dark"] .verdict-partially_true,
html[data-bs-theme="dark"] .verdict-partially-true,
html[data-bs-theme="dark"] .history-item-verdict.verdict-partially_true {
    background: #fbbf24 !important;
    color: #1c1c1e !important;
}

html[data-bs-theme="dark"] .verdict-true {
    background: #22c55e !important;
    color: white !important;
}

html[data-bs-theme="dark"] .verdict-false {
    background: #ef4444 !important;
    color: white !important;
}

html[data-bs-theme="dark"] .verdict-misleading {
    background: #f97316 !important;
    color: white !important;
}

html[data-bs-theme="dark"] .verdict-unverified,
html[data-bs-theme="dark"] .verdict-unknown {
    background: #6b7280 !important;
    color: white !important;
}

/* ==========================================================================
   ACCORDION (Analytics - X/Data page)
   ========================================================================== */

html[data-bs-theme="dark"] .accordion {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .accordion-item {
    background: #2c2c2e !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .accordion-button {
    background: #2c2c2e !important;
    color: #f5f5f7 !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .accordion-button:hover {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .accordion-button .chevron-icon {
    color: #8e8e93 !important;
}

html[data-bs-theme="dark"] .accordion-body {
    background: #2c2c2e !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .accordion-collapse {
    background: #2c2c2e !important;
}

/* ==========================================================================
   X/DATA PAGE - Tweet table
   ========================================================================== */

html[data-bs-theme="dark"] .tweet-row .fw-bold {
    color: #f97316 !important;  /* Orange for visibility */
}

html[data-bs-theme="dark"] .tweet-row:hover {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tweet-text {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tweet-row.has-video,
html[data-bs-theme="dark"] .tweet-row.has-video td {
    background: #3d2963 !important;
}

html[data-bs-theme="dark"] .tweet-row.has-video:hover,
html[data-bs-theme="dark"] .tweet-row.has-video:hover td {
    background: #4c3578 !important;
}

/* ==========================================================================
   FACT CHECK REPORT PAGE
   ========================================================================== */

/* Section headers and titles */
html[data-bs-theme="dark"] .section-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .section-subtitle {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .section-header {
    border-bottom-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .section-icon {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .section-icon.blue { background: rgba(59, 130, 246, 0.2) !important; color: #60a5fa !important; }
html[data-bs-theme="dark"] .section-icon.green { background: rgba(34, 197, 94, 0.2) !important; color: #4ade80 !important; }
html[data-bs-theme="dark"] .section-icon.orange { background: rgba(249, 115, 22, 0.2) !important; color: #fb923c !important; }
html[data-bs-theme="dark"] .section-icon.purple { background: rgba(168, 85, 247, 0.2) !important; color: #c084fc !important; }
html[data-bs-theme="dark"] .section-icon.red { background: rgba(239, 68, 68, 0.2) !important; color: #f87171 !important; }

/* Explanation text */
html[data-bs-theme="dark"] .explanation-text {
    color: #e5e5e7 !important;
}

/* Original content box */
html[data-bs-theme="dark"] .original-text {
    background: #3a3a3c !important;
    color: #c7c7cc !important;
    border-left-color: #636366 !important;
}

/* Problems list */
html[data-bs-theme="dark"] .problem-item {
    background: rgba(239, 68, 68, 0.15) !important;
    border-left-color: #f87171 !important;
}

html[data-bs-theme="dark"] .problem-item p {
    color: #fca5a5 !important;
}

html[data-bs-theme="dark"] .problem-item svg {
    color: #f87171 !important;
}

/* Agent cards */
html[data-bs-theme="dark"] .agent-card {
    background: #3a3a3c !important;
    border-left-color: #60a5fa !important;
}

html[data-bs-theme="dark"] .agent-header {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .agent-icon {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
}

html[data-bs-theme="dark"] .agent-name {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .agent-content {
    color: #c7c7cc !important;
}

html[data-bs-theme="dark"] .agent-searches {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

/* Agent score bars */
html[data-bs-theme="dark"] .agent-score-bar .agent-score-label {
    color: #c7c7cc !important;
}

html[data-bs-theme="dark"] .agent-score-track {
    background: #48484a !important;
}

/* Source cards */
html[data-bs-theme="dark"] .source-card {
    background: #3a3a3c !important;
    border-left-color: #636366 !important;
}

html[data-bs-theme="dark"] .source-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

html[data-bs-theme="dark"] .source-card.credible {
    background: rgba(34, 197, 94, 0.1) !important;
    border-left-color: #4ade80 !important;
}

html[data-bs-theme="dark"] .source-card.source-official {
    background: rgba(14, 165, 233, 0.1) !important;
    border-left-color: #38bdf8 !important;
}

html[data-bs-theme="dark"] .source-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .source-domain {
    color: #60a5fa !important;
}

html[data-bs-theme="dark"] .source-snippet {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .source-link {
    color: #60a5fa !important;
}

html[data-bs-theme="dark"] .credible-badge {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

html[data-bs-theme="dark"] .official-badge {
    background: #0ea5e9 !important;
    color: white !important;
}

/* Chart boxes */
html[data-bs-theme="dark"] .chart-box {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .chart-box h4 {
    color: #98989d !important;
}

/* Timeline box */
html[data-bs-theme="dark"] .timeline-box {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(34, 197, 94, 0.15) 100%) !important;
}

html[data-bs-theme="dark"] .timeline-point .icon {
    background: #3a3a3c !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

html[data-bs-theme="dark"] .timeline-point .label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .timeline-point .value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .timeline-line {
    background: linear-gradient(90deg, #60a5fa, #4ade80) !important;
}

/* Historical note */
html[data-bs-theme="dark"] .historical-note {
    background: rgba(251, 191, 36, 0.15) !important;
    border-left-color: #fbbf24 !important;
    color: #fcd34d !important;
}

/* Back link */
html[data-bs-theme="dark"] .back-link {
    color: #60a5fa !important;
}

/* Export button */
html[data-bs-theme="dark"] .export-btn {
    background: #f5f5f7 !important;
    color: #1c1c1e !important;
}

html[data-bs-theme="dark"] .export-btn:hover {
    background: #e5e5e7 !important;
}

/* ==========================================================================
   INSTAGRAM MEDIA TYPE BADGES
   ========================================================================== */

html[data-bs-theme="dark"] .post-media-type.photo {
    background: rgba(60, 60, 67, 0.9) !important;
    color: #e5e5e7 !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .btn-video-analyze {
    background: linear-gradient(135deg, #7C3AED, #6366F1) !important;
}

html[data-bs-theme="dark"] .btn-video-analyze:hover {
    background: linear-gradient(135deg, #8B5CF6, #818CF8) !important;
}

/* Instagram chart cards */
html[data-bs-theme="dark"] .chart-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .chart-card h4 {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .sentiment-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .sentiment-card h4 {
    color: #98989d !important;
}

/* ==========================================================================
   TIKTOK DATA PAGE
   ========================================================================== */

/* TikTok brand gradient accent */
html[data-bs-theme="dark"] .quick-action.tiktok .icon {
    background: linear-gradient(135deg, rgba(37, 244, 238, 0.2), rgba(254, 44, 85, 0.2)) !important;
    color: #FE2C55 !important;
}

html[data-bs-theme="dark"] .activity-icon.tiktok {
    background: linear-gradient(135deg, rgba(37, 244, 238, 0.2), rgba(254, 44, 85, 0.2)) !important;
    color: #FE2C55 !important;
}

/* TikTok stat cards */
html[data-bs-theme="dark"] .tiktok-page .stat-card {
    background: #1c1c1e !important;
    border: 1px solid #3a3a3c !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card .stat-icon {
    opacity: 0.9;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card.videos .stat-icon {
    color: #FE2C55 !important;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card.users .stat-icon {
    color: #25F4EE !important;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card.likes .stat-icon {
    color: #FE2C55 !important;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card.views .stat-icon {
    color: #25F4EE !important;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card.videos .stat-value {
    color: #FE2C55 !important;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card.users .stat-value {
    color: #25F4EE !important;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card.likes .stat-value {
    color: #FE2C55 !important;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card.views .stat-value {
    color: #25F4EE !important;
}

html[data-bs-theme="dark"] .tiktok-page .stat-card .stat-label {
    color: #e5e5e7 !important;
}

/* TikTok pagination */
html[data-bs-theme="dark"] .tiktok-page .pagination button {
    background: #2c2c2e !important;
    border-color: #48484a !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination button:hover {
    background: #3a3a3c !important;
    border-color: #58585a !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination button.active {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    border-color: transparent !important;
    color: white !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination button:disabled {
    background: #1c1c1e !important;
    color: #58585a !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination span {
    color: #98989d !important;
}

/* TikTok filters */
html[data-bs-theme="dark"] .tiktok-page .filters-section {
    background: #1c1c1e !important;
    border: 1px solid #3a3a3c !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

html[data-bs-theme="dark"] .tiktok-page .filter-group label {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .filter-group input {
    background: #2c2c2e !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .filter-group input::placeholder {
    color: #6e6e73 !important;
}

html[data-bs-theme="dark"] .tiktok-page .filter-group input:focus {
    border-color: #FE2C55 !important;
    box-shadow: 0 0 0 2px rgba(254, 44, 85, 0.2) !important;
}

html[data-bs-theme="dark"] .tiktok-page .toggle-slider {
    background-color: #48484a !important;
}

html[data-bs-theme="dark"] .tiktok-page .toggle-label {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .btn-filter {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    border: none !important;
    color: white !important;
}

html[data-bs-theme="dark"] .tiktok-page .btn-filter:hover {
    background: linear-gradient(135deg, #1ed4ce, #e0274c) !important;
}

/* TikTok charts section */
html[data-bs-theme="dark"] .tiktok-page .charts-section {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .charts-section h3 {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .chart-card {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .tiktok-page .chart-card h4 {
    color: #98989d !important;
}

/* TikTok AI section */
html[data-bs-theme="dark"] .tiktok-page .ai-section {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-section h3 {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-tab {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-tab:hover {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-tab.active {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    border-color: transparent !important;
    color: white !important;
}

html[data-bs-theme="dark"] .tiktok-page .btn-ai {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    border: none !important;
    color: white !important;
}

html[data-bs-theme="dark"] .tiktok-page .btn-ai:hover {
    background: linear-gradient(135deg, #1ed4ce, #e0274c) !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-result {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-header {
    border-bottom-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-header h3 {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-controls {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-select {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-select:focus {
    border-color: #FE2C55 !important;
    box-shadow: 0 0 0 2px rgba(254, 44, 85, 0.2) !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-btn {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    border: none !important;
    color: white !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-btn:hover {
    background: linear-gradient(135deg, #1ed4ce, #e0274c) !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-btn:disabled {
    opacity: 0.6 !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-progress {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-progress-fill {
    background: linear-gradient(90deg, #25F4EE, #FE2C55) !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-status {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-panel {
    background: transparent !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-history {
    background: transparent !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-history-item {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-history-header {
    color: #98989d !important;
    border-bottom-color: #48484a !important;
}

html[data-bs-theme="dark"] .tiktok-page .ai-history-item div {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .btn-pdf {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    border: none !important;
    color: white !important;
}

html[data-bs-theme="dark"] .tiktok-page .btn-pdf:hover {
    background: linear-gradient(135deg, #1ed4ce, #e0274c) !important;
}

html[data-bs-theme="dark"] .tiktok-page .sentiment-stats {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .tiktok-page .sentiment-stat {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] .tiktok-page .sentiment-stat .value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .sentiment-stat .label {
    color: #98989d !important;
}

/* TikTok video cards */
html[data-bs-theme="dark"] .tiktok-page .video-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-card:hover {
    border-color: #48484a !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-header {
    background: #2c2c2e !important;
    border-bottom-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-card .username {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-card .description {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-card .meta,
html[data-bs-theme="dark"] .tiktok-page .video-meta {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-card .hashtag {
    color: #25F4EE !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-footer {
    background: #2c2c2e !important;
    border-top-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-stats {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-stats span {
    color: #f5f5f7 !important;
}

/* TikTok video thumbnail overlay */
html[data-bs-theme="dark"] .tiktok-page .video-thumbnail {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-duration {
    background: rgba(0, 0, 0, 0.8) !important;
    color: #f5f5f7 !important;
}

/* TikTok music info */
html[data-bs-theme="dark"] .tiktok-page .music-info {
    background: #3a3a3c !important;
    color: #c7c7cc !important;
}

html[data-bs-theme="dark"] .tiktok-page .music-info svg {
    color: #FE2C55 !important;
}

/* TikTok pagination */
html[data-bs-theme="dark"] .tiktok-page .pagination-btn,
html[data-bs-theme="dark"] .tiktok-page .page-btn {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination-btn:hover,
html[data-bs-theme="dark"] .tiktok-page .page-btn:hover {
    background: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination-btn.active,
html[data-bs-theme="dark"] .tiktok-page .page-btn.active {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    border-color: transparent !important;
    color: white !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination span {
    color: #98989d !important;
}

/* TikTok analyze button */
html[data-bs-theme="dark"] .tiktok-page .btn-video-analyze {
    background: linear-gradient(135deg, #7C3AED, #6366F1) !important;
}

html[data-bs-theme="dark"] .tiktok-page .btn-video-analyze:hover {
    background: linear-gradient(135deg, #8B5CF6, #818CF8) !important;
}

/* TikTok empty state */
html[data-bs-theme="dark"] .tiktok-page .empty-state {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .empty-state-title {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .empty-state-text {
    color: #98989d !important;
}

/* TikTok sentiment cards */
html[data-bs-theme="dark"] .tiktok-page .sentiment-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .sentiment-card h4 {
    color: #98989d !important;
}

/* TikTok loading state */
html[data-bs-theme="dark"] .tiktok-page .loading {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tiktok-page .loading-spinner {
    border-color: #3a3a3c !important;
    border-top-color: #FE2C55 !important;
}

/* Platform button for TikTok */
html[data-bs-theme="dark"] .platform-btn.active.tiktok {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    border-color: transparent !important;
    color: white !important;
}

/* TikTok folder icon in Salvataggi */
html[data-bs-theme="dark"] .folder-icon.tiktok {
    background: linear-gradient(135deg, rgba(37, 244, 238, 0.2), rgba(254, 44, 85, 0.2)) !important;
}

html[data-bs-theme="dark"] .stat-icon.tiktok {
    background: linear-gradient(135deg, #25F4EE, #FE2C55) !important;
    color: white !important;
}

/* TikTok username link */
html[data-bs-theme="dark"] .tiktok-page .username-link {
    color: #FE2C55 !important;
}
html[data-bs-theme="dark"] .tiktok-page .username-link:hover {
    color: #25F4EE !important;
}

/* TikTok User Profile Page */
html[data-bs-theme="dark"] .tiktok-page .user-header {
    background: linear-gradient(135deg, #FE2C55 0%, #25F4EE 100%) !important;
}

html[data-bs-theme="dark"] .tiktok-page .kpi-card {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .kpi-label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tiktok-page .kpi-value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .top-item {
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .top-item-name {
    color: #FE2C55 !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-row:hover {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .tiktok-page .video-desc {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .fetch-status {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .fetch-status .status-text {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tiktok-page .fetch-status.completed {
    background: rgba(34, 197, 94, 0.1) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

html[data-bs-theme="dark"] .tiktok-page .fetch-status.error {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination-controls button {
    background: #2c2c2e !important;
    border-color: #48484a !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination-controls button:hover:not(:disabled) {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination-controls button:disabled {
    opacity: 0.4 !important;
}

html[data-bs-theme="dark"] .tiktok-page .pagination-controls span {
    color: #98989d !important;
}

/* ===== TikTok User Page - Chart.js Dark Mode ===== */
html[data-bs-theme="dark"] .chart-container {
    background: transparent !important;
}

/* Chart.js global text colors - handled via JavaScript */
html[data-bs-theme="dark"] .card-title {
    color: #f5f5f7 !important;
}

/* Sentiment Analysis section */
html[data-bs-theme="dark"] #sentimentCharts h6 {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] #sentimentStats {
    color: #98989d !important;
}

html[data-bs-theme="dark"] #sentimentNoData {
    color: #98989d !important;
}

html[data-bs-theme="dark"] #sentimentProgressText {
    color: #98989d !important;
}

/* AI Analysis card */
html[data-bs-theme="dark"] #aiAnalysisCard .card-body {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] #aiResult {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] #aiResult .alert {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] #aiHistoryList .card {
    background: #3a3a3c !important;
    border-color: #48484a !important;
}

html[data-bs-theme="dark"] #aiHistoryList .card-body {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] #aiHistoryList .badge {
    background: #48484a !important;
}

/* TikTok user page specific */
html[data-bs-theme="dark"] .tiktok-user-page .kpi-label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .tiktok-user-page .top-item-name {
    color: #FE2C55 !important;
}

html[data-bs-theme="dark"] .tiktok-user-page .table {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .tiktok-user-page .table thead th {
    color: #98989d !important;
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-user-page .table tbody td {
    border-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tiktok-user-page .video-row:hover {
    background: #3a3a3c !important;
}

/* Form selects in dark mode */
html[data-bs-theme="dark"] .form-select {
    background-color: #3a3a3c !important;
    border-color: #48484a !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .form-select:focus {
    border-color: #FE2C55 !important;
    box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.25) !important;
}

/* Progress bar */
html[data-bs-theme="dark"] .progress {
    background-color: #3a3a3c !important;
}

/* TikTok User Page - Posts Grid Dark Mode */
html[data-bs-theme="dark"] .post-card {
    background: #2c2c2e !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

html[data-bs-theme="dark"] .post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}

html[data-bs-theme="dark"] .post-username {
    color: #FE2C55 !important;
}

html[data-bs-theme="dark"] .post-date {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .post-caption {
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .post-stats {
    border-top-color: #3a3a3c !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .post-music {
    background: #3a3a3c !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .videos-pagination button {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .videos-pagination button:hover:not(:disabled) {
    border-color: #FE2C55 !important;
    color: #FE2C55 !important;
}

/* ===== ADMIN PANEL - SERVER STATUS ===== */
html[data-bs-theme="dark"] .metric-card {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .metric-title {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .metric-value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .metric-subvalue {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .progress-bar {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .service-status {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .chart-btn {
    background: #2c2c2e !important;
    border-color: #3a3a3c !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .chart-btn:hover {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .chart-btn.active {
    background: #f5f5f7 !important;
    color: #1c1c1e !important;
    border-color: #f5f5f7 !important;
}

/* ===== ADMIN PANEL - USER STORAGE ===== */
html[data-bs-theme="dark"] .user-accordion {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .user-accordion-header:hover {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .user-accordion-header.expanded {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .user-storage-badge {
    background: #3a3a3c !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .collection-table th {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .collection-table td {
    border-top-color: #3a3a3c !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .expand-icon {
    color: #98989d !important;
}

/* ===== ADMIN PANEL - USER DETAILS MODAL ===== */
html[data-bs-theme="dark"] #userDetailsHeader {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .detail-tab {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .detail-tab:hover {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .detail-tab.active {
    background: #f5f5f7 !important;
    color: #1c1c1e !important;
}

html[data-bs-theme="dark"] .detail-tabs {
    border-bottom-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .tab-badge {
    background: #3a3a3c !important;
    color: #98989d !important;
}

html[data-bs-theme="dark"] .detail-tab.active .tab-badge {
    background: rgba(0,0,0,0.2) !important;
    color: #1c1c1e !important;
}

html[data-bs-theme="dark"] .session-item {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .session-info {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .session-info .session-date {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .search-item {
    border-bottom-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .search-query {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .search-meta {
    color: #98989d !important;
}

/* ===== ADMIN PANEL UNIFIED DASHBOARD ===== */
html[data-bs-theme="dark"] .admin-container {
    background: #1c1c1e;
}

html[data-bs-theme="dark"] .metric-card,
html[data-bs-theme="dark"] .card {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .metric-label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .metric-value {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .metric-sub {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .card-header {
    border-bottom-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .card-header h3 {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .mini-table th {
    background: #3a3a3c !important;
    color: #98989d !important;
    border-bottom-color: #48484a !important;
}

html[data-bs-theme="dark"] .mini-table td {
    color: #e5e5e7 !important;
    border-bottom-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .mini-table tr:hover {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .progress-bar {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .btn-secondary {
    background: #3a3a3c !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .btn-secondary:hover {
    background: #48484a !important;
}

html[data-bs-theme="dark"] .modal {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .modal h3 {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .form-group label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .form-group input,
html[data-bs-theme="dark"] .form-group select {
    background: #3a3a3c !important;
    border-color: #48484a !important;
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .detail-panel {
    background: #2c2c2e !important;
}

html[data-bs-theme="dark"] .detail-header {
    border-bottom-color: #3a3a3c !important;
}

html[data-bs-theme="dark"] .detail-section h4 {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .stat-box {
    background: #3a3a3c !important;
}

html[data-bs-theme="dark"] .stat-box .num {
    color: #f5f5f7 !important;
}

html[data-bs-theme="dark"] .stat-box .label {
    color: #98989d !important;
}

html[data-bs-theme="dark"] .session-item {
    background: #3a3a3c !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .search-item {
    border-bottom-color: #3a3a3c !important;
    color: #e5e5e7 !important;
}

html[data-bs-theme="dark"] .toggle-row {
    background: transparent !important;
    border-top-color: transparent !important;
}

html[data-bs-theme="dark"] .form-switch-custom input:checked ~ .switch-label {
    color: #fbbf24 !important;
}

html[data-bs-theme="dark"] .empty-state {
    color: #636366 !important;
}
