/* Weather Dashboard TV - Optimized for 1920x1080 OLED */

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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

:root {
    --weather-bg-primary: #000000;
    --weather-bg-card: rgba(255, 255, 255, 0.06);
    --weather-bg-card-n1: rgba(255, 255, 255, 0.04);
    --weather-text-primary: #ffffff;
    --weather-text-secondary: rgba(255, 255, 255, 0.7);
    --weather-text-muted: rgba(255, 255, 255, 0.5);
    --weather-accent-warm: #f39c12;
    --weather-accent-cold: #3498db;
    --weather-delta-positive: #27ae60;
    --weather-delta-negative: #e74c3c;
    --weather-border: rgba(255, 255, 255, 0.1);
}

/* Dashboard container - Full height */
.weather-dashboard {
    height: 100vh;
    background: var(--weather-bg-primary);
    color: var(--weather-text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Header */
.weather-dashboard__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--weather-border);
    margin-bottom: 0.5rem;
}

.weather-dashboard__header-left {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
}

.weather-dashboard__title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.weather-dashboard__update {
    font-size: 1.1rem;
    color: var(--weather-text-muted);
}

.weather-dashboard__header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weather-dashboard__city {
    font-size: 1.25rem;
    color: var(--weather-text-secondary);
}

.weather-dashboard__refresh-btn {
    background: transparent;
    border: 1px solid var(--weather-border);
    color: var(--weather-text-primary);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.weather-dashboard__refresh-btn:hover {
    background: var(--weather-bg-card);
}

/* Blocks (S / S+1) */
.weather-dashboard__block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.4rem;
}

/* Sections */
.weather-dashboard__section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.weather-dashboard__section--n1 {
    opacity: 0.9;
    margin-block-start: 1rem;
}

.weather-dashboard__section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--weather-text-secondary);
}

.weather-dashboard__section-subtitle {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--weather-text-muted);
    margin-top: 0.2rem;
}

/* Week Grid */
.weather-dashboard__week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.weather-dashboard__week-grid--n1 {
    opacity: 0.85;
}

/* Day Card */
.weather-dashboard__day-card {
    background: var(--weather-bg-card);
    border-radius: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--weather-border);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.weather-dashboard__day-card--next {
    background: rgba(255, 255, 255, 0.04);
}

.weather-dashboard__day-card--n1 {
    background: var(--weather-bg-card-n1);
}

.weather-dashboard__day-card--today {
    outline: 3px solid rgba(59, 130, 246, 0.7);
    outline-offset: 2px;
}

/* Comparaison N vs N-1 */
.weather-dashboard__day-card--better {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.weather-dashboard__day-card--worse {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}

.weather-dashboard__day-card--neutral {
    background: rgba(156, 163, 175, 0.08);
    border-color: rgba(156, 163, 175, 0.3);
}

/* Combinaison jour actuel + comparaison */
.weather-dashboard__day-card--today.weather-dashboard__day-card--better {
    outline: 3px solid rgba(59, 130, 246, 0.7);
    outline-offset: 2px;
}

.weather-dashboard__day-card--today.weather-dashboard__day-card--worse {
    outline: 3px solid rgba(59, 130, 246, 0.7);
    outline-offset: 2px;
}

.weather-dashboard__day-card--today.weather-dashboard__day-card--neutral {
    outline: 3px solid rgba(59, 130, 246, 0.7);
    outline-offset: 2px;
}

/* Day Header */
.weather-dashboard__day-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "day tag date";
    align-items: baseline;
}

.weather-dashboard__day-name {
    grid-area: day;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--weather-text-primary);
}

.weather-dashboard__day-date {
    grid-area: date;
    font-size: 0.9rem;
    color: var(--weather-text-muted);
    text-align: right;
}

.weather-dashboard__holiday-tag {
    grid-area: tag;
    font-size: 0.7rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 0.25rem;
    padding: 0.1rem 0.2rem;
    line-height: 1;
    justify-self: center;
}

/* Weather - Icon + Temps */
.weather-dashboard__day-weather {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex: 1;
}

.weather-dashboard__day-icon {
    font-size: 2.25rem;
    line-height: 1;
}

.weather-dashboard__day-temps {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-weight: 700;
}

.weather-dashboard__temp-max {
    color: var(--weather-accent-warm);
    font-size: 1.4rem;
}

.weather-dashboard__temp-sep {
    color: var(--weather-text-muted);
    font-size: 1.1rem;
}

.weather-dashboard__temp-min {
    color: var(--weather-accent-cold);
    font-size: 1.4rem;
}

/* Footer - AM/PM and Details */
.weather-dashboard__day-footer {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border-top: 1px solid var(--weather-border);
    padding-top: 0.25rem;
    margin-top: 0.2rem;
}

.weather-dashboard__day-icons-sub {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}

.weather-dashboard__day-icons-sub span {
    font-size: 1.15rem;
    color: var(--weather-text-primary);
}

.weather-dashboard__day-details {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1rem;
    color: var(--weather-text-secondary);
}

/* Bottom Section */
.weather-dashboard__bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-block-start: auto;
}

/* Comparison */
.weather-dashboard__comparison {
    background: var(--weather-bg-card);
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--weather-border);
}

.weather-dashboard__comparison-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--weather-text-secondary);
}

.weather-dashboard__comparison-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.weather-dashboard__comparison-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    align-items: center;
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--weather-border);
}

.weather-dashboard__comparison-row:last-child {
    border-bottom: none;
}

.weather-dashboard__comparison-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--weather-text-secondary);
}

.weather-dashboard__comparison-values {
    text-align: center;
    font-size: 1.3rem;
    color: var(--weather-text-primary);
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
}

.weather-dashboard__comparison-vs {
    font-size: 0.75rem;
    color: var(--weather-text-muted);
    font-weight: 500;
}

.weather-dashboard__comparison-row--header {
    font-weight: 700;
    color: var(--weather-text-secondary);
    border-bottom: 1px solid var(--weather-border);
    padding-bottom: 0.3rem;
    margin-bottom: 0.2rem;
}

.weather-dashboard__comparison-col-header {
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    color: var(--weather-text-primary);
}

.weather-dashboard__comparison-delta {
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.weather-dashboard__comparison-delta--positive {
    color: var(--weather-delta-positive);
}

.weather-dashboard__comparison-delta--negative {
    color: var(--weather-delta-negative);
}

.weather-dashboard__no-data {
    text-align: center;
    color: var(--weather-text-muted);
    padding: 1rem;
    font-size: 1.2rem;
}

/* Sales */
.weather-dashboard__sales {
    background: linear-gradient(135deg, rgba(44, 83, 100, 0.5) 0%, rgba(32, 58, 67, 0.5) 100%);
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--weather-border);
}

.weather-dashboard__sales-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--weather-text-secondary);
}

.weather-dashboard__sales-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.weather-dashboard__sales-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--weather-border);
}

.weather-dashboard__sales-row:last-child {
    border-bottom: none;
}

.weather-dashboard__sales-label {
    font-size: 1rem;
    color: var(--weather-text-secondary);
}

.weather-dashboard__sales-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4ade80;
}

.weather-dashboard__sales-amount {
    font-size: 3rem;
    font-weight: 700;
    color: #4ade80;
}

.weather-dashboard__sales-details {
    display: flex;
    gap: 2rem;
    font-size: 1.2rem;
    color: var(--weather-text-secondary);
}

/* Responsive */
@media (max-width: 1400px) {
    .weather-dashboard {
        padding: 1rem 1.5rem;
    }

    .weather-dashboard__title {
        font-size: 1.5rem;
    }

    .weather-dashboard__day-icon {
        font-size: 2.5rem;
    }

    .weather-dashboard__temp-max {
        font-size: 1.5rem;
    }

    .weather-dashboard__sales-amount {
        font-size: 2.5rem;
    }
}

/* Refresh animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.weather-dashboard__refresh-btn--loading {
    opacity: 0.7;
    pointer-events: none;
}

.weather-dashboard__refresh-btn--loading::before {
    content: '🔄';
    display: inline-block;
    animation: spin 1s linear infinite;
}
