/* Importation des polices Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,600;1,400&family=Source+Sans+3:wght@700&display=swap');

:root {
    --bg-color: #eaeffa;
    --text-color: #1a2c56;
    --text-muted: #4a5d8a;
    --card-bg: #ffffff;
    --input-bg: #f4f7fd;
    --border-radius: 16px;
    --transition: all 0.2s ease;
}

/* R�initialisation de base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cabin', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
}

/* Conteneur principal du Player */
.player-container {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 440px;
    padding: 35px 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 12px 32px rgba(26, 44, 86, 0.06);
    text-align: center;
}

/* Titres avec Source Sans Pro / 3 */
h1, h2, h3, h4 {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 26px;
    margin-bottom: 25px;
}

/* Commandes de lecture */
.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Boutons tactiles et interactifs */
button {
    font-family: 'Cabin', sans-serif;
    font-weight: 600;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: none;
    padding: 12px 22px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    min-height: 46px; /* Id�al pour le tactile mobile */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
}

/* Style sp�cifique pour le bouton Al�atoire */
#btn-shuffle {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--text-color);
}

#btn-shuffle:hover {
    background-color: rgba(26, 44, 86, 0.05);
}

/* Section des minuteries d'arr�t */
.timers {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid rgba(26, 44, 86, 0.1);
    text-align: left;
}

.timers h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.timer-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    background-color: var(--input-bg);
    padding: 10px 14px;
    border-radius: 10px;
}

label {
    font-size: 14px;
    font-weight: 600;
}

/* Champs de saisie */
input[type="number"],
input[type="time"] {
    font-family: 'Cabin', sans-serif;
    padding: 8px 12px;
    border: 1px solid rgba(26, 44, 86, 0.15);
    border-radius: 8px;
    color: var(--text-color);
    background-color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

input[type="number"] {
    width: 75px;
    text-align: center;
}

input[type="time"] {
    width: 110px;
    text-align: center;
}

input:focus {
    border-color: var(--text-color);
    box-shadow: 0 0 0 3px rgba(26, 44, 86, 0.1);
}

/* Statut du minuteur */
#timer-status {
    margin-top: 15px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    min-height: 18px;
}

/* Optimisations responsive pour petits �crans */
@media (max-width: 400px) {
    body {
        padding: 10px;
    }

    .player-container {
        padding: 25px 15px;
    }

    .timer-group {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
    }

    input[type="number"],
    input[type="time"] {
        width: 100%;
    }
}

/* Style du s�lecteur de playlist */
.playlist-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.playlist-selector label {
    color: var(--text-color);
    font-weight: 600;
}

.playlist-selector select {
    font-family: 'Cabin', sans-serif;
    padding: 10px 15px;
    border: 1px solid rgba(26, 44, 86, 0.15);
    border-radius: 8px;
    color: var(--text-color);
    background-color: var(--input-bg);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    appearance: none; /* Supprime la fl�che par d�faut sur certains navigateurs */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231a2c56%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
    padding-right: 40px; /* Pour laisser de la place � la fl�che custom */
}

.playlist-selector select:focus {
    border-color: var(--text-color);
    box-shadow: 0 0 0 3px rgba(26, 44, 86, 0.1);
}

/* Barre de progression et infos de temps */
.progress-container {
    margin: 25px 0 15px 0;
    width: 100%;
}

#progress-bar {
    width: 100%;
    accent-color: var(--text-color); /* Utilise ton bleu #1a2c56 pour le curseur */
    cursor: pointer;
    height: 6px;
    border-radius: 3px;
    background: rgba(26, 44, 86, 0.1);
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 600;
}

/* Liste des morceaux */
.tracklist-container {
    margin-top: 20px;
    text-align: left;
}

.tracklist-container h3 {
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.track-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid rgba(26, 44, 86, 0.1);
    border-radius: 10px;
    background-color: var(--input-bg);
}

.track-item {
    padding: 12px 15px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(26, 44, 86, 0.05);
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-item:last-child {
    border-bottom: none;
}

.track-item:hover {
    background-color: rgba(26, 44, 86, 0.05);
}

/* Style du morceau en cours de lecture */
.track-item.active {
    background-color: var(--text-color);
    color: var(--bg-color);
    font-weight: 600;
}

/* ... existing code ... */
/* Style du morceau en cours de lecture */
.track-item.active {
    background-color: var(--text-color);
    color: var(--bg-color);
    font-weight: 600;
}

/* NOUVEAU : Style pour le Mode TV */
.tv-mode-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(26, 44, 86, 0.1);
}

.tv-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

/* Interrupteur */
.tv-toggle input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--text-color);
    cursor: pointer;
}

.tv-controls {
    margin-top: 15px;
    text-align: left;
    background-color: var(--input-bg);
    padding: 15px;
    border-radius: 10px;
}

.tv-controls p {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.tv-controls button {
    background-color: transparent;
    color: var(--text-color);
    border: 2px solid var(--text-color);
    min-height: 36px;
    padding: 8px 15px;
    font-size: 13px;
    margin-right: 5px;
}

.tv-controls button.active {
    background-color: var(--text-color);
    color: var(--bg-color);
}