/* Theme Styles - Dark theme and theme-related styling */

/* Dark theme styles */
body.dark-theme {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

body.dark-theme .container {
    background: #2c3e50;
    color: #ecf0f1;
}

body.dark-theme .add-medication,
body.dark-theme .export-import-section {
    background: #34495e;
    border-color: #495057;
}

body.dark-theme .accessibility-bar {
    background: #34495e;
    border-color: #495057;
    color: #ecf0f1;
}

body.dark-theme .medication-card {
    background: #34495e;
    border-color: #495057;
    color: #ecf0f1;
}

body.dark-theme .form-group input,
body.dark-theme .form-group textarea,
body.dark-theme .form-group select,
body.dark-theme .search-input {
    background: #495057;
    border-color: #6c757d;
    color: #ecf0f1;
}

body.dark-theme .form-group input::placeholder,
body.dark-theme .form-group textarea::placeholder,
body.dark-theme .search-input::placeholder {
    color: #adb5bd;
}

body.dark-theme .stat-card {
    background: #34495e;
    color: #ecf0f1;
    border-left-color: #667eea;
}

body.dark-theme .modal-content {
    background: #34495e;
    color: #ecf0f1;
}

body.dark-theme .modal-header {
    border-bottom-color: #495057;
}

body.dark-theme .modal-actions {
    border-top-color: #495057;
}

body.dark-theme .help-content h4 {
    color: #ecf0f1;
}

body.dark-theme .theme-toggle {
    border-color: #ecf0f1;
    color: #ecf0f1;
}

body.dark-theme .theme-toggle:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

body.dark-theme .accessibility-btn {
    background: #495057;
    border-color: #6c757d;
    color: #ecf0f1;
}

body.dark-theme .accessibility-btn:hover {
    background: #6c757d;
}

body.dark-theme .accessibility-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

body.dark-theme .time-header.morning-header {
    background: linear-gradient(135deg, #3e2723 0%, #5d4037 100%);
    color: #ffab91;
}

body.dark-theme .time-header.midday-header {
    background: linear-gradient(135deg, #1a237e 0%, #303f9f 100%);
    color: #90caf9;
}

body.dark-theme .time-header.evening-header {
    background: linear-gradient(135deg, #4a148c 0%, #7b1fa2 100%);
    color: #ce93d8;
}

body.dark-theme .reminder-section {
    background: #3e2723;
    border-color: #5d4037;
}

body.dark-theme .reminder-text {
    color: #ffab91;
}

body.dark-theme .next-dose {
    background: #1b5e20;
    border-left-color: #4caf50;
}

body.dark-theme .current-dose {
    background: #3e2723;
    border-left-color: #ff9800;
}

body.dark-theme .dose-time,
body.dark-theme .dose-medication {
    color: #c8e6c9;
}

body.dark-theme .empty-state {
    color: #adb5bd;
}

body.dark-theme .info-label {
    color: #adb5bd;
}

body.dark-theme .info-value {
    color: #ecf0f1;
}

body.dark-theme .medication-name {
    color: #ecf0f1;
    border-bottom-color: #667eea;
}

body.dark-theme .stat-number {
    color: #ecf0f1;
}

body.dark-theme .stat-label {
    color: #adb5bd;
}

/* Dark theme form focus states */
body.dark-theme .form-group input:focus,
body.dark-theme .form-group textarea:focus,
body.dark-theme .form-group select:focus,
body.dark-theme .search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Dark theme button styles */
body.dark-theme .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-theme .export-btn,
body.dark-theme .import-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

body.dark-theme .delete-btn {
    background: #dc3545;
}

body.dark-theme .save-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
}

body.dark-theme .cancel-btn {
    background: #6c757d;
}

/* Dark theme medication tags */
body.dark-theme .dosage {
    background: #1e3a8a;
    color: #93c5fd;
}

body.dark-theme .dosage:hover {
    background: #1e40af;
}

body.dark-theme .amount {
    background: #581c87;
    color: #d8b4fe;
}

body.dark-theme .amount:hover {
    background: #6b21a8;
}

body.dark-theme .pill-count {
    background: #14532d;
    color: #86efac;
}

body.dark-theme .pill-count:hover {
    background: #166534;
}

body.dark-theme .medication-time {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

body.dark-theme .medication-time:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

/* Dark theme input styles */
body.dark-theme .dosage-input {
    background: #495057;
    border-color: #93c5fd;
    color: #93c5fd;
}

body.dark-theme .pill-count-input {
    background: #495057;
    border-color: #86efac;
    color: #86efac;
}

body.dark-theme .time-input-group input {
    background: #495057;
    border-color: #6c757d;
    color: #ecf0f1;
}

body.dark-theme .time-input {
    background: #495057;
    border-color: #6c757d;
    color: #ecf0f1;
}

/* Dark theme notification styles */
body.dark-theme .notification {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.dark-theme .notification.warning {
    background: #f59e0b;
    color: #1f2937;
}

/* Dark theme pill image */
body.dark-theme .pill-image {
    border-color: #6c757d;
}

/* Dark theme close button */
body.dark-theme .close-btn {
    color: #adb5bd;
}

body.dark-theme .close-btn:hover {
    background-color: #495057;
    color: #dc3545;
}

/* Theme transition effects */
body {
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    transition: background 0.3s ease, color 0.3s ease;
}

.medication-card,
.stat-card,
.modal-content {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.form-group input,
.form-group textarea,
.form-group select,
.search-input {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Theme toggle button specific styles */
.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.theme-toggle:hover::before {
    left: 100%;
}

/* Custom scrollbars for dark theme */
body.dark-theme ::-webkit-scrollbar {
    width: 8px;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #495057;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 4px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Firefox scrollbar for dark theme */
body.dark-theme {
    scrollbar-width: thin;
    scrollbar-color: #6c757d #495057;
}

/* Selection colors for dark theme */
body.dark-theme ::selection {
    background: #667eea;
    color: white;
}

body.dark-theme ::-moz-selection {
    background: #667eea;
    color: white;
}

/* Dark theme accessibility improvements */
body.dark-theme .skip-link {
    background: #667eea;
    color: white;
}

body.dark-theme .skip-link:focus {
    background: #5a67d8;
}

/* Auto theme detection support */
@media (prefers-color-scheme: dark) {
    :root {
        --default-bg: #2c3e50;
        --default-text: #ecf0f1;
        --default-border: #495057;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --default-bg: white;
        --default-text: #212529;
        --default-border: #e9ecef;
    }
}

/* High contrast mode overrides for dark theme */
body.dark-theme.high-contrast {
    background: black !important;
}

body.dark-theme.high-contrast .container {
    background: black !important;
    color: white !important;
}

/* Reduced motion in dark theme */
body.dark-theme.reduced-motion * {
    transition: none !important;
}

/* Print styles for dark theme */
@media print {
    body.dark-theme {
        background: white !important;
        color: black !important;
    }
    
    body.dark-theme .container {
        background: white !important;
        color: black !important;
    }
    
    body.dark-theme .medication-card,
    body.dark-theme .stat-card {
        background: white !important;
        color: black !important;
        border: 1px solid black !important;
    }
}
