/* --- ESTILOS CSS --- */
:root {
    --bg-color: #000;
    --sidebar-bg: #000;
    --main-bg: #121212;
    --card-bg: #181818;
    --card-hover-bg: #282828;
    --text-color: #fff;
    --subtext-color: #b3b3b3;
    --accent-color: #1DB954;
    --player-bg: #181818;
    --offline-color: #d93025;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-bottom: 90px;
}

.spotify-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    height: calc(100vh - 90px);
}

.sidebar {
    background-color: var(--sidebar-bg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar h2 {
    font-size: 1.2rem;
    padding-bottom: 10px;
}

.filtro-form label {
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 8px;
}

.filtro-form select,
.filtro-form button {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: none;
    background-color: #333;
    color: var(--text-color);
    margin-bottom: 15px;
}

.filtro-form button {
    background-color: var(--accent-color);
    font-weight: 700;
    cursor: pointer;
}

.main-content {
    background: linear-gradient(var(--card-hover-bg), var(--main-bg) 300px);
    overflow-y: auto;
    padding: 24px;
}

.main-content h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 30px;

}

.h1 {
    color: #a0ff0c;
}

.station-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

/* --- Estilos de la tarjeta de emisora --- */
.station-card {
    background-color: var(--card-bg);
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.station-card:hover {
    background-color: var(--card-hover-bg);
}

.station-card:hover .play-icon {
    opacity: 1;
    transform: translateY(0);
}

.station-card.offline {
    cursor: not-allowed;
}

/* No cambia de color al pasar el ratón si está offline */
.station-card.offline:hover {
    background-color: var(--card-bg);
}

.station-card img {
    width: 100%;
    border-radius: 6px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
}

.station-card h4 {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-card p {
    font-size: 0.85rem;
    color: var(--subtext-color);
}

.play-icon {
    position: absolute;
    bottom: 75px;
    right: 24px;
    width: 48px;
    height: 48px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.play-icon i {
    font-size: 1.5rem;
    color: #000;
}

/* El botón de play no aparece si está offline */
.station-card.offline:hover .play-icon {
    opacity: 0;
}

/* --- Etiqueta Offline --- */
.offline-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--offline-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    z-index: 10;
    display: none;
}

.station-card.offline .offline-badge {
    display: block;
}

/* Atenúa la imagen si está offline */
.station-card.offline img {
    filter: grayscale(80%) brightness(0.5);
}

/* --- Estilos del reproductor --- */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background-color: var(--player-bg);
    border-top: 1px solid #282828;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    visibility: hidden;
}

.player-bar.visible {
    visibility: visible;
}

.station-info {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 30%;
}

.station-info img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
}

.station-info div h5 {
    font-size: 0.9rem;
}

.station-info div p {
    font-size: 0.75rem;
    color: var(--subtext-color);
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 40%;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-buttons button {
    background: none;
    border: none;
    color: var(--subtext-color);
    font-size: 1.2rem;
    cursor: pointer;
}

.control-buttons button:hover {
    color: var(--text-color);
}

.play-pause-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--text-color);
    color: #000;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-pause-btn:hover {
    transform: scale(1.05);
}

.volume-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 30%;
}

.volume-controls input[type="range"] {
    -webkit-appearance: none;
    width: 100px;
    height: 4px;
    background: #4d4d4d;
    border-radius: 2px;
    outline: none;
}

.volume-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
}

.volume-controls i {
    color: var(--subtext-color);
}