/**
 * Dark Mode Styles for Email Header Analyzer
 */

[data-eha-theme="dark"] {
    --eha-primary: #3b82f6;
    --eha-primary-dark: #2563eb;
    --eha-success: #10b981;
    --eha-warning: #f59e0b;
    --eha-danger: #ef4444;
    --eha-info: #3b82f6;
    --eha-gray-50: #1f2937;
    --eha-gray-100: #374151;
    --eha-gray-200: #4b5563;
    --eha-gray-300: #6b7280;
    --eha-gray-400: #9ca3af;
    --eha-gray-500: #d1d5db;
    --eha-gray-600: #e5e7eb;
    --eha-gray-700: #f3f4f6;
    --eha-gray-800: #f9fafb;
    --eha-gray-900: #ffffff;
    --eha-white: #111827;
}

/* Auto theme based on system preference */
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] {
        --eha-primary: #3b82f6;
        --eha-primary-dark: #2563eb;
        --eha-success: #10b981;
        --eha-warning: #f59e0b;
        --eha-danger: #ef4444;
        --eha-info: #3b82f6;
        --eha-gray-50: #1f2937;
        --eha-gray-100: #374151;
        --eha-gray-200: #4b5563;
        --eha-gray-300: #6b7280;
        --eha-gray-400: #9ca3af;
        --eha-gray-500: #d1d5db;
        --eha-gray-600: #e5e7eb;
        --eha-gray-700: #f3f4f6;
        --eha-gray-800: #f9fafb;
        --eha-gray-900: #ffffff;
        --eha-white: #111827;
    }
}

/* Container Background */
[data-eha-theme="dark"] .eha-container,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-container {
        background-color: #111827;
    }
}

/* Card Styles */
[data-eha-theme="dark"] .eha-card,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-card {
        background-color: #1f2937;
        box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    }
}

/* Input Elements */
[data-eha-theme="dark"] .eha-textarea,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-textarea {
        background-color: #111827;
        border-color: #4b5563;
        color: #f9fafb;
    }

    [data-eha-theme="dark"] .eha-textarea::placeholder,
    [data-eha-theme="auto"] .eha-textarea::placeholder {
        color: #6b7280;
    }

    [data-eha-theme="dark"] .eha-textarea:focus,
    [data-eha-theme="auto"] .eha-textarea:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
}

/* File Upload */
[data-eha-theme="dark"] .eha-file-upload,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-file-upload {
        border-color: #4b5563;
    }

    [data-eha-theme="dark"] .eha-file-upload:hover,
    [data-eha-theme="auto"] .eha-file-upload:hover {
        border-color: #3b82f6;
        background-color: #1f2937;
    }

    [data-eha-theme="dark"] .eha-file-upload.dragover,
    [data-eha-theme="auto"] .eha-file-upload.dragover {
        background-color: rgba(59, 130, 246, 0.1);
    }
}

/* Buttons */
[data-eha-theme="dark"] .eha-btn-secondary,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-btn-secondary {
        background-color: #4b5563;
        color: #f9fafb;
    }

    [data-eha-theme="dark"] .eha-btn-secondary:hover,
    [data-eha-theme="auto"] .eha-btn-secondary:hover {
        background-color: #6b7280;
    }
}

/* Security Score */
[data-eha-theme="dark"] .eha-security-score,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-security-score {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    }
}

/* Alerts - Dark Mode */
[data-eha-theme="dark"] .eha-alert-success,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-alert-success {
        background-color: rgba(16, 185, 129, 0.15);
        color: #6ee7b7;
    }

    [data-eha-theme="dark"] .eha-alert-warning,
    [data-eha-theme="auto"] .eha-alert-warning {
        background-color: rgba(245, 158, 11, 0.15);
        color: #fcd34d;
    }

    [data-eha-theme="dark"] .eha-alert-danger,
    [data-eha-theme="auto"] .eha-alert-danger {
        background-color: rgba(239, 68, 68, 0.15);
        color: #fca5a5;
    }

    [data-eha-theme="dark"] .eha-alert-info,
    [data-eha-theme="auto"] .eha-alert-info {
        background-color: rgba(59, 130, 246, 0.15);
        color: #93c5fd;
    }
}

/* Collapsible */
[data-eha-theme="dark"] .eha-collapsible,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-collapsible {
        border-color: #4b5563;
    }

    [data-eha-theme="dark"] .eha-collapsible-header,
    [data-eha-theme="auto"] .eha-collapsible-header {
        background-color: #1f2937;
    }

    [data-eha-theme="dark"] .eha-collapsible-header:hover,
    [data-eha-theme="auto"] .eha-collapsible-header:hover {
        background-color: #374151;
    }
}

/* Table */
[data-eha-theme="dark"] .eha-table th,
[data-eha-theme="dark"] .eha-table td,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-table th,
    [data-eha-theme="auto"] .eha-table td {
        border-bottom-color: #4b5563;
    }

    [data-eha-theme="dark"] .eha-table th,
    [data-eha-theme="auto"] .eha-table th {
        background-color: #1f2937;
        color: #e5e7eb;
    }

    [data-eha-theme="dark"] .eha-table-striped tbody tr:nth-child(odd),
    [data-eha-theme="auto"] .eha-table-striped tbody tr:nth-child(odd) {
        background-color: #1f2937;
    }
}

/* Badge */
[data-eha-theme="dark"] .eha-badge-success,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-badge-success {
        background-color: rgba(16, 185, 129, 0.2);
        color: #6ee7b7;
    }

    [data-eha-theme="dark"] .eha-badge-warning,
    [data-eha-theme="auto"] .eha-badge-warning {
        background-color: rgba(245, 158, 11, 0.2);
        color: #fcd34d;
    }

    [data-eha-theme="dark"] .eha-badge-danger,
    [data-eha-theme="auto"] .eha-badge-danger {
        background-color: rgba(239, 68, 68, 0.2);
        color: #fca5a5;
    }

    [data-eha-theme="dark"] .eha-badge-info,
    [data-eha-theme="auto"] .eha-badge-info {
        background-color: rgba(59, 130, 246, 0.2);
        color: #93c5fd;
    }

    [data-eha-theme="dark"] .eha-badge-gray,
    [data-eha-theme="auto"] .eha-badge-gray {
        background-color: #4b5563;
        color: #e5e7eb;
    }
}

/* Timeline */
[data-eha-theme="dark"] .eha-timeline::before,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-timeline::before {
        background-color: #6b7280;
    }

    [data-eha-theme="dark"] .eha-timeline-marker,
    [data-eha-theme="auto"] .eha-timeline-marker {
        border-color: #111827;
    }

    [data-eha-theme="dark"] .eha-timeline-content,
    [data-eha-theme="auto"] .eha-timeline-content {
        background-color: #1f2937;
    }
}

/* Map Container */
[data-eha-theme="dark"] .eha-map-container,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-map-container {
        background-color: #374151;
    }
}

/* Progress Bar */
[data-eha-theme="dark"] .eha-progress,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-progress {
        background-color: #4b5563;
    }
}

/* Tabs */
[data-eha-theme="dark"] .eha-tabs,
@media (prefers-color-scheme: dark) {
    [data-eha-theme="auto"] .eha-tabs {
        border-bottom-color: #4b5563;
    }

    [data-eha-theme="dark"] .eha-tab:hover,
    [data-eha-theme="auto"] .eha-tab:hover {
        color: #f9fafb;
    }
}

/* Theme Toggle Button */
.eha-theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--eha-primary);
    color: var(--eha-white);
    border: none;
    box-shadow: var(--eha-shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
    z-index: 1000;
}

.eha-theme-toggle:hover {
    transform: scale(1.1);
    background-color: var(--eha-primary-dark);
}

@media (max-width: 768px) {
    .eha-theme-toggle {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
        font-size: 1rem;
    }
}
