:root {
    --bg-dark: #030303;
    --bg-surface: #121212;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.1);
    --primary-color: #ff0000;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --accent: #2196F3;
    --nav-height: 60px;
    --player-height: 70px;
}

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

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;

    /* Ambient Animated Background */
    background: radial-gradient(circle at 10% 20%, rgba(80, 20, 30, 0.5), transparent 60%),
        radial-gradient(circle at 90% 80%, rgba(20, 40, 70, 0.5), transparent 60%),
        var(--bg-dark);
    background-size: 200% 200%;
    animation: ambientPulse 15s ease infinite alternate;
    min-height: 100vh;
}

@keyframes ambientPulse {
    0% {
        background-position: 0% 0%;
    }

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

/* Utils */
.hidden {
    display: none !important;
}

.glass-effect {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
}

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

/* Buttons & Inputs */
.btn-primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 15px 15px 15px 45px;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--text-muted);
}

/* Modals */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    z-index: 1001;
}

.modal-content {
    padding: 30px;
    border-radius: 15px;
    background: #1e1e1e;
}

.modal-content h2 {
    margin-bottom: 25px;
    text-align: center;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-switch span {
    color: var(--text-main);
    cursor: pointer;
    font-weight: bold;
}

/* Top Nav */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    height: var(--nav-height);
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-container {
    flex: 1;
    margin: 0 20px;
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border-radius: 20px;
    padding: 0 15px;
    max-width: 500px;
}

.search-container input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 10px;
    outline: none;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
}

/* Categories (Horizontal Scroll) */
.categories-bar {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 15px 20px;
    scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar {
    display: none;
}

.category-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    border-radius: 15px;
    padding: 8px 16px;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.2s;
}

.category-btn.active {
    background: #fff;
    color: #000;
}

/* Main Area */
.main-content {
    padding: 0 20px calc(var(--player-height) + var(--nav-height) + 20px);
}

.view-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Cards & Grid */
.section-header {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.avatar-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.grid-horizontal {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 20px;
    scrollbar-width: none;
}

.music-card {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

.card-img {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-muted);
}

.music-card h4 {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Jukebox Grid (Search Results) */
.jukebox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.jukebox-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    /* Quadrado perfeito */
    background: #222;
    transition: transform 0.2s;
}

.jukebox-card:hover {
    transform: scale(1.02);
}

.jukebox-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.jukebox-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 10px;
}

/* Home Carousels */
.carousel-section {
    margin-bottom: 30px;
}

.carousel-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.carousel-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.mt-4 {
    margin-top: 1.5rem;
}

.jukebox-card-overlay h4 {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.jukebox-card-overlay p {
    font-size: 0.70rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jukebox-add-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    backdrop-filter: blur(5px);
}

.jukebox-add-btn:active {
    transform: scale(0.8);
}

/* List Vertical (Fallback/Playlists) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--bg-dark);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 90;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    cursor: pointer;
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item.active {
    color: #fff;
}

/* Smart Player Container */
.player-bar {
    position: fixed;
    bottom: var(--nav-height);
    left: 0;
    width: 100%;
    height: var(--player-height);
    background: #1e1e1e;
    z-index: 95;
    display: flex;
    flex-direction: column;
}

.player-progress-container {
    width: 100%;
    height: 3px;
    background: var(--bg-dark);
    cursor: pointer;
}

.player-progress {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.1s linear;
}

.player-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    height: 100%;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    overflow: hidden;
}

.player-thumb {
    width: 45px;
    height: 45px;
    border-radius: 4px;
    object-fit: cover;
    background: #444;
}

.track-text {
    max-width: 150px;
}

.track-text h4 {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.control-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
}

.control-btn.play-btn {
    font-size: 2rem;
}

.control-btn:active {
    transform: scale(0.8);
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-glass);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.toast {
    background: #2a2a2a;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: auto;
    animation: slideInRight 0.3s ease forwards, fadeOut 0.4s ease 3.5s forwards;
    max-width: 300px;
    line-height: 1.4;
}

.toast i {
    font-size: 1.2rem;
}

.toast.error {
    border-left: 4px solid #ff4444;
}

.toast.error i {
    color: #ff4444;
}

.toast.success {
    border-left: 4px solid #00C851;
}

.toast.success i {
    color: #00C851;
}

.toast.info {
    border-left: 4px solid #33b5e5;
}

.toast.info i {
    color: #33b5e5;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(120%);
    }
}