/* =====================================================
   Auto Audio Playlist - style.css v2.7.0
   ===================================================== */

/* Container principale */
.aap-container {
    margin-bottom: 40px;
    font-family: sans-serif;
    container-type: inline-size;
}

/* Player box */
.aap-player-controls {
    background: rgba(208, 237, 169, 0.6);
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

/* Layout verticale: top row (cover + waveform), poi controlli sotto */
.aap-player-top {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Riga superiore: cover a sinistra, titolo+waveform a destra */
.aap-player-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Cover */
.aap-cover-wrap {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
}

.aap-cover {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.aap-cover-placeholder {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aap-cover-placeholder::after {
    content: "♪";
    font-size: 30px;
    color: #aaa;
}

/* Area titolo + waveform */
.aap-player-main {
    flex: 1;
    min-width: 0;
}

/* Titolo e artista */
.aap-now-playing {
    margin-bottom: 6px;
    line-height: 1.3;
}

.aap-track-title {
    display: block;
    font-size: 15px;
    font-weight: bold;
    color: #222;
    white-space: nowrap;
    overflow: auto;
    text-overflow: clip;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.aap-track-title::-webkit-scrollbar {
    display: none;
}

.aap-track-artist {
    display: block;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Waveform */
.waveform {
    border-radius: 4px;
    overflow: hidden;
}

/* Controlli — sempre in riga piena sotto */
.aap-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.aap-controls button {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    background: transparent;
    border: none;
    font-size: 18px;
    color: #222;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.aap-controls button:hover { color: #ff6600; }
.aap-controls button.active { color: #ff6600; }

/* Icone Font Awesome */
.aap-play::before    { content: "\f04b"; }
.aap-pause::before   { content: "\f04c"; }
.aap-prev::before    { content: "\f048"; }
.aap-next::before    { content: "\f051"; }
.aap-shuffle::before { content: "\f074"; }
.aap-loop::before    { content: "\f021"; }

/* Volume */
.aap-volume-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
}

.aap-vol-icon::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: "\f028";
    font-size: 14px;
    color: #555;
}

.aap-volume {
    width: 90px;
    accent-color: #2d7d7d;
    cursor: pointer;
}

/* Loader */
.aap-loader {
    font-size: 12px;
    font-style: italic;
    color: #666;
    margin-top: 4px;
    display: none;
    animation: aap-blink 1s infinite;
}

@keyframes aap-blink {
    0%, 100% { opacity: 0.3; }
    50%       { opacity: 1; }
}

/* =====================================================
   Lista tracce
   ===================================================== */
.aap-track-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: rgba(208, 237, 169, 0.6);
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.aap-track-list::-webkit-scrollbar {
    display: none;
}

.aap-track-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
    background: rgba(255, 255, 255, 0.7);
}

.aap-track-list li:last-child { border-bottom: none; }
.aap-track-list li:hover { background: rgba(200, 200, 200, 0.4); }
.aap-track-list li.aap-active { background: rgba(45, 125, 125, 0.12); }

.aap-list-num {
    font-size: 11px;
    color: #aaa;
    min-width: 20px;
    text-align: right;
    flex-shrink: 0;
}

.aap-track-list li.aap-active .aap-list-num {
    color: #2d7d7d;
    font-weight: bold;
}

.aap-list-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.aap-list-title {
    font-size: 13px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aap-track-list li.aap-active .aap-list-title {
    font-weight: bold;
    color: #2d7d7d;
}

.aap-list-artist {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 480px) {
    .aap-cover-wrap,
    .aap-cover,
    .aap-cover-placeholder {
        width: 70px;
        height: 70px;
    }
    .aap-volume { width: 60px; }
}
