/* =========================================
   VARIÁVEIS E BASE
   ========================================= */
:root {
    --bg-dark: #0c0b10;
    --bg-card: #181524;
    --accent-gold: #ffd700;
    --accent-green: #1db954;
    --text-main: #ffffff;
    --text-muted: #a09cb0;
    --border-color: #2b263e;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    overflow: hidden; /* Mantém a tela fixa para o app rolar por dentro */
}

.hidden {
    display: none !important;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* =========================================
   TELA DE LOGIN
   ========================================= */
.login-screen-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1625, var(--bg-dark));
}

.login-card-visual {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    text-align: center;
    width: 100%;
    max-width: 350px;
}

.login-brand-header h1 {
    margin: 10px 0 0 0;
    color: var(--accent-gold);
    font-size: 28px;
    letter-spacing: 2px;
}

.subtitle-music {
    font-size: 14px;
    letter-spacing: 5px;
    color: var(--text-muted);
}

.login-slogan {
    font-size: 11px;
    margin-bottom: 30px;
    color: var(--text-muted);
}

.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    box-sizing: border-box;
    outline: none;
}

.btn-login-neon {
    width: 100%;
    padding: 12px;
    background: var(--accent-gold);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 10px;
    transition: 0.3s;
}

.btn-login-neon:hover {
    background: #e6c200;
}

.login-footer-info {
    margin-top: 20px;
    font-size: 10px;
    color: var(--text-muted);
}

/* =========================================
   ESTRUTURA DO APP (SIDEBAR E MAIN)
   ========================================= */
.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-logo {
    padding: 0 20px 20px 20px;
}

.sidebar-logo h2 {
    margin: 0;
    color: var(--accent-gold);
    font-size: 20px;
}

.sidebar-logo span {
    color: var(--text-main);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nav-item {
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: #15121e;
    border-left-color: var(--accent-gold);
}

.sidebar-user {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
}

.user-info {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
}

.btn-logout:hover { color: #ff4d4d; }

.main-content {
    flex: 1;
    background: linear-gradient(to bottom, #1a1625, var(--bg-dark));
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px;
}

/* =========================================
   TOP BAR E BUSCA
   ========================================= */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-main);
    box-sizing: border-box;
    outline: none;
}

.filter-select {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}

.filter-select:hover {
    border-color: var(--accent-gold);
}

.pro-badge {
    background: var(--accent-green);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
}

.view-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================================
   CARDS E GRIDS
   ========================================= */
.content-view { display: none; }
.content-view.active { display: block; }

.spotify-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.spotify-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    transition: background 0.3s;
    border: 1px solid transparent;
}

.spotify-card:hover {
    background: #221e33;
    border-color: var(--border-color);
}

.card-actions-flex {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.action-btn-play, .action-btn-add, .action-btn-heart {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    padding: 5px 0;
}

.action-btn-play:hover { color: var(--text-main); }
.action-btn-add:hover { color: var(--accent-gold); }
.action-btn-heart:hover { color: #ff4d4d; }

.btn-primary-action {
    background: var(--accent-gold);
    color: #000;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 13px;
}

/* =========================================
   FILA DE REPRODUÇÃO E ADMIN
   ========================================= */
.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.admin-panel-wrapper {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
}

.drop-zone-spotify {
    border: 2px dashed var(--border-color);
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    background: #12101a;
    position: relative;
}

.drop-zone-spotify input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}

/* =========================================
   MODAL DE PLAYLIST
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 350px;
    border: 1px solid var(--border-color);
}

.modal-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.modal-list-item {
    padding: 12px;
    border-bottom: 1px solid #2b263e;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px;
}

.modal-list-item:hover {
    background: #221e33;
    border-color: var(--accent-gold);
}

/* =========================================
   PLAYER FIXO
   ========================================= */
.spotify-player-bar {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 80px;
    background: #12101a;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
}

.now-playing-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 300px;
}

.album-art-placeholder {
    width: 50px;
    height: 50px;
    background: #2b263e;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.album-art-placeholder img { width: 100%; height: 100%; border-radius: 4px; object-fit: cover; }

.player-center-controls {
    flex: 1;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.player-buttons button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    margin: 0 10px;
}
.player-buttons button:hover { color: var(--text-main); }
.play-pause-btn i { font-size: 24px; color: var(--text-main); }

.player-progress-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-size: 11px;
    color: var(--text-muted);
}

.progress-track {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gold);
    border-radius: 2px;
}

.player-right-options {
    width: 300px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

/* =========================================
   CONFIGURAÇÃO DA LOGOMARCA EM IMAGEM
   ========================================= */
.brand-logo-login {
    width: 180px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 10px auto;
}

.brand-logo-sidebar {
    width: 140px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* =========================================
   DESIGN MOBILE - ROLAGEM CORRIGIDA
   ========================================= */
@media (max-width: 768px) {
    .app-container { 
        flex-direction: column; 
        height: 100vh; 
    }
    
    .sidebar {
        width: 100%; height: auto; padding: 15px 10px; flex-direction: column;
        border-right: none; border-bottom: 1px solid var(--border-color);
        box-sizing: border-box;
    }

    .sidebar-logo { text-align: center; margin-bottom: 15px; padding: 0; }
    
    .brand-logo-sidebar {
        margin: 0 auto;
    }

    .sidebar-nav {
        display: flex; 
        overflow-x: auto; 
        white-space: nowrap; 
        gap: 10px; 
        flex-direction: row; 
        padding-bottom: 5px;
        scrollbar-width: none; 
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar-nav::-webkit-scrollbar { display: none; }

    .nav-item { 
        padding: 8px 16px; 
        font-size: 13px; 
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        border-left: none;
    }
    
    .nav-item.active { 
        background: var(--accent-gold); 
        color: #000;
        border-color: var(--accent-gold);
    }

    .sidebar-user { margin-top: 15px; padding: 10px 10px 0 10px; justify-content: space-between; }

    .main-content { 
        flex: 1;
        overflow-y: auto; 
        padding: 15px; 
        padding-bottom: 160px; 
    }

    .top-bar { flex-direction: column; gap: 10px; height: auto; padding: 10px 0; }
    
    .search-box { max-width: 100%; }
    .search-box input { border-radius: 10px; }
    
    .view-header-flex { flex-direction: column; align-items: flex-start; gap: 10px; }
    
    #view-inicio .view-header-flex .search-box {
        width: 100% !important;
        max-width: 100% !important;
    }

    .spotify-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }

    .spotify-player-bar {
        flex-direction: column; 
        height: auto; 
        padding: 12px; 
        gap: 10px;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.6);
    }

    .now-playing-meta, .player-center-controls { width: 100%; justify-content: space-between; }
    
    .now-playing-meta { justify-content: flex-start; gap: 12px; }
    .album-art-placeholder { width: 45px; height: 45px; border-radius: 6px; }

    #player-track-title {
        max-width: 150px !important;
    }

    .player-center-controls { max-width: 100%; }
    
    .player-buttons button { margin: 0 15px; font-size: 18px; }
    .play-pause-btn i { font-size: 28px; }
    
    .player-right-options { display: none; }
    
    .admin-card-form form { flex-direction: column; }
}