@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* ========================================
       ZINC / MODERN DARK PALETTE
       ======================================== */
    --bg-page: #09090b;
    /* Zinc 950 - Deeper black */
    --bg-card: rgba(24, 24, 27, 0.6);
    /* Zinc 900 / 60% */
    --bg-card-hover: rgba(39, 39, 42, 0.7);
    /* Zinc 800 / 70% */

    --border-light: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #FAFAFA;
    /* Zinc 50 */
    --text-secondary: #A1A1AA;
    /* Zinc 400 */
    --text-muted: #52525B;
    /* Zinc 600 */

    /* Spotify/Accent Green - Enhanced */
    --accent-primary: #22c55e;
    /* Green 500 - slightly more vibrant than classic Spotify */
    --accent-hover: #16a34a;
    /* Green 600 */
    --accent-glow: rgba(34, 197, 94, 0.4);

    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-full: 9999px;

    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    /* Aurora Background Effect */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(34, 197, 94, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(63, 63, 70, 0.15) 0%, transparent 40%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* ========================================
   UTILITIES (Glassmorphism & New Components)
   ======================================== */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========================================
   HEADER
   ======================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: rgba(9, 9, 11, 0.8);
    /* Semi-transparent bg for sticky */
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 32px;
}

/* ... skipped lines ... */
/* Sliders */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    transition: transform 0.1s;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: white;
}

.brand-title span {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: white;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -28px;
    /* Align with header border */
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 6px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    transition: background 0.2s;
}

.user-pill:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   MAIN LAYOUT
   ======================================== */
.main-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 32px 80px;
}

/* Sidebar Styles */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    /* Sticky sidebar */
    top: 120px;
    height: fit-content;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    padding-left: 4px;
}

/* Saved Profiles Grid */
.saved-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.profile-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.profile-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-md);
}

.profile-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* History List */
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   SEARCH SECTION
   ======================================== */
.hero-section {
    margin-bottom: 40px;
}

.search-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 8px;
    display: flex;
    align-items: center;
    max-width: 680px;
    transition: all 0.2s;
    box-shadow: 0 0 0 4px transparent;
}

.search-container:focus-within {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 12px 20px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-body);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.btn-search {
    background: var(--accent-primary);
    color: black;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px 32px;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}

.btn-search:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.4);
}

.btn-search:active {
    transform: translateY(0);
}

.btn-search:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Reinforced Save Profile Button */
button.btn-save-profile,
.btn-save-profile {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: 9999px;
    /* Explicit full radius */
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-transform: none;
    /* Prevent browser defaults */
    line-height: normal;
}

button.btn-save-profile:hover,
.btn-save-profile:hover,
.btn-save-profile.saved {
    background: var(--accent-primary);
    color: black;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

button.btn-save-profile i {
    font-size: 1rem;
}

.last-track-pill {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
}

.last-track-pill i {
    color: var(--accent-primary);
    font-size: 0.65rem;
}

/* Bloco visível de última track abaixo do título */
.last-track-info-inner {
    margin: 4px 0 10px;
    padding: 6px 8px;
    border-left: 2px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.04);
    border-radius: 0 4px 4px 0;
}

.last-track-name {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    margin-bottom: 2px;
}

.last-track-date {
    font-size: 0.67rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}


/* ========================================
   PROFILE HERO (Social card)
   ======================================== */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px 32px;
    border-radius: var(--radius-xl);
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

/* Fundo decorativo sutil */
.profile-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

/* Avatar wrapper com anel */
.profile-hero-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-hero-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 3px #09090b, 0 0 0 5px var(--accent-primary), 0 8px 24px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-hero-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px #09090b, 0 0 0 5px var(--accent-primary), 0 0 30px rgba(34, 197, 94, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Indicador verde de "online" no canto */
.profile-hero-avatar-ring {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid #09090b;
    z-index: 2;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* Info do perfil */
.profile-hero-info {
    flex: 1;
    min-width: 0;
}

.profile-hero-name {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.profile-hero-followers {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-hero-followers i {
    color: var(--accent-primary);
}

/* Stats inline */
.profile-hero-stats {
    display: flex;
    gap: 24px;
}

.profile-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.profile-hero-stat span {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.profile-hero-stat small {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* Ações (botões) */
.profile-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .profile-hero {
        flex-wrap: wrap;
        padding: 20px;
    }

    .profile-hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .profile-hero-name {
        font-size: 1.3rem;
    }
}

/* ========================================
   RESULTS / PLAYLISTS
   ======================================== */
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.playlist-card {
    /* Uses .glass-card styles + specific content */
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cover-wrapper {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg);
}

.no-cover {
    width: 100%;
    height: 100%;
    background: #18181b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-cover i {
    color: var(--text-muted);
    font-size: 2.5rem;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.cover-wrapper:hover .card-overlay {
    opacity: 1;
}

.card-overlay i {
    background: var(--accent-primary);
    color: black;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transform: translateY(8px);
    transition: transform 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.cover-wrapper:hover .card-overlay i {
    transform: translateY(0);
}

.cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.playlist-card:hover img {
    transform: scale(1.08);
    /* Subtle Zoom */
}

.card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-card:hover .card-title {
    color: var(--accent-primary);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.btn-card-action {
    margin-top: auto;
    display: block;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.btn-card-action:hover {
    background: white;
    color: black;
}

/* ========================================
   MODALS
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    /* Darker backdrop */
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: #09090b;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 800px;
    /* Wider Default */
    width: 90%;
    margin: 80px auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    max-height: 85vh;
    overflow-y: auto;
}

/* Custom Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 4px;
}

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal:hover {
    background: white;
    color: black;
}

/* Track Items inside Modal */
.track-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.track-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.track-number {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    width: 24px;
    text-align: center;
}

.btn-preview {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-preview:hover,
.btn-preview.playing {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: black;
}

.btn-lyrics {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    transition: all 0.2s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-lyrics:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* ========================================
   MOODIFY SPECIFIC
   ======================================== */
.mood-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}

.mood-item {
    cursor: pointer;
    text-align: center;
    padding: 24px 16px;
    border: 2px solid transparent;
}

.mood-item.active {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--accent-primary);
}

.mood-item i {
    transition: transform 0.3s;
}

.mood-item:hover i {
    transform: scale(1.2) rotate(-5deg);
}

/* Sliders */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #3f3f46;
    border-radius: 2px;
}

/* ========================================
   LOADER & ALERTS
   ======================================== */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state-large {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-xl);
    border: 1px dashed var(--border-light);
}

.highlight {
    color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-section {
        position: relative;
        top: 0;
        margin-bottom: 40px;
    }
}

/* ========================================
   TABS & MINI PLAYER
   ======================================== */
.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: var(--bg-card);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.1);
}

.mini-player {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-xl);
    z-index: 100;
    transform: translateY(150%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-width: 320px;
}

.mini-player.show {
    transform: translateY(0);
}

.player-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.player-info {
    flex: 1;
    overflow: hidden;
}

.player-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-status {
    font-size: 0.75rem;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-status::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.mini-player button {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mini-player button:hover {
    background: white;
    color: black;
}

/* ========================================
   STATS BAR
   ======================================== */
.stats-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    flex: 1;
    min-width: 100px;
    transition: background 0.2s;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* ========================================
   PLAYLIST TOOLBAR
   ======================================== */
.pl-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.search-mini-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    transition: all 0.2s;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

.search-mini-wrapper:focus-within {
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.search-mini-wrapper i {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.search-mini {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 0.88rem;
    font-family: var(--font-body);
    width: 100%;
}

.search-mini::placeholder {
    color: var(--text-muted);
}

.sort-group {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    padding: 4px;
}

.sort-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-body);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sort-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

.sort-btn.active {
    background: var(--accent-primary);
    color: black;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

/* ========================================
   MOOD FILTER CHIPS
   ======================================== */
.mood-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.mood-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-body);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.18s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mood-chip:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
}

.mood-chip.active {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ========================================
   PLAYLISTS HEADER
   ======================================== */
.playlists-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.header-info h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 4px;
}

/* ========================================
   COPY LINK BUTTON (card)
   ======================================== */
.btn-copy-pl {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.75rem;
    border-radius: 4px;
    transition: color 0.2s;
    line-height: 1;
}

.btn-copy-pl:hover {
    color: var(--accent-primary);
}

/* ========================================
   TRACK SEARCH BAR (inside modal)
   ======================================== */
.track-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: 4px;
    transition: border-color 0.2s;
}

.track-search-bar:focus-within {
    border-color: var(--accent-primary);
}

.track-search-bar i {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.track-search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 0.9rem;
    font-family: var(--font-body);
    width: 100%;
}

.track-search-bar input::placeholder {
    color: var(--text-muted);
}

/* ========================================
   SKELETON ANIMATION
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   CARD FADE-IN
   ======================================== */
.playlist-card {
    animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE TOOLBAR
   ======================================== */
@media (max-width: 768px) {
    .pl-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-mini-wrapper {
        max-width: 100%;
    }

    .stats-bar {
        gap: 8px;
    }

    .stat-item {
        padding: 10px 14px;
    }

    .stat-value {
        font-size: 1.2rem;
    }
}

/* ========================================
   SPOTIFY EMBED PANEL (inline no modal)
   ======================================== */
.embed-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.35s ease,
        opacity 0.25s ease;
    opacity: 0;
    margin-bottom: 0;
    overflow: hidden;
}

.embed-panel.open {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-bottom: 20px;
}

/* Wrapper interno necessário para grid-template-rows funcionar */
.embed-panel-inner {
    overflow: hidden;
}

.embed-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    background: rgba(30, 215, 96, 0.06);
    border: 1px solid rgba(30, 215, 96, 0.2);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.embed-panel-track {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.embed-track-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.embed-track-artist {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.embed-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-left: 12px;
    transition: all 0.2s;
}

.embed-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.embed-iframe-wrapper {
    border: 1px solid rgba(30, 215, 96, 0.2);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
    background: #000;
    line-height: 0;
}

/* Linha ativa no modal ao abrir embed */
.track-item.embed-active {
    background: rgba(30, 215, 96, 0.07);
    border-left: 3px solid var(--accent-primary);
    padding-left: 13px;
}

/* Botão embed ativo */
.btn-embed.active {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: black !important;
}

/* ========================================
   UI/UX PRO MAX — MELHORIAS DE QUALIDADE
   ======================================== */

/* --- Cursor pointer em todos elementos interativos --- */
.playlist-card,
.profile-card,
.history-item,
.mood-item,
.mood-chip,
.sort-btn,
.btn-copy-pl,
.track-item,
.mood-tag {
    cursor: pointer;
}

/* --- Focus states visíveis para teclado (acessibilidade WCAG AA) --- */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

/* Sem outline padrão feio (apenas quando via teclado) */
:focus:not(:focus-visible) {
    outline: none;
}

/* --- Skeleton com animação shimmer adequada --- */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.10) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-card {
    pointer-events: none;
}

/* --- Hover feedback mais rico nos playlist cards --- */
.playlist-card {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.25s;
}

.playlist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.2);
}

/* Sort btn hover/active mais nítido */
.sort-btn {
    transition: all 0.18s ease;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

/* Mood chip activo */
.mood-chip {
    transition: all 0.18s ease;
}

.mood-chip:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: var(--accent-primary);
}

/* --- prefers-reduced-motion: desabilita animações decorativas --- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Mantém spinner funcional pois indica carregamento */
    .spinner {
        animation-duration: 0.8s !important;
        animation-iteration-count: infinite !important;
    }
}

/* --- Touch targets mínimos 44px no mobile (WCAG 2.5.5) --- */
@media (max-width: 768px) {

    .btn-preview,
    .btn-lyrics,
    .btn-embed,
    .btn-copy-pl,
    .close-modal,
    .sort-btn,
    .mood-chip,
    .tab-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Linha de track no mobile: mais espaço para toque */
    .track-item {
        padding: 14px 12px;
    }

    /* Cards de playlist maiores no mobile */
    .playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    /* Toolbar com scroll horizontal no mobile */
    .pl-toolbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .sort-group {
        flex-wrap: nowrap;
    }
}

/* ========================================
   MOODIFY 2.0 — Dashboard Styles
   ======================================== */

.m2-profile-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.m2-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
}

.m2-profile-btn img,
.m2-profile-avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #27272a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.m2-profile-btn:hover {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
    color: #fff;
}

.m2-profile-btn.active {
    background: rgba(34, 197, 94, 0.12);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.m2-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
    border-radius: var(--radius-xl);
    min-height: 400px;
}

.m2-empty-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    filter: grayscale(0.3);
}

.m2-empty-state h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
}

.m2-empty-state p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 320px;
    line-height: 1.6;
}

.m2-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
    border-radius: var(--radius-xl);
    min-height: 400px;
}

.m2-loading h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 24px 0 8px;
}

.m2-loading p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 32px;
}

.m2-progress-bar {
    width: 280px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.m2-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #4ade80);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
}

.m2-analyzed-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
}

.m2-analyzed-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px #09090b, 0 0 0 5px var(--accent-primary);
    flex-shrink: 0;
}

.m2-analyzed-stats {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.m2-analyzed-stats span {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
}

.m2-cache-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
}

.m2-cache-fresh {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--accent-primary);
}

.m2-vibe-card {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 28px 32px;
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.06) 0%, transparent 60%);
    border: 1px solid rgba(34, 197, 94, 0.15);
    position: relative;
    overflow: hidden;
}

.m2-vibe-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.m2-vibe-emoji {
    font-size: 3.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 16px rgba(34, 197, 94, 0.4));
}

.m2-vibe-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    margin-bottom: 4px;
}

.m2-vibe-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.m2-vibe-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 14px;
}

.m2-vibe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.m2-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--accent-primary);
}

.m2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.m2-card {
    padding: 24px;
    border-radius: var(--radius-xl);
}

.m2-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.m2-card-title i {
    color: var(--accent-primary);
}

.m2-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.m2-artists-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.m2-artist-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.m2-artist-rank {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.m2-artist-info {
    flex: 1;
    min-width: 0;
}

.m2-artist-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.m2-artist-bar-wrap {
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.m2-artist-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #4ade80);
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.m2-artist-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.m2-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.m2-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.m2-bar-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 110px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m2-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.m2-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #86efac);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.m2-bar-pct {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.m2-signature {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 28px;
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.07) 0%, transparent 60%);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.m2-sig-icon {
    font-size: 2rem;
    color: #fbbf24;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.4));
}

.m2-sig-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.m2-sig-artist {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.m2-sig-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 9999px;
    color: #fbbf24;
    white-space: nowrap;
    flex-shrink: 0;
}

.m2-timeline-card {
    margin-bottom: 20px;
}

.m2-heatmap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.m2-heat-cell {
    width: calc((100% - 23*4px)/24);
    min-width: 20px;
    aspect-ratio: 1;
    border-radius: 3px;
    position: relative;
    cursor: default;
    transition: transform 0.15s;
}

.m2-heat-cell:hover {
    transform: scale(1.3);
    z-index: 2;
}

.m2-heat-0 {
    background: rgba(255, 255, 255, 0.04);
}

.m2-heat-1 {
    background: rgba(34, 197, 94, 0.2);
}

.m2-heat-2 {
    background: rgba(34, 197, 94, 0.4);
}

.m2-heat-3 {
    background: rgba(34, 197, 94, 0.65);
}

.m2-heat-4 {
    background: rgba(34, 197, 94, 0.9);
}

.m2-heat-label {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    color: var(--text-muted);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
}

.m2-heat-cell:hover .m2-heat-label {
    opacity: 1;
}

.m2-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

@media (max-width: 768px) {
    .m2-grid {
        grid-template-columns: 1fr;
    }

    .m2-vibe-card {
        flex-direction: column;
    }

    .m2-analyzed-header {
        flex-wrap: wrap;
    }

    .m2-heat-cell {
        min-width: 14px;
    }
}