/* Modern Dashboard Styles */
.dashboard-modern {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
}

/* Control Bar */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.quick-filters {
    display: flex;
    gap: 12px;
}

.modern-select {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.modern-select:hover {
    border-color: #6b7280;
}

.modern-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.advanced-toggle:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.advanced-toggle svg {
    width: 16px;
    height: 16px;
}

/* Advanced Panel */
.advanced-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 24px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.range-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.range-container span {
    font-size: 14px;
    font-weight: 500;
    color: #3b82f6;
    min-width: 40px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-range input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
}

.date-range span {
    color: #6b7280;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    gap: 12px;
}

.btn-secondary, .btn-primary {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

/* Dashboard Grid */
.dashboard-grid {
    display: block;
    width: 100%;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Metrics Row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.metric-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

/* Insights Section */
.insights-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.refresh-btn {
    padding: 8px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.insight-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.insight-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.insight-icon {
    font-size: 1.2rem;
}

.insight-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
}

.insight-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.insight-detail {
    font-size: 0.8rem;
    color: #64748b;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.charts-column {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 4px;
}

.chart-type-btn, .chart-period-btn {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.chart-type-btn:hover, .chart-period-btn:hover {
    background: #f3f4f6;
}

.chart-type-btn.active, .chart-period-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.chart-container {
    height: 300px;
    position: relative;
}

.chart-container canvas {
    max-height: 100%;
    width: 100%;
}

/* Conditions Section */
.conditions-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.last-updated {
    font-size: 0.8rem;
    color: #6b7280;
}

.conditions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.condition-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.condition-info {
    flex: 1;
}

.condition-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.condition-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e293b;
}

/* Hunting Outlook */
.hunting-outlook {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 16px;
    color: white;
}

.outlook-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
}

.outlook-icon {
    font-size: 1.2rem;
}

.outlook-content {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Filters Container */
.filters-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-modern {
        padding: 16px;
    }
    
    .control-bar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .quick-filters {
        justify-content: space-between;
    }
    
    .advanced-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .metrics-row {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
      .charts-section {
        grid-template-columns: 1fr;
    }
    
    .charts-column {
        gap: 16px;
    }
    
    .conditions-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .dashboard-title {
        font-size: 2rem;
    }
    
    .metrics-row {
        grid-template-columns: 1fr;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .metric-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   DARK THEME STYLES
   =============================== */

/* Dark Theme Variables */
body.dark-theme {
    --dark-bg-primary: #121212;
    --dark-bg-secondary: #1e1e1e;
    --dark-bg-tertiary: #2d2d2d;
    --dark-surface-1: #2c2c2c;
    --dark-surface-2: #383838;
    --dark-surface-3: #404040;
    --dark-text-primary: #ffffff;
    --dark-text-secondary: #b3b3b3;
    --dark-text-muted: #8a8a8a;
    --dark-border: #404040;
    --dark-border-light: #525252;
    --dark-primary: #66BB6A;
    --dark-primary-dark: #4CAF50;
    --dark-accent: #FFB74D;
}

/* Dashboard Container Dark Theme */
body.dark-theme .dashboard-modern {
    background: var(--dark-bg-primary);
    color: var(--dark-text-primary);
}

/* Control Bar Dark Theme - Direct Colors */
body.dark-theme .control-bar {
    background: #2c2c2c !important;
    border: 1px solid #404040 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Quick Filters Dark Theme - Direct Colors */
body.dark-theme .modern-select {
    background: #383838 !important;
    border: 1px solid #404040 !important;
    color: #ffffff !important;
}

body.dark-theme .modern-select:hover {
    border-color: #525252 !important;
}

body.dark-theme .modern-select:focus {
    border-color: #66BB6A !important;
    box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.2) !important;
}

body.dark-theme .modern-select option {
    background: #383838 !important;
    color: #ffffff !important;
}

/* Advanced Toggle Button Dark Theme */
body.dark-theme .advanced-toggle {
    background: #383838 !important;
    color: #ffffff !important;
    border: 1px solid #404040 !important;
}

body.dark-theme .advanced-toggle:hover {
    background: #404040 !important;
}

/* Advanced Panel Dark Theme */
body.dark-theme .advanced-panel {
    background: var(--dark-surface-1);
    border: 1px solid var(--dark-border);
}

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

body.dark-theme .filter-group input[type="range"] {
    background: var(--dark-surface-2);
}

body.dark-theme .filter-group input[type="date"] {
    background: var(--dark-surface-2);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
}

body.dark-theme .filter-group input[type="date"]:focus {
    border-color: var(--dark-primary);
    box-shadow: 0 0 0 2px rgba(102, 187, 106, 0.2);
}

/* Filter Actions Buttons Dark Theme */
body.dark-theme .btn-secondary {
    background: var(--dark-surface-2);
    color: var(--dark-text-primary);
    border: 1px solid var(--dark-border);
}

body.dark-theme .btn-secondary:hover {
    background: var(--dark-surface-3);
    border-color: var(--dark-border-light);
}

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

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

/* Filters Container Dark Theme */
body.dark-theme .filters-container {
    background: #2c2c2c !important;
    border: 1px solid #404040 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Dashboard Grid Dark Theme */
body.dark-theme .dashboard-grid {
    color: var(--dark-text-primary);
}

/* Charts Section Dark Theme */
body.dark-theme .charts-section {
    background: transparent;
}

body.dark-theme .charts-column {
    background: transparent;
}

/* Chart Container Dark Theme */
body.dark-theme .chart-container {
    background: var(--dark-surface-1) !important;
    border: 1px solid var(--dark-border) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Chart Card Dark Theme */
body.dark-theme .chart-card {
    background: #2c2c2c !important;
    border: 1px solid #404040 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    border-radius: 12px;
    padding: 24px;
}

/* Chart Header Dark Theme */
body.dark-theme .chart-header {
    color: #ffffff !important;
}

body.dark-theme .chart-header h4 {
    color: #ffffff !important;
}

body.dark-theme .chart-header {
    border-bottom: 1px solid var(--dark-border);
}

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

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

/* Stats Cards Dark Theme */
body.dark-theme .stats-overview {
    background: transparent;
}

body.dark-theme .stat-card {
    background: var(--dark-surface-1);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
}

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

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

/* Insights Grid Dark Theme */
body.dark-theme .insights-grid {
    background: transparent;
}

body.dark-theme .insight-card {
    background: var(--dark-surface-1);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
}

body.dark-theme .insight-header {
    border-bottom: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
}

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

/* Activity Timeline Dark Theme */
body.dark-theme .activity-timeline {
    background: var(--dark-surface-1);
    border: 1px solid var(--dark-border);
}

body.dark-theme .timeline-item {
    border-bottom: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
}

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

/* Species Detection Cards Dark Theme */
body.dark-theme .species-grid {
    background: transparent;
}

body.dark-theme .species-card {
    background: var(--dark-surface-1);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
}

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

body.dark-theme .species-count {
    color: var(--dark-primary);
}

body.dark-theme .confidence-score {
    color: var(--dark-accent);
}

/* Weather Information Dark Theme */
body.dark-theme .weather-info {
    background: var(--dark-surface-1);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
}

body.dark-theme .weather-item {
    border-bottom: 1px solid var(--dark-border);
}

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

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

/* Range Input Dark Theme */
body.dark-theme input[type="range"] {
    background: var(--dark-surface-2);
    border-radius: 5px;
}

body.dark-theme input[type="range"]::-webkit-slider-thumb {
    background: var(--dark-primary);
    border: 1px solid var(--dark-border);
}

body.dark-theme input[type="range"]::-moz-range-thumb {
    background: var(--dark-primary);
    border: 1px solid var(--dark-border);
}

/* Confidence Display Dark Theme */
body.dark-theme #confidence-display {
    color: var(--dark-primary);
    font-weight: bold;
}

/* Date Range Inputs Dark Theme */
body.dark-theme .date-range input {
    background: var(--dark-surface-2);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-primary);
}

body.dark-theme .date-range span {
    color: var(--dark-text-secondary);
}

/* Canvas Dark Theme - Better Chart Backgrounds */
body.dark-theme canvas {
    background-color: var(--dark-surface-2) !important;
    border-radius: 8px;
}

/* Chart.js tooltip dark theme fix */
body.dark-theme .chartjs-tooltip {
    background: var(--dark-surface-2) !important;
    color: var(--dark-text-primary) !important;
    border: 1px solid var(--dark-border) !important;
}

/* Ensure proper text visibility on charts */
body.dark-theme .chart-container .chartjs-render-monitor {
    background: var(--dark-surface-2) !important;
}

/* ===============================
   DASHBOARD FILTERS SECTION DARK THEME
   =============================== */

/* Dashboard Filters Section - The white filter area at the top */
body.dark-theme .dashboard-filters-section {
    background: #2c2c2c !important;
    border: 1px solid #404040 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* Filter Group Labels */
body.dark-theme .dashboard-filters-section .filter-group label {
    color: #ffffff !important;
}

/* Form Select Elements in Filters */
body.dark-theme .dashboard-filters-section .form-select {
    background: #383838 !important;
    border: 1px solid #404040 !important;
    color: #ffffff !important;
}

body.dark-theme .dashboard-filters-section .form-select option {
    background: #383838 !important;
    color: #ffffff !important;
}

body.dark-theme .dashboard-filters-section .form-select:focus {
    border-color: #66BB6A !important;
    box-shadow: 0 0 0 2px rgba(102, 187, 106, 0.2) !important;
}

/* Reset Filters Button */
body.dark-theme .dashboard-filters-section .btn-secondary {
    background: #383838 !important;
    color: #ffffff !important;
    border: 1px solid #404040 !important;
}

body.dark-theme .dashboard-filters-section .btn-secondary:hover {
    background: #404040 !important;
}

/* Refresh Button */
body.dark-theme .dashboard-filters-section .btn-primary {
    background: #66BB6A !important;
    color: #121212 !important;
}

body.dark-theme .dashboard-filters-section .btn-primary:hover {
    background: #4CAF50 !important;
}

/* Any other form elements in the filter section */
body.dark-theme .dashboard-filters-section input,
body.dark-theme .dashboard-filters-section select,
body.dark-theme .dashboard-filters-section button {
    color: #ffffff !important;
}

body.dark-theme .dashboard-filters-section input:not(.btn-primary),
body.dark-theme .dashboard-filters-section select:not(.btn-primary) {
    background: #383838 !important;
    border: 1px solid #404040 !important;
}

/* Additional specific targeting for inline styles override */
body.dark-theme .dashboard-filters-section[style*="background"] {
    background: #2c2c2c !important;
}

body.dark-theme .dashboard-filters-section .form-select[style*="background"] {
    background: #383838 !important;
}

body.dark-theme .dashboard-filters-section .btn-secondary[style*="background"] {
    background: #383838 !important;
}

body.dark-theme .dashboard-filters-section .btn-primary[style*="background"] {
    background: #66BB6A !important;
}
