/* Palinsesto Radio - Frontend Styles */

.palinsesto-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Tabs - Menu giorni settimana */
.palinsesto-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.palinsesto-tab {
    flex: 1;
    min-width: 100px;
    padding: 15px 10px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: inherit;
    font-weight: 500;
    color: #ffffff;
    transition: all 0.3s ease;
    text-align: center;
}

.palinsesto-tab:hover {
    opacity: 0.8;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.palinsesto-tab.active {
    color: #f01511;
    font-weight: 700;
    border-bottom-color: #f01511;
}

/* Content area */
.palinsesto-content {
    position: relative;
    min-height: 400px;
}

.palinsesto-day {
    display: none;
}

.palinsesto-day.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Programma Box */
a.programma-box {
    text-decoration: none;
    cursor: pointer;
}

.programma-box:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.programma-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    margin-bottom: 15px;
    background: transparent;
    border: 1px solid #ffffff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.programma-box:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.programma-box.is-live {
    border: 2px solid #f01511;
    background: transparent;
}

/* Info: wrapper badge + riga dettagli */
.programma-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Riga ora + titolo */
.programma-dettagli {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Fascia oraria */
.programma-ora {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    color: #ffffff;
}

.ora-text {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
}

.ora-separator {
    font-size: 14px;
    font-weight: 400;
    color: #ffffff;
}

/* Badge LIVE */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
    color: #f01511;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.live-badge::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f01511;
    animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.6);
        opacity: 0.5;
    }
}

/* Immagine programma */
.programma-immagine {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.programma-immagine img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Nome programma */
.programma-nome {
    flex: 1;
    min-width: 0;
}

.programma-nome h3 {
    margin: 0;
    font-size: inherit;
    font-weight: 600;
    line-height: 1.4;
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {

    /* Tabs: 4 in prima riga, 3 in seconda */
    .palinsesto-tabs {
        gap: 6px;
    }

    .palinsesto-tab {
        min-width: 0;
        padding: 12px 5px;
        font-size: 13px;
    }

    .palinsesto-tab:nth-child(-n+4) {
        flex: 0 0 calc(25% - 5px);
    }

    .palinsesto-tab:nth-child(n+5) {
        flex: 1 0 calc(33% - 5px);
    }

    /* Box programma: sempre orizzontale (foto | info) */
    .programma-box {
        flex-wrap: nowrap;
        align-items: center;
        gap: 12px;
        padding: 12px;
    }

    .programma-immagine {
        flex-shrink: 0;
        width: 56px;
        height: 56px;
    }

    .programma-dettagli {
        gap: 10px;
    }

    .programma-nome h3 {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ora-text {
        font-size: 13px;
    }

    .live-badge {
        margin-bottom: 4px;
    }
}

/* =========================================
   Pagina dettaglio programma
   ========================================= */

.programma-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.programma-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 20px;
}

.programma-detail-immagine {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    overflow: hidden;
}

.programma-detail-immagine img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.programma-detail-descrizione {
    flex: 1;
    min-width: 0;
}

.programma-detail-descrizione p:first-child {
    margin-top: 0;
}

.programma-detail-titolo {
    margin: 0;
    font-size: 2em;
    line-height: 1.2;
}

.programma-detail-palinsesto {
    margin-top: 40px;
}

/* Lista turni */
.programma-detail-turni {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.programma-detail-giorno {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 6px;
    border: 1px solid rgba(128, 128, 128, 0.25);
}

.programma-detail-day-name {
    font-weight: 700;
    min-width: 100px;
    flex-shrink: 0;
}

.programma-detail-orari {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.programma-detail-slot {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding: 2px 10px;
    border-radius: 4px;
    border: 1px solid rgba(128, 128, 128, 0.3);
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 600px) {
    .programma-detail-header {
        flex-direction: column;
        gap: 20px;
    }

    .programma-detail-immagine {
        width: 120px;
        height: 120px;
    }

    .programma-detail-titolo {
        font-size: 1.5em;
    }

    .programma-detail-giorno {
        flex-direction: column;
        gap: 6px;
    }
}