@import url('https://fonts.googleapis.com/css?family=Oswald');

:root {
    --bg-dark: #121214;
    --bg-card: #333;
    --accent-red: #e95858;
    --text-main: #ffffff;
    --text-muted: #a0a0a5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Oswald', sans-serif; /* Forzato Oswald come font principale */
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header & Footer */
.main-header, .main-footer {
    width: 100%;
    /*max-width: 800px;*/
    background: linear-gradient(180deg, #ffb74d, #b83232);
    padding: 20px;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin-bottom: 25px;
	border: 1px solid #866161;
}

.main-header h1, .main-footer p {
    font-family: 'Oswald', sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.main-footer {
    margin-top: 25px;
    margin-bottom: 0;
    padding: 15px;
}

/* Contenitore Classifica */
.chart-container {
    width: 100%;
    /*max-width: 800px;*/
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ============================================================================= */
/* LAYOUT ORIZZONTALE DISPOSITIVI GRANDI (PC / TABLET) */
/* ============================================================================= */
.chart-item {
	background-color: var(--bg-card);
    display: flex;
    align-items: center;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid #866161;
}

/* 1. POSIZIONE */
.position-badge {
    font-family: 'Oswald', sans-serif;
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-red), #b83232);
    color: #fff;
    width: 70px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 2. COPERTINA */
.cover-art img {
    width: 160px;
    height: 160px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
}

/* 3. TASTO PLAY-PAUSA (INGRANDITO A 100x100px) */
.play-btn {
    /*background: #1DB954;*/
    border: none;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, background-color 0.2s;
    padding: 0;
    margin: 0;
}

.play-btn:hover {
    transform: scale(1.04);
    /*background: #1ed760;*/
}

/* Gestione icone interne al bottone unico */
.play-btn .icon-pause { display: none !important; }
.play-btn .icon-play { display: inline-block !important; }

.play-btn.playing .icon-play { display: none !important; }
.play-btn.playing .icon-pause { display: inline-block !important; }

/* 4. AREA TESTI (TITOLO E ARTISTA INCOLONNATI) */
.track-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 150px;
    flex-grow: 1; /* Prende lo spazio centrale disponibile */
    gap: 4px;
}

.track-title {
	font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: #ffb74d;
}

.track-artist {
	font-family: 'Oswald', sans-serif;
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 400;
}

/* 5. STRUTTURA BLOCCO TIMELINE (TUTTO A DESTRA) */
.player-wrapper {
    width: 250px; /* Larghezza fissa per la barra di scorrimento su PC */
    flex-shrink: 0;
}

/* Griglia interna per disporre i timer in alto e lo slider subito sotto */
.custom-player {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Divide lo spazio in due colonne (Sinistra e Destra) */
    row-gap: 6px;
	padding: 20px;
}

/* Posiziona il tempo iniziale in alto a sinistra */
.time-display.current-time {
    grid-column: 1;
    text-align: left;
    font-size: 0.8rem;
    color: #b3b3b3;
    font-family: monospace;
}

/* Posiziona il tempo finale in alto a destra */
.time-display.duration-time {
    grid-column: 2;
    text-align: right;
    font-size: 0.8rem;
    color: #b3b3b3;
    font-family: monospace;
}

/* Espande la barra di scorrimento su tutta la larghezza del blocco, posizionandola sotto i timer */
.timeline-container {
    grid-column: 1 / span 2; /* Si estende su entrambe le colonne */
    width: 100%;
}

.seek-slider {
    width: 100%;
    -webkit-appearance: none;
    background: #4f4f4f;
    height: 5px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    display: block;
}

.seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1DB954;
}

.seek-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1DB954;
    border: none;
}

/* ============================================================================= */
/* OTTIMIZZAZIONE PER SMARTPHONE E SCHERMI PICCOLI */
/* ============================================================================= */

	
@media (max-width: 768px) {
    /* Rende la scheda il punto di riferimento per il posizionamento assoluto */
    .chart-item {
        flex-direction: column; 
        text-align: center;
        gap: 15px;
        position: relative; /* FONDAMENTALE: fa da ancora per il badge */
        padding-top: 40px;  /* Aggiunge spazio in alto per non far accavallare la copertina al numero */
    }
	
		.cover-art img {
    width: 300px;
    height: 300px;
	}

    /* FORZA IL BADGE DELLA POSIZIONE A LATO SINISTRO SU MOBILE */
    .position-badge {
        position: absolute;
        top: 15px;          /* Distanza dal bordo superiore della scheda */
        left: 15px;         /* Distanza dal bordo sinistro della scheda */
        text-align: left;
        min-width: auto;
        font-size: 1.3rem;  /* Lo rimpicciolisce leggermente per mobile */
		width: 80px;
		height: 80px;
		border-radius: 10px;
    }

    .track-info, .player-wrapper {
        width: 100%;
        max-width: 100%;
    }
}
	