/* Dark Mode Styles with High Specificity */

:root {
    /* Light mode colors (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f3f4f6;
    --bg-card: #ffffff;
    --bg-sidebar: #1e40af;
    --bg-sidebar-gradient-start: #1e40af;
    --bg-sidebar-gradient-end: #1d4ed8;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    --text-on-sidebar: #ffffff;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: #eef2ff;

    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --surface-hover: #f3f4f6;

    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: #0f172a !important;
    --bg-secondary: #1e293b !important;
    --bg-tertiary: #334155 !important;
    --bg-card: #1e293b !important;
    --bg-sidebar: #0c1220 !important;
    --bg-sidebar-gradient-start: #0c1220 !important;
    --bg-sidebar-gradient-end: #1e293b !important;

    --text-primary: #f1f5f9 !important;
    --text-secondary: #cbd5e1 !important;
    --text-tertiary: #94a3b8 !important;
    --text-inverse: #0f172a !important;
    --text-on-sidebar: #f1f5f9 !important;

    --border-color: #334155 !important;
    --border-light: #475569 !important;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5) !important;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.5) !important;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7), 0 4px 6px -2px rgba(0, 0, 0, 0.6) !important;

    --accent-primary: #818cf8 !important;
    --accent-hover: #6366f1 !important;
    --accent-light: #312e81 !important;

    --primary-color: #818cf8 !important;
    --primary-hover: #6366f1 !important;
    --surface-hover: #334155 !important;

    --success: #34d399 !important;
    --success-light: #064e3b !important;
    --warning: #fbbf24 !important;
    --warning-light: #78350f !important;
    --error: #f87171 !important;
    --error-light: #7f1d1d !important;
    --info: #60a5fa !important;
    --info-light: #1e3a8a !important;
}

/* Force dark mode styles with !important */
[data-theme="dark"] body {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .main-content {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #0c1220 0%, #1e293b 100%) !important;
    border-right: 1px solid #334155 !important;
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .channel-card,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .card,
[data-theme="dark"] .message-card,
[data-theme="dark"] .settings-card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.5) !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .channel-card:hover,
[data-theme="dark"] .summary-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.5) !important;
}

/* Typography - ensure all text is visible */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] label,
[data-theme="dark"] li {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .text-secondary,
[data-theme="dark"] .meta,
[data-theme="dark"] .subtitle,
[data-theme="dark"] small {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .text-tertiary,
[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

/* Top bar */
[data-theme="dark"] .top-bar {
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

/* Buttons */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] button.primary {
    background: #818cf8 !important;
    color: #0f172a !important;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] button.primary:hover {
    background: #6366f1 !important;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] button.secondary {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

/* Inputs */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #94a3b8 !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: #818cf8 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.3) !important;
}

/* Tables */
[data-theme="dark"] table {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] thead {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] tbody tr {
    border-bottom: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] tbody tr:hover {
    background: #334155 !important;
}

[data-theme="dark"] td,
[data-theme="dark"] th {
    color: #f1f5f9 !important;
}

/* Navigation */
[data-theme="dark"] nav,
[data-theme="dark"] .navbar {
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
}

[data-theme="dark"] .nav-link {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: #818cf8 !important;
    background-color: rgba(129, 140, 248, 0.1) !important;
}

[data-theme="dark"] .nav-item.active .nav-link,
[data-theme="dark"] .nav-item.active {
    color: #818cf8 !important;
    background-color: rgba(129, 140, 248, 0.15) !important;
}

/* Sidebar specific */
[data-theme="dark"] .sidebar-header {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .logo,
[data-theme="dark"] .logo span {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .user-info,
[data-theme="dark"] .user-name,
[data-theme="dark"] .user-email {
    color: #f1f5f9 !important;
}

/* Modals */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .modal {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .modal-header {
    border-bottom: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

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

/* Alerts */
[data-theme="dark"] .alert-success {
    background: #064e3b !important;
    color: #34d399 !important;
    border-color: #34d399 !important;
}

[data-theme="dark"] .alert-warning {
    background: #78350f !important;
    color: #fbbf24 !important;
    border-color: #fbbf24 !important;
}

[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-danger {
    background: #7f1d1d !important;
    color: #f87171 !important;
    border-color: #f87171 !important;
}

[data-theme="dark"] .alert-info {
    background: #1e3a8a !important;
    color: #60a5fa !important;
    border-color: #60a5fa !important;
}

/* Badges */
[data-theme="dark"] .badge {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .badge-primary {
    background: #818cf8 !important;
    color: #0f172a !important;
}

[data-theme="dark"] .badge-success {
    background: #34d399 !important;
    color: #0f172a !important;
}

[data-theme="dark"] .badge-warning {
    background: #fbbf24 !important;
    color: #0f172a !important;
}

[data-theme="dark"] .badge-error,
[data-theme="dark"] .badge-danger {
    background: #f87171 !important;
    color: #0f172a !important;
}

/* Scrollbars (webkit browsers) */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1e293b !important;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155 !important;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569 !important;
}

/* Code blocks */
[data-theme="dark"] code,
[data-theme="dark"] pre {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
}

/* Dropdowns */
[data-theme="dark"] .dropdown-menu {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.7), 0 4px 6px -2px rgba(0, 0, 0, 0.6) !important;
}

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

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

/* Tooltips */
[data-theme="dark"] .tooltip {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.5) !important;
}

/* Loading states */
[data-theme="dark"] .skeleton,
[data-theme="dark"] .loading {
    background: linear-gradient(
        90deg,
        #334155 25%,
        #475569 50%,
        #334155 75%
    ) !important;
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Stats and metrics - ensure visibility */
[data-theme="dark"] .stat-value,
[data-theme="dark"] .metric-value,
[data-theme="dark"] .count {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .stat-label,
[data-theme="dark"] .metric-label {
    color: #cbd5e1 !important;
}

/* Links */
[data-theme="dark"] a {
    color: #818cf8 !important;
}

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

/* Message content */
[data-theme="dark"] .message-content,
[data-theme="dark"] .message-text,
[data-theme="dark"] .message-body {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .message-meta,
[data-theme="dark"] .message-time,
[data-theme="dark"] .message-author {
    color: #cbd5e1 !important;
}

/* Timeline items */
[data-theme="dark"] .timeline-item {
    border-left: 2px solid #334155 !important;
}

[data-theme="dark"] .timeline-item:hover {
    background: #334155 !important;
}

/* Ensure form labels are visible */
[data-theme="dark"] .form-label,
[data-theme="dark"] .setting-title,
[data-theme="dark"] .setting-description {
    color: #f1f5f9 !important;
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* Prevent transition on page load */
.no-transition,
.no-transition * {
    transition: none !important;
}

/* Button visibility - Light mode */
.btn-primary {
    background: #6366f1 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border: none !important;
}

.btn-primary:hover {
    background: #4f46e5 !important;
}

/* Button visibility - Dark mode */
[data-theme="dark"] .btn-primary {
    background: #818cf8 !important;
    color: #0f172a !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .btn-primary:hover {
    background: #a5b4fc !important;
}

[data-theme="dark"] .btn-secondary {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
}

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

/* Team Management Page - Dark Mode */
[data-theme="dark"] .team-management-content {
    background: transparent !important;
}

[data-theme="dark"] .page-header {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .page-header h1 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .page-header p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .success-message {
    background: #064e3b !important;
    border-color: #34d399 !important;
    color: #34d399 !important;
}

[data-theme="dark"] .team-selection-form {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .bulk-actions button {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .bulk-actions button:hover {
    background: #475569 !important;
    border-color: #64748b !important;
}

[data-theme="dark"] .team-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .team-card.selected {
    border-color: #818cf8 !important;
    background: #312e81 !important;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3) !important;
}

[data-theme="dark"] .team-info h3,
[data-theme="dark"] .team-card h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .team-description {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .team-stat {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .team-stat i {
    color: #94a3b8 !important;
}

[data-theme="dark"] .channels-preview {
    border-top-color: #334155 !important;
}

[data-theme="dark"] .channels-preview h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .channel-tag {
    background: #334155 !important;
    color: #f1f5f9 !important;
    border-color: #475569 !important;
}

[data-theme="dark"] .team-card.selected .channel-tag {
    background: #4c1d95 !important;
    color: #c7d2fe !important;
    border-color: #6d28d9 !important;
}

[data-theme="dark"] .section-divider {
    background: linear-gradient(90deg, #334155 0%, #475569 50%, #334155 100%) !important;
}

[data-theme="dark"] .chat-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .chat-card.selected {
    border-color: #34d399 !important;
    background: #064e3b !important;
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3) !important;
}

[data-theme="dark"] .chat-card:hover {
    border-color: #475569 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .chat-card.selected:hover {
    border-color: #10b981 !important;
}

[data-theme="dark"] .chat-info h4,
[data-theme="dark"] .chat-card h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .chat-description {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .chat-meta {
    color: #94a3b8 !important;
}

[data-theme="dark"] .chat-meta i {
    color: #94a3b8 !important;
}

[data-theme="dark"] .sync-btn {
    background: #10b981 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .sync-btn:hover {
    background: #059669 !important;
}

[data-theme="dark"] .sync-btn:disabled {
    background: #475569 !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .sync-status {
    background: #1e3a8a !important;
    border-color: #60a5fa !important;
    color: #dbeafe !important;
}

[data-theme="dark"] .sync-status.success {
    background: #064e3b !important;
    border-color: #10b981 !important;
    color: #d1fae5 !important;
}

[data-theme="dark"] .sync-status.error {
    background: #7f1d1d !important;
    border-color: #ef4444 !important;
    color: #fee2e2 !important;
}

/* Summaries Page - Dark Mode Specific Styles */
[data-theme="dark"] .summary-controls {
    background: transparent !important;
}

[data-theme="dark"] .date-preset {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .date-preset:hover {
    border-color: #818cf8 !important;
    color: #818cf8 !important;
}

[data-theme="dark"] .date-preset.active {
    background: #818cf8 !important;
    border-color: #818cf8 !important;
    color: #0f172a !important;
}

[data-theme="dark"] .filter-select {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .filter-select:hover {
    border-color: #818cf8 !important;
}

[data-theme="dark"] .filter-select option {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .date-input {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .date-separator {
    color: #cbd5e1 !important;
}

/* Stats Cards */
[data-theme="dark"] .stat-number {
    color: #f1f5f9 !important;
}

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

[data-theme="dark"] .stat-change {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .stat-change.positive {
    color: #34d399 !important;
}

[data-theme="dark"] .stat-change.negative {
    color: #f87171 !important;
}

/* AI Summary Section */
[data-theme="dark"] .ai-summary-section {
    background: transparent !important;
}

[data-theme="dark"] .ai-summary-card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .ai-summary-header h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .ai-badge {
    background: #312e81 !important;
    color: #c7d2fe !important;
}

[data-theme="dark"] .generate-ai-summary-btn {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%) !important;
    color: #0f172a !important;
}

[data-theme="dark"] .generate-ai-summary-btn:hover {
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%) !important;
}

[data-theme="dark"] .ai-summary-placeholder,
[data-theme="dark"] .ai-loading,
[data-theme="dark"] .ai-error,
[data-theme="dark"] .ai-summary-result {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ai-summary-result strong {
    color: #f1f5f9 !important;
}

/* Timeline Section */
[data-theme="dark"] .timeline-card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

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

[data-theme="dark"] .view-more-link {
    color: #818cf8 !important;
}

[data-theme="dark"] .view-more-link:hover {
    color: #a5b4fc !important;
}

[data-theme="dark"] .timeline-list .timeline-item {
    border-left-color: #334155 !important;
}

[data-theme="dark"] .timeline-item .message-snippet,
[data-theme="dark"] .timeline-item .message-preview {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .timeline-item .channel-name,
[data-theme="dark"] .timeline-item .conversation-name {
    color: #818cf8 !important;
}

[data-theme="dark"] .timeline-item .timestamp,
[data-theme="dark"] .timeline-item .time {
    color: #94a3b8 !important;
}

/* Summary Cards */
[data-theme="dark"] .summary-card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .summary-card:hover {
    border-color: #475569 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .summary-card-header h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .summary-card-body p,
[data-theme="dark"] .summary-card-body li {
    color: #cbd5e1 !important;
}

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

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

[data-theme="dark"] .top-contributor {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .action-btn.primary {
    background: #818cf8 !important;
    color: #0f172a !important;
}

[data-theme="dark"] .action-btn.primary:hover {
    background: #a5b4fc !important;
}

/* Channel Members Section */
[data-theme="dark"] .channel-member-card,
[data-theme="dark"] .channels-members-section .card {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
}

[data-theme="dark"] .channel-header h4,
[data-theme="dark"] .channel-info h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .channel-description {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .channel-stats span,
[data-theme="dark"] .member-count {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .membership-type {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .members-placeholder {
    color: #94a3b8 !important;
}

/* Section Headers */
[data-theme="dark"] .section-header {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .section-header h3 {
    color: #f1f5f9 !important;
}

/* No Data Messages */
[data-theme="dark"] .no-data-message {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .no-data-message h4 {
    color: #f1f5f9 !important;
}

/* Ensure all icons are visible */
[data-theme="dark"] i,
[data-theme="dark"] .fas,
[data-theme="dark"] .far,
[data-theme="dark"] .fab {
    color: #000 !important;
}

[data-theme="dark"] .stat-icon {
    color: #818cf8 !important;
}

/* Override inline styles for summaries page text visibility */
[data-theme="dark"] .summaries-content h1,
[data-theme="dark"] .summaries-content h2,
[data-theme="dark"] .summaries-content h3,
[data-theme="dark"] .summaries-content h5,
[data-theme="dark"] .summaries-content h6 {
    color: #ffffff !important;
}
[data-theme="dark"] .summaries-content h4{
    color: #000 !important;
}

[data-theme="dark"] .summaries-content p,
[data-theme="dark"] .summaries-content span,
[data-theme="dark"] .summaries-content div,
[data-theme="dark"] .summaries-content li {
    color: #000 !important;
}

[data-theme="dark"] .page-title {
    color: #f1f5f9 !important;
}

/* Modal overrides for dark mode */
[data-theme="dark"] .modal-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .modal-close {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .modal-close:hover {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .modal-section h3 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .modal-section p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .loading-details,
[data-theme="dark"] .conversation-info {
    color: #94a3b8 !important;
}

[data-theme="dark"] .error-details {
    color: #f87171 !important;
}

/* AI Summary Section - Override inline styles */
[data-theme="dark"] .ai-summary-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .ai-summary-placeholder {
    color: #94a3b8 !important;
}

[data-theme="dark"] .ai-summary-placeholder i {
    color: #64748b !important;
}

[data-theme="dark"] .ai-loading p,
[data-theme="dark"] .ai-loading strong {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ai-summary-result {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ai-summary-result h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .ai-summary-result p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ai-summary-result li {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ai-summary-meta {
    color: #94a3b8 !important;
}

[data-theme="dark"] .ai-error {
    color: #f87171 !important;
}

[data-theme="dark"] .ai-error p {
    color: #fecaca !important;
}

/* Loading and Error Indicators */
[data-theme="dark"] .loading-indicator {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .loading-indicator i {
    color: #818cf8 !important;
}

[data-theme="dark"] .error-indicator {
    color: #f87171 !important;
}

[data-theme="dark"] .error-indicator p {
    color: #fecaca !important;
}

/* Team filter notice */
[data-theme="dark"] .team-filter-notice {
    background: #1e3a8a !important;
    border-color: #60a5fa !important;
    color: #dbeafe !important;
}

[data-theme="dark"] .team-filter-notice a {
    color: #93c5fd !important;
}

/* Diagnostic messages */
[data-theme="dark"] details[open] > div {
    background: #1e293b !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] details summary {
    color: #818cf8 !important;
}

[data-theme="dark"] details p,
[data-theme="dark"] details li {
    color: #cbd5e1 !important;
}

[data-theme="dark"] details strong {
    color: #f1f5f9 !important;
}

/* Override ALL hardcoded light colors in summaries */
[data-theme="dark"] .summaries-content [style*="color: #111827"],
[data-theme="dark"] .summaries-content [style*="color: #374151"],
[data-theme="dark"] .summaries-content [style*="color: #1f2937"],
[data-theme="dark"] .summaries-content [style*="color: #6b7280"],
[data-theme="dark"] .summaries-content [style*="color: #6c757d"],
[data-theme="dark"] .summaries-content [style*="color: #495057"] {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .summaries-content [style*="color: #9ca3af"],
[data-theme="dark"] .summaries-content [style*="color: #d1d5db"],
[data-theme="dark"] .summaries-content [style*="color: #888"] {
    color: #94a3b8 !important;
}

[data-theme="dark"] .summaries-content [style*="color: #dc2626"],
[data-theme="dark"] .summaries-content [style*="color: #e74c3c"] {
    color: #f87171 !important;
}

[data-theme="dark"] .summaries-content [style*="color: #7f1d1d"] {
    color: #fecaca !important;
}

/* Fix background colors in summaries */
[data-theme="dark"] .summaries-content [style*="background: #f8f9fa"],
[data-theme="dark"] .summaries-content [style*="background: #e0f2fe"],
[data-theme="dark"] .summaries-content [style*="background-color: #f8f9fa"] {
    background: #1e293b !important;
}

[data-theme="dark"] .summaries-content [style*="background: #fef2f2"] {
    background: #7f1d1d !important;
}

/* Summary card highlights */
[data-theme="dark"] .summary-card-highlight,
[data-theme="dark"] .highlight-text {
    color: #f1f5f9 !important;
}

/* Conversation details */
[data-theme="dark"] .conversation-header,
[data-theme="dark"] .conversation-title {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .conversation-meta,
[data-theme="dark"] .conversation-subtitle {
    color: #94a3b8 !important;
}

/* Message items */
[data-theme="dark"] .message-item,
[data-theme="dark"] .message-row {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .message-author {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .message-timestamp {
    color: #94a3b8 !important;
}

/* Stats and counts */
[data-theme="dark"] .count-badge,
[data-theme="dark"] .stat-badge {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

/* Activity indicators */
[data-theme="dark"] .activity-high {
    color: #34d399 !important;
}

[data-theme="dark"] .activity-medium {
    color: #fbbf24 !important;
}

[data-theme="dark"] .activity-low {
    color: #94a3b8 !important;
}

/* Ensure white text is visible */
[data-theme="dark"] [style*="color: white"],
[data-theme="dark"] [style*="color: #fff"],
[data-theme="dark"] [style*="color: #ffffff"] {
    color: #f1f5f9 !important;
}
