﻿/* ========================================================================
   OPTIMERAD DAY-PREVIEW - ENKLARE OCH SNABBARE
   ======================================================================== */

/* Grundläggande layout */
.day-tab-button {
    width: 100%;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 0;
    overflow: visible;
}

.days-vertical-layout {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.day-content {
    width: 100%;
    margin: 0;
    padding: 15px;
    background-color: #ffffff;
    border: none;
    border-top: 1px solid #e2e8f0;
}

/* Certainty badge färger - FÖRENKLAD */
.day-preview .certainty-badge.certainty-high {
    background-color: #dcfce7;
    color: #166534;
}

.day-preview .certainty-badge.certainty-medium-high {
    background-color: #dbeafe;
    color: #1e40af;
}

.day-preview .certainty-badge.certainty-medium {
    background-color: #fef3c7;
    color: #92400e;
}

.day-preview .certainty-badge.certainty-low,
.day-preview .certainty-badge.certainty-very-low {
    background-color: #fecaca;
    color: #991b1b;
}

/* DESKTOP LAYOUT - FLEX */
@media (min-width: 768px) {
    .day-preview {
        display: flex;
        width: 100%;
        align-items: center;
        padding: 12px 15px;
        background-color: #f8fafc;
        border: none;
    }

    .day-preview-headers {
        display: flex;
        width: 100%;
        color: #1565c0;
        font-size: 0.8rem;
        background-color: #e3f2fd;
        border-radius: 8px 8px 0 0;
        border: 1px solid #bbdefb;
        border-bottom: none;
        margin-bottom: 4px;
        justify-content: space-between;
        align-items: center;
        padding: 8px 15px;
    }

        .day-preview-headers > * {
            font-size: 0.8rem;
            font-weight: 500;
            color: #1565c0;
        }

        /* Desktop kolumnbredder */
        .day-preview .day-name,
        .day-preview-headers .day-name {
            flex: 0 0 15%;
            text-align: left;
        }

        .day-preview .day-weather-icon,
        .day-preview-headers .day-weather-icon {
            flex: 0 0 15%;
            text-align: center;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .day-preview .day-temp,
        .day-preview-headers .day-temp {
            flex: 0 0 15%;
            text-align: center;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .day-preview .day-wind,
        .day-preview-headers .day-wind {
            flex: 0 0 15%;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }

        .day-preview .day-certainty,
        .day-preview-headers .day-certainty {
            flex: 1;
            text-align: right;
            padding-right: 40px;
        }

    .day-preview .day-chevron {
        margin-left: auto;
        flex: 0 0 30px;
        color: #64748b;
        transition: transform 0.3s ease;
    }
}

/* Gemensamma element */
.day-preview .day-name {
    text-align: left;
    font-weight: 600;
    color: #1e3a8a;
    font-size: 0.85rem;
    padding: 0;
    margin: 0;
}

.day-preview .day-weather-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

    .day-preview .day-weather-icon img {
        width: 35px;
        height: 35px;
        object-fit: contain;
    }

.day-preview .day-temp {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.day-preview .day-wind {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    margin: 0;
    gap: 2px;
}

    .day-preview .day-wind span {
        font-size: 0.75rem;
        line-height: 1;
    }

.day-preview .day-wind-direction {
    width: 16px;
    height: 16px;
}

.day-preview .day-certainty {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    margin: 0;
}

.day-preview .day-chevron {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #64748b;
    transition: transform 0.3s ease;
    margin: 0;
}

    .day-preview .day-chevron svg {
        width: 16px;
        height: 16px;
    }

/* Certainty badge - FÖRENKLAD */
.day-preview .certainty-badge {
    padding: 4px 6px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    max-width: 100%;
}

/* MOBIL LAYOUT - GRID MED FÄRRE BRYTPUNKTER */
@media (max-width: 767.98px) {
    .day-preview {
        display: grid;
        grid-template-columns: 70px 40px 50px 55px 1fr 25px;
        grid-template-areas: "name icon temp wind certainty chevron";
        width: 100%;
        align-items: center;
        padding: 10px 12px;
        background-color: #f8fafc;
        gap: 6px;
        min-height: 55px;
        border: none;
    }

    .day-preview-headers {
        display: none;
    }

    .day-preview .day-name {
        grid-area: name;
        font-size: 0.8rem;
    }

    .day-preview .day-weather-icon {
        grid-area: icon;
    }

        .day-preview .day-weather-icon img {
            width: 28px;
            height: 28px;
        }

    .day-preview .day-temp {
        grid-area: temp;
        font-size: 0.85rem;
    }

    .day-preview .day-wind {
        grid-area: wind;
    }

        .day-preview .day-wind span {
            font-size: 0.7rem;
        }

    .day-preview .day-wind-direction {
        width: 14px;
        height: 14px;
    }

    .day-preview .day-certainty {
        grid-area: certainty;
    }

    .day-preview .day-chevron {
        grid-area: chevron;
    }

        .day-preview .day-chevron svg {
            width: 14px;
            height: 14px;
        }

    /* Certainty badge mobilanpassning */
    .day-preview .certainty-badge {
        padding: 2px 4px;
        border-radius: 10px;
        font-size: 0.55rem;
        white-space: normal;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 30px;
        gap: 1px;
    }

        .day-preview .certainty-badge .percentage {
            font-weight: 600;
            font-size: 0.6rem;
            line-height: 1;
            display: block;
        }

        .day-preview .certainty-badge .text {
            font-weight: 400;
            font-size: 0.5rem;
            line-height: 1;
            display: block;
        }
}

/* EXTRA SMÅ SKÄRMAR - ENDAST EN BRYTPUNKT */
@media (max-width: 576px) {
    .day-preview {
        grid-template-columns: 60px 30px 40px 45px 1fr 18px;
        padding: 6px 8px;
        gap: 3px;
        min-height: 45px;
    }

        .day-preview .day-weather-icon img {
            width: 20px;
            height: 20px;
        }

        .day-preview .day-name {
            font-size: 0.7rem;
            line-height: 1.1;
        }

        .day-preview .day-temp {
            font-size: 0.75rem;
            line-height: 1.1;
        }

        .day-preview .day-wind {
            gap: 1px;
        }

            .day-preview .day-wind span {
                font-size: 0.6rem;
                line-height: 1;
            }

        .day-preview .day-wind-direction {
            width: 10px;
            height: 10px;
        }

        .day-preview .certainty-badge {
            padding: 1px 3px;
            font-size: 0.5rem;
            min-height: 26px;
            border-radius: 8px;
        }

            .day-preview .certainty-badge .percentage {
                font-size: 0.55rem;
            }

            .day-preview .certainty-badge .text {
                font-size: 0.45rem;
            }

        .day-preview .day-chevron svg {
            width: 10px;
            height: 10px;
        }
}
