/* SEC Dashboard - Responsive Design */

/* Tablet Devices (768px to 1024px) */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 200px;
        overflow-x: auto;
    }

    .installations-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .installation-item {
        min-width: 150px;
        white-space: nowrap;
    }

    .data-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    section {
        padding: 1rem;
    }
}

/* Mobile Devices (480px to 768px) */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 1.75rem;
    }

    .app-header .subtitle {
        font-size: 0.875rem;
    }

    .sidebar {
        max-height: 150px;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }

    .map-container {
        height: 300px;
    }

    .data-card {
        padding: 1rem;
    }

    .data-value {
        font-size: 1.5rem;
    }

    section {
        padding: 0.75rem;
        border-radius: 4px;
    }

    section h2 {
        font-size: 1.25rem;
    }

    .chart-container {
        padding: 1rem;
    }

    canvas {
        max-height: 250px;
    }

    /* Fleet stats: smaller font on mobile */
    .fleet-stat-value {
        font-size: 1.75rem;
    }

    .fleet-stat {
        padding: 0.75rem 1rem;
    }
}

/* Small Mobile Devices (< 480px) */
@media (max-width: 480px) {
    .app-header {
        padding: 1rem 0.5rem;
    }

    .app-header h1 {
        font-size: 1.5rem;
    }

    .app-header .subtitle {
        display: none;
    }

    .container {
        min-height: calc(100vh - 100px);
    }

    .sidebar {
        max-height: 120px;
    }

    .main-content {
        padding: 0.5rem;
    }

    .data-grid {
        gap: 0.5rem;
    }

    .data-card {
        padding: 0.75rem;
    }

    .data-card h3 {
        font-size: 0.75rem;
    }

    .data-value {
        font-size: 1.25rem;
    }

    section {
        padding: 0.5rem;
        margin-bottom: 1rem;
    }

    section h2 {
        font-size: 1rem;
    }

    .map-container {
        height: 200px;
    }

    .chart-container {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .chart-container h3 {
        font-size: 1rem;
    }

    .installation-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .app-footer {
        padding: 1rem 0.5rem;
    }

    .app-footer p {
        font-size: 0.8rem;
    }

    /* Fleet stats: stack vertically on very small screens */
    .fleet-stats {
        flex-direction: column;
    }

    .fleet-stat-value {
        font-size: 1.5rem;
    }
}

/* Print Stylesheet */
@media print {
    .sidebar,
    .app-footer,
    .app-header {
        display: none;
    }

    .container {
        margin: 0;
        max-width: 100%;
    }

    .main-content {
        padding: 0;
    }

    section {
        page-break-inside: avoid;
    }
}

/* Dark Mode Support (if system prefers dark theme) */
@media (prefers-color-scheme: dark) {
    :root {
        --light-bg: #2a2a2a;
        --text-dark: #e0e0e0;
        --text-light: #b0b0b0;
        --dark-bg: #1a1a1a;
    }

    body {
        background-color: var(--dark-bg);
    }

    section {
        background: #222;
        border: 1px solid #444;
    }

    .sidebar {
        background: #222;
        border-right: 1px solid #444;
    }

    .installation-item {
        background: #333;
        border-left-color: var(--primary-color);
    }

    .data-card {
        background: #333;
    }

    /* Fleet stats dark mode */
    .fleet-stat {
        background: #333;
    }

    .fleet-stat-value {
        color: #e0e0e0;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .app-header {
        padding: 0.75rem 1rem;
    }

    .app-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .app-header .subtitle {
        display: none;
    }

    .map-container {
        height: 250px;
    }

    .charts-section {
        grid-template-columns: repeat(2, 1fr);
    }

    canvas {
        max-height: 200px;
    }
}