/* POLLENS - Style moderne sombre inspiré de iassistant-dioxus */
/* Optimisé pour mobile (affichage vertical) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #1e1e1e;
    color: #e0e0e0;
    overflow-x: hidden;
}

/* ===== ÉCRAN PRINCIPAL ===== */

main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #1e1e1e;
    padding: 20px;
}

h1 {
    font-size: 24px;
    color: #90caf9;
    margin-bottom: 20px;
    text-align: center;
}

/* Localisation */
.location-info {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #3d3d3d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.location-info p {
    margin: 0;
    color: #e0e0e0;
    flex: 1;
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-info .aasqa-badge {
    background: #424242;
    color: #e0e0e0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #555;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Bouton Actualiser */
.refresh-button {
    background: #4caf50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.refresh-button:hover {
    background: #66bb6a;
}

.refresh-button:active {
    background: #388e3c;
}

/* Indicateurs de granularité des données */
.data-type-indicator {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
}

.data-type-indicator.gps {
    border-left: 4px solid #4caf50;
    background: rgba(76, 175, 80, 0.1);
    color: #81c784;
}

.data-type-indicator.city {
    border-left: 4px solid #2196f3;
    background: rgba(33, 150, 243, 0.1);
    color: #64b5f6;
}

.data-type-indicator.department {
    border-left: 4px solid #ff9800;
    background: rgba(255, 152, 0, 0.1);
    color: #ffb74d;
}

.data-type-indicator.regional {
    border-left: 4px solid #9e9e9e;
    background: rgba(158, 158, 158, 0.1);
    color: #bdbdbd;
}

/* Messages d'erreur */
.error {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid #f44336;
    color: #ef5350;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* ===== AFFICHAGE POLLENS ===== */

.pollens-display {
    margin-top: 20px;
}

.loading {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #9e9e9e;
    font-style: italic;
    border: 1px solid #3d3d3d;
}

.pollens-card {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #3d3d3d;
}

.pollens-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: #90caf9;
}

.pollens-date {
    color: #9e9e9e;
    font-size: 13px;
}

/* Indicateur de qualité de l'air */
.pollens-indicator {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.pollens-indicator.good {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid #4caf50;
}

.pollens-indicator.medium {
    background: rgba(255, 193, 7, 0.2);
    border: 2px solid #ffc107;
}

.pollens-indicator.degraded {
    background: rgba(255, 152, 0, 0.2);
    border: 2px solid #ff9800;
}

.pollens-indicator.bad {
    background: rgba(244, 67, 54, 0.2);
    border: 2px solid #f44336;
}

.pollens-indicator .indice {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.pollens-indicator.good .indice { color: #81c784; }
.pollens-indicator.medium .indice { color: #ffd54f; }
.pollens-indicator.degraded .indice { color: #ffb74d; }
.pollens-indicator.bad .indice { color: #e57373; }

.pollens-indicator .label {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pollens-indicator.good .label { color: #a5d6a7; }
.pollens-indicator.medium .label { color: #ffe082; }
.pollens-indicator.degraded .label { color: #ffcc80; }
.pollens-indicator.bad .label { color: #ef9a9a; }

.pollutant {
    color: #bdbdbd;
    font-size: 14px;
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid #3d3d3d;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .pollens-card {
        padding: 16px;
    }

    .pollens-indicator {
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }

    .pollens-indicator .indice {
        font-size: 40px;
    }

    .pollens-indicator .label {
        font-size: 14px;
    }
}

@media (max-width: 374px) {
    .pollens-indicator .indice {
        font-size: 36px;
    }
}

/* ===== TABLEAU POLLENS ===== */

.pollens-table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

.pollens-table {
    width: 100%;
    border-collapse: collapse;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

.pollens-table thead {
    background: #3d3d3d;
}

.pollens-table th {
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #90caf9;
    border-bottom: 2px solid #4d4d4d;
}

.pollens-table th.pollen-name {
    text-align: left;
}

.pollens-table th.today-col {
    color: #81c784;
    border-bottom: 2px solid #4caf50;
}

.pollens-table td {
    padding: 12px 8px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #3d3d3d;
}

.pollens-table td.pollen-name {
    text-align: left;
    font-weight: 500;
    color: #e0e0e0;
    min-width: 120px;
}

.pollens-table td.pollen-code {
    min-width: 60px;
}

.pollens-table td.pollen-code.no-data {
    color: #555;
}

/* Badge d'indice coloré */
.indice-badge {
    display: inline-block;
    min-width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
}

.indice-badge.indice-0 { background: #4caf50; color: white; }
.indice-badge.indice-1 { background: #8bc34a; color: white; }
.indice-badge.indice-2 { background: #cddc39; color: #333; }
.indice-badge.indice-3 { background: #ffeb3b; color: #333; }
.indice-badge.indice-4 { background: #ff9800; color: white; }
.indice-badge.indice-5 { background: #f44336; color: white; }
.indice-badge.indice-6 { background: #9c27b0; color: white; }

/* Colonne J mise en évidence */
.pollens-table th.today-col {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    border-bottom: 2px solid #4caf50;
    border-left: 2px solid #4caf50;
    border-right: 2px solid #4caf50;
}

.pollens-table td.today-col {
    background: rgba(76, 175, 80, 0.08);
    border-left: 2px solid #4caf50;
    border-right: 2px solid #4caf50;
    font-weight: 600;
}

.pollens-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Responsive mobile pour le tableau */
@media (max-width: 768px) {
    .pollens-table th {
        font-size: 11px;
        padding: 10px 4px;
    }

    .pollens-table td {
        padding: 10px 4px;
    }
    
    .pollens-table td.pollen-name {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pollens-table-wrapper {
        overflow-x: scroll;
    }

    .pollens-table {
        min-width: 450px;
    }
}

/* ===== RESPONSIVE MOBILE ===== */

@media (max-width: 768px) {
    main {
        padding: 16px;
    }

    h1 {
        font-size: 20px;
    }

    .refresh-button {
        width: 100%;
    }
}

/* Très petits écrans (< 375px) */
@media (max-width: 374px) {
    h1 {
        font-size: 18px;
    }
    
    .location-info {
        font-size: 12px;
        padding: 12px;
    }
    
    .refresh-button {
        font-size: 13px;
        padding: 8px 16px;
    }
}
