/* =====================================================
   RADIO MARCONI RM24 - iTunes Preview Widget
   ===================================================== */

.itunes-widget {
    margin: 1.5rem 0;
}

.itw-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: transparent;
    padding: 0;
    max-width: 100%;
}

/* Okładka */
.itw-art-wrap {
    position: relative;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.itw-art {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    transition: filter 0.2s ease;
}

/* Prawa kolumna */
.itw-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* Tytuł i wykonawca w jednej linii */
.itw-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}

.itw-title {
    font-weight: 700;
    font-size: inherit;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.itw-sep {
    color: #555;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.itw-artist {
    font-size: inherit;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Wiersz: play + pasek postępu + czas - wszystko wyrównane */
.itw-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.itw-inline-play {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 1.9rem;
    padding: 0;
    transition: color 0.18s;
}

.itw-inline-play.playing {
    color: #ff4400;
}

.itw-inline-play:hover {
    color: #ff4400;
}

.itw-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}

.itw-bar:hover {
    height: 5px;
}

.itw-bar-fill {
    height: 100%;
    width: 0%;
    background: #ff4400;
    border-radius: 2px;
    transition: width 0.25s linear;
    position: relative;
}

.itw-bar:hover .itw-bar-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4400;
}

.itw-time {
    font-size: 0.67rem;
    color: #666;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 2.1rem;
}

.itw-time-cur { text-align: right; }

/* Skeleton */
.itw-skeleton {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
}

.itw-sk-art {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    animation: itw-pulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

.itw-sk-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.itw-sk-line {
    height: 9px;
    border-radius: 4px;
    background: rgba(255,255,255,0.07);
    animation: itw-pulse 1.4s ease-in-out infinite;
}

.itw-sk-l1 { width: 60%; }
.itw-sk-l2 { width: 40%; animation-delay: 0.15s; }
.itw-sk-l3 { width: 80%; height: 3px; animation-delay: 0.3s; }

@keyframes itw-pulse {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 0.85; }
}

/* Błąd */
.itw-error {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255,68,0,0.07);
    border: 1px solid rgba(255,68,0,0.18);
    border-radius: 6px;
    color: #ff6633;
    font-size: 0.82rem;
}

    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Responsywność */
@media (max-width: 600px) {
    .itw-art,
    .itw-art-wrap,
    .itw-sk-art {
        width: 80px;
        height: 80px;
        border-radius: 10px;
    }

    /* Tytuł i wykonawca w dwóch osobnych liniach na mobile */
    .itw-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.1rem;
    }

    .itw-sep {
        display: none;
    }

    .itw-title,
    .itw-artist {
        font-size: inherit;
    }

    .itw-inline-play {
        font-size: 1.7rem;
    }

    .itw-time {
        font-size: 0.62rem;
        min-width: 1.9rem;
    }
}
