:root {
    --spotify-green: #1DB954;
    --spotify-black: #191414;
    --spotify-dark: #121212;
    --spotify-light-dark: #181818;
    --spotify-gray: #535353;
    --spotify-light-gray: #B3B3B3;
    --spotify-white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--spotify-dark);
    color: var(--spotify-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Estilo para o botão de toggle do Sidebar no Header */
.sidebar-toggle-button {
    font-size: 20px;
    padding: 5px 8px;
}
.sidebar-toggle-button:hover {
    color: var(--spotify-green);
    transform: scale(1.1);
}

/* Estilos do Sidebar */
.sidebar {
    height: 100%;
    width: 280px;
    position: fixed;
    top: 0;
    left: -300px;
    background-color: var(--spotify-black);
    overflow-x: hidden;
    transition: left 0.3s ease-in-out;
    z-index: 200;
    padding-top: 20px;
    border-right: 1px solid var(--spotify-gray);
}

.sidebar.open {
    left: 0;
}

.sidebar-title {
    padding: 0 25px 15px 25px;
    font-size: 22px;
    color: var(--spotify-white);
    border-bottom: 1px solid var(--spotify-gray);
    margin-bottom: 15px;
}

.sidebar-close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    background: none;
    border: none;
    color: var(--spotify-light-gray);
    cursor: pointer;
    transition: color 0.2s ease;
}
.sidebar-close-button:hover {
    color: var(--spotify-white);
}

.sidebar-nav {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li .sidebar-link {
    padding: 12px 25px;
    text-decoration: none;
    font-size: 16px;
    color: var(--spotify-light-gray);
    display: block;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav li .sidebar-link:hover {
    background-color: var(--spotify-light-dark);
    color: var(--spotify-white);
}
.sidebar-nav li .sidebar-link.active-link {
    color: var(--spotify-green);
    border-left-color: var(--spotify-green);
    background-color: rgba(29, 185, 84, 0.1);
}

/* Overlay para o conteúdo principal */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 199;
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.container-fluid {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Header */
.header {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--spotify-white);
}

.logo span {
    color: var(--spotify-green);
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--spotify-white);
    border-radius: 20px;
    padding: 5px 15px;
    width: 300px;
}

.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 5px;
    outline: none;
    color: var(--spotify-black);
}

.search-bar i {
    color: var(--spotify-gray);
    margin-right: 10px;
}

/* Main Content */
.main-content {
    padding: 20px 30px;
    flex: 1;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.radio-card {
    background-color: var(--spotify-light-dark);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.radio-card:hover {
    background-color: var(--spotify-gray);
    transform: translateY(-5px);
}

.radio-card.active {
    background-color: var(--spotify-green);
}

.radio-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.radio-name {
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radio-genre {
    font-size: 14px;
    color: var(--spotify-light-gray);
}

.play-icon {
    position: absolute;
    right: 15px;
    bottom: 15px;
    background-color: var(--spotify-green);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    transform: translateY(10px);
}

.radio-card:hover .play-icon {
    opacity: 1;
    transform: translateY(0);
}

.radio-card.active .play-icon {
    opacity: 1;
    transform: translateY(0);
    background-color: var(--spotify-white);
    color: var(--spotify-black);
}

/* Now Playing Bar */
.now-playing-bar {
    background-color: var(--spotify-light-dark);
    border-top: 1px solid var(--spotify-gray);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 25%;
}

.track-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.track-details {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.track-details h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-details p {
    font-size: 14px;
    color: var(--spotify-light-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50%;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.control-button {
    background: none;
    border: none;
    color: var(--spotify-white); 
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease; 
}

.control-button:not(.play-button):not(.like-button):not(.dislike-button):not(.favorite-button):hover {
    color: var(--spotify-green);
    transform: scale(1.1);
}

.control-button.like-button:hover,
.control-button.dislike-button:hover {
    transform: scale(1.1); 
}

.play-button {
    background-color: var(--spotify-white);
    color: var(--spotify-black); 
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.play-button:hover {
    transform: scale(1.05);
    color: var(--spotify-black); 
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-time {
    font-size: 12px;
    color: var(--spotify-light-gray);
    min-width: 40px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background-color: var(--spotify-gray);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    background-color: var(--spotify-green);
    border-radius: 2px;
    width: 0%;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: var(--spotify-white);
    border-radius: 50%;
    transform: translate(50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 25%;
    justify-content: flex-end;
}

.volume-icon {
    color: var(--spotify-light-gray);
    cursor: pointer;
}

.volume-bar {
    width: 100px;
    height: 4px;
    background-color: var(--spotify-gray);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-progress {
    height: 100%;
    background-color: var(--spotify-white);
    border-radius: 2px;
    width: 50%;
}

/* Loading Animation */
.loading-animation {
    display: flex;
    gap: 4px;
    height: 16px;
    align-items: flex-end;
}

.loading-bar {
    width: 3px;
    background-color: var(--spotify-green);
    animation: loading 1.2s infinite ease-in-out;
}

.loading-bar:nth-child(1) { animation-delay: 0s; height: 8px; }
.loading-bar:nth-child(2) { animation-delay: 0.2s; height: 12px; }
.loading-bar:nth-child(3) { animation-delay: 0.4s; height: 16px; }
.loading-bar:nth-child(4) { animation-delay: 0.6s; height: 12px; }
.loading-bar:nth-child(5) { animation-delay: 0.8s; height: 8px; }

@keyframes loading {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.5); }
}

/* Hidden elements */
audio { display: none; }

/* Estilos para Like/Dislike e Favoritos */
.control-button.like-button.active { color: var(--spotify-green); }
.control-button.dislike-button.active { color: #FF6347; }
.favorite-button {
    flex-shrink: 0;
    padding: 5px 8px; 
    font-size: 18px;  
    line-height: 1;   
    color: var(--spotify-light-gray);
}
.favorite-button:not(.active):hover {
    color: var(--spotify-white);
    transform: scale(1.1);
}
.favorite-button.active { color: var(--spotify-green); }
.favorite-button.active:hover {
    color: var(--spotify-green);
    transform: scale(1.1);
}

/* ===== NOVOS ESTILOS PARA MENU HORIZONTAL MOBILE ===== */
.mobile-nav-menu {
    display: none; /* Oculto por padrão */
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 15px;
    padding: 5px 0;
    margin-top: 10px;
}

/* Oculta a barra de rolagem */
.mobile-nav-menu::-webkit-scrollbar {
    display: none;
}

.mobile-nav-list {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    padding: 0 10px;
    margin: 0;
    gap: 10px;
}

.mobile-nav-link {
    display: block;
    padding: 8px 16px;
    color: var(--spotify-light-gray);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 20px;
    transition: all 0.2s ease-in-out;
    background-color: var(--spotify-light-dark);
    border: 1px solid var(--spotify-gray);
}

.mobile-nav-link:hover {
    background-color: var(--spotify-gray);
    color: var(--spotify-white);
}

/* Classe ativa para o link do menu mobile */
.mobile-nav-link.active-link {
    background-color: var(--spotify-green);
    color: var(--spotify-white);
    border-color: var(--spotify-green);
}

/* Responsive */
@media (max-width: 992px) {
    .radio-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .track-info, .volume-controls { width: 30%; }
    .player-controls { width: 40%; }
}

/* ===== BLOCO RESPONSIVO MODIFICADO ===== */
@media (max-width: 768px) {
    .header {
        flex-direction: column; 
        align-items: stretch;
        gap: 15px; 
        padding: 15px; 
    }

    .user-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 15px;
    }

    #sidebar-toggle-button {
        display: block;
        flex-shrink: 0;
    }

    .search-bar {
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        padding: 5px;
        background-color: transparent;
        border-radius: 25px;
        cursor: pointer;
        overflow: hidden;
        transition: width 0.4s ease-in-out, background-color 0.4s ease-in-out;
        position: relative;
    }

    .search-bar input {
        width: 0;
        padding: 0;
        border: none;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .search-bar i {
        color: var(--spotify-white);
        margin-right: 0;
        font-size: 18px;
    }

    .search-bar.active {
        width: 100%;
        background-color: var(--spotify-white);
        cursor: default;
        padding: 5px 15px;
        justify-content: flex-start;
    }

    .search-bar.active input {
        width: 100%;
        opacity: 1;
        padding: 5px;
        color: var(--spotify-black);
        transition: opacity 0.3s ease-in-out 0.2s;
    }

    .search-bar.active i {
        color: var(--spotify-gray);
        margin-right: 10px;
        cursor: pointer;
    }

    .main-content { 
        padding: 15px 15px 200px; /* MODIFICADO: Adicionado espaçamento inferior para não sobrepor o player */
    }

    .radio-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; }
    
    .now-playing-bar { 
        position: fixed; /* MODIFICADO: Posição fixada no rodapé */
        left: 0;
        right: 0;
        flex-direction: column; 
        padding: 10px 15px; 
    }

    .track-info, .player-controls, .volume-controls { width: 100%; }
    .track-info { margin-bottom: 10px; }
    .volume-controls { margin-top: 10px; justify-content: center; }
    .favorite-button { 
        padding: 5px; font-size: 16px;
    }
    .mobile-nav-menu {
        display: block;
    }
}