/* ==========================================================================
   CSS PRINCIPAL - HOMENAGEM ESTILO SPOTIFY
   Aesthetics: Sleek Spotify Dark Theme + Glassmorphism + Romantic Glows
   ========================================================================== */

/* Resets e Configurações Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-base: #121212;
    --bg-surface: #181818;
    --bg-highlight: #282828;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    
    --text-main: #ffffff;
    --text-muted: #b3b3b3;
    --text-sub: #727272;
    
    --spotify-green: #1db954;
    --romantic-pink: #ff416c;
    --romantic-pink-hover: #ff4b2b;
    --love-gradient: linear-gradient(135deg, #1db954 0%, #ff416c 100%);
    
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.3, 0, 0, 1);
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --border-radius-circle: 50%;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-primary);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.5;
}

/* Fundo Dinâmico com Gradiente de Brilho */
.bg-gradient-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 30%, rgba(29, 185, 84, 0.12) 0%, rgba(255, 65, 108, 0.12) 40%, rgba(18, 18, 18, 1) 80%);
    z-index: -1;
    pointer-events: none;
    transition: background 1.5s ease;
}

/* Container Principal */
.spotify-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   1. SEÇÃO DO PLAYER (HERO)
   ========================================================================== */

.player-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 32px 0;
}

.player-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 24px;
}

.spotify-badge {
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.spotify-green {
    color: var(--spotify-green);
    animation: heartPulse 1.8s infinite ease-in-out;
}

/* Estrutura Central do Player */
.player-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

/* Capa do Álbum (Foto do Casal) */
.album-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 32px;
    border-radius: var(--border-radius-lg);
    perspective: 1000px;
}

.album-cover-glow {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    background: var(--love-gradient);
    filter: blur(28px);
    opacity: 0.65;
    z-index: 1;
    border-radius: var(--border-radius-lg);
    transition: var(--transition-smooth);
}

.album-cover-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background-color: var(--bg-surface);
}

.album-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.album-cover-container:hover .album-photo {
    transform: scale(1.04);
}

/* Animação quando a música está tocando */
.playing .album-cover-glow {
    animation: glowPulse 4s infinite alternate ease-in-out;
    opacity: 0.85;
}

/* Detalhes da Faixa (Música e Artista) */
.track-info {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.track-text {
    overflow: hidden;
    padding-right: 16px;
}

.track-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    letter-spacing: -0.5px;
}

.track-artist {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Botão Like */
.btn-like {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-like:hover {
    color: var(--text-main);
    transform: scale(1.1);
}

.btn-like.liked {
    color: var(--romantic-pink) !important;
    animation: heartPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-like.liked svg {
    fill: var(--romantic-pink);
}

/* Controles do Player e Barra de Progresso */
.player-controls {
    width: 100%;
}

/* Barra de Progresso */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 24px;
    user-select: none;
}

.time-display {
    font-size: 11px;
    color: var(--text-sub);
    font-weight: 500;
    min-width: 30px;
    font-variant-numeric: tabular-nums;
}

.progress-bar-bg {
    flex-grow: 1;
    height: 4px;
    background-color: var(--bg-highlight);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height 0.1s ease;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--text-main);
    border-radius: 2px;
    width: 0%;
    position: relative;
    transition: background-color 0.1s ease;
}

.progress-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: var(--border-radius-circle);
    background-color: var(--text-main);
    top: 50%;
    transform: translateY(-50%) translateX(-50%);
    opacity: 0;
    left: 0%;
    transition: opacity 0.1s ease, background-color 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Estados de Hover na Barra de Progresso */
.progress-container:hover .progress-bar-bg {
    height: 6px;
}

.progress-container:hover .progress-bar-fill {
    background: var(--love-gradient);
}

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

/* Botões do Tocador */
.control-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 10px;
}

.btn-secondary {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px;
    border-radius: var(--border-radius-circle);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    color: var(--text-main);
    transform: scale(1.05);
}

.btn-secondary.active {
    color: var(--spotify-green);
    position: relative;
}

.btn-secondary.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background-color: var(--spotify-green);
    border-radius: var(--border-radius-circle);
}

.btn-primary {
    background-color: var(--text-main);
    color: #000;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-circle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
    transform: scale(1.08);
    background-color: #f6f6f6;
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-primary svg {
    width: 22px;
    height: 22px;
    fill: #000;
}

/* Indicador de Scroll */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.8;
    transition: var(--transition-smooth);
    margin-top: auto;
}

.scroll-indicator:hover {
    color: var(--text-main);
    opacity: 1;
}

.scroll-arrow {
    animation: bounceArrow 1.5s infinite ease-in-out;
}

/* ==========================================================================
   2. SEÇÃO DE DETALHES E MEMÓRIAS (SCROLL DOWN)
   ========================================================================== */

.info-section {
    padding: 64px 0 100px;
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.section-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Playlist de Memórias (Spotify Table Style) */
.spotify-table-wrapper {
    overflow-x: auto;
}

.spotify-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.spotify-table th, .spotify-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.spotify-table th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.col-num { width: 50px; text-align: center; }
.col-title { width: 50%; }
.col-location { width: 20%; color: var(--text-muted); font-size: 14px; }
.col-date { width: 20%; color: var(--text-muted); font-size: 14px; }
.col-dur { width: 80px; text-align: right; color: var(--text-muted); }

.track-row {
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.track-row:hover {
    background-color: var(--bg-card-hover);
}

.track-row td:first-child {
    border-top-left-radius: var(--border-radius-md);
    border-bottom-left-radius: var(--border-radius-md);
}

.track-row td:last-child {
    border-top-right-radius: var(--border-radius-md);
    border-bottom-right-radius: var(--border-radius-md);
}

.row-play-icon {
    display: none;
    width: 16px;
    height: 16px;
    margin: 0 auto;
    color: var(--spotify-green);
    fill: var(--spotify-green);
}

.track-row:hover .row-number {
    display: none;
}

.track-row:hover .row-play-icon {
    display: block;
}

.track-meta-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.track-meta-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.track-row.active-row .track-meta-title {
    color: var(--spotify-green);
}

.track-row.active-row .row-number {
    color: var(--spotify-green);
    font-weight: 700;
}

/* Seção de Letras / Carta de Amor (Spotify Lyrics style) */
.lyrics-container {
    background: linear-gradient(180deg, rgba(236, 72, 153, 0.15) 0%, rgba(29, 185, 84, 0.05) 100%);
    border: 1px solid rgba(255, 65, 108, 0.15);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.lyrics-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--romantic-pink);
    margin-bottom: 28px;
}

.lyrics-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.lyric-line {
    font-size: 24px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    transition: var(--transition-smooth);
    cursor: pointer;
    line-height: 1.4;
    letter-spacing: -0.5px;
}

.lyric-line:hover {
    color: var(--text-main);
}

.lyric-line.highlight {
    color: var(--text-main);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    transform: scale(1.01);
}

/* Créditos */
.credits-container {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 40px;
}

.credits-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
}

.credits-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.credit-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.credit-role {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.credit-name {
    font-size: 15px;
    color: var(--text-main);
    font-weight: 600;
}

/* ==========================================================================
   3. POPUPS & INTERAÇÕES EXTRAS
   ========================================================================== */

/* Modal / Popup de Memórias */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 24px;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    max-width: 500px;
    width: 100%;
    background: linear-gradient(135deg, rgba(28, 28, 28, 0.9) 0%, rgba(45, 45, 45, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
}

.modal.open .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-circle);
}

.modal-close:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 40px;
}

.modal-badge {
    color: var(--spotify-green);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

#modalTitle {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.modal-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #000;
    display: none;
}

#modalText {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-emoji {
    font-size: 24px;
}

/* Partícula de Coração Flutuante */
.floating-heart {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    color: var(--romantic-pink);
    font-size: 24px;
    animation: heartFly 1.2s forwards cubic-bezier(0.1, 0.8, 0.3, 1);
}

/* ==========================================================================
   KEYFRAMES / ANIMAÇÕES
   ========================================================================== */

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes glowPulse {
    0% { filter: blur(24px) saturate(1); transform: scale(1); }
    100% { filter: blur(36px) saturate(1.4); transform: scale(1.05); }
}

@keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

@keyframes heartFly {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -180px) scale(1.5) rotate(var(--rot));
    }
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVIDADE)
   ========================================================================== */

@media (max-width: 768px) {
    .spotify-container {
        padding: 0 16px;
    }
    
    .player-section {
        padding: 24px 0;
    }
    
    .album-cover-wrapper {
        margin-bottom: 24px;
    }
    
    .track-title {
        font-size: 20px;
    }
    
    .track-artist {
        font-size: 14px;
    }
    
    .info-section {
        padding: 40px 0 60px;
        gap: 50px;
    }
    
    .section-title {
        font-size: 26px;
    }
    
    .lyrics-container {
        padding: 24px;
    }
    
    .lyric-line {
        font-size: 18px;
    }
    
    /* Ocultar colunas menos cruciais em telas menores */
    .col-location, .col-date {
        display: none;
    }
}

@media (max-height: 700px) and (min-width: 480px) {
    .album-cover-wrapper {
        max-width: 250px;
        margin-bottom: 16px;
    }
}
