﻿@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-color: #0d0914;
    --glass-bg: rgba(30, 20, 45, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #b052ff;
    --accent-glow: rgba(176, 82, 255, 0.6);
    --text-primary: #ffffff;
    --text-secondary: #a095ad;
    --player-bg: rgba(20, 15, 30, 0.85);
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
}

/* Dynamic Glass Background */
.glass-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 15% 50%, rgba(119, 39, 205, 0.15), transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(45, 118, 230, 0.15), transparent 30%);
    z-index: -1;
    pointer-events: none;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* --------- TOP NAVIGATION --------- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #b052ff, #2dc4ff);
    border-radius: 12px;
    box-shadow: 0 0 15px var(--accent-glow);
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #a095ad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.nav-links ul {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
}

.nav-links li {
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links li:hover,
.nav-links li.active {
    color: var(--text-primary);
}

#searchItem {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

#searchItem:hover,
#searchItem.expanded {
    border-color: var(--glass-border);
    background: rgba(255, 255, 255, 0.1);
}

#searchInput {
    display: none;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    width: 150px;
    font-family: 'Outfit';
    font-size: 15px;
}

#searchItem.expanded #searchText {
    display: none;
}

#searchItem.expanded #searchInput {
    display: inline-block;
}

.icon {
    width: 20px;
    filter: invert(0.8);
}

.icon:hover {
    filter: invert(1);
}

.nav-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.signupbtn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
}

.signupbtn:hover {
    color: white;
}

.loginbtn {
    background: white;
    color: black;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.loginbtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.hamburgerContainer {
    display: none;
    cursor: pointer;
}

/* --------- MAIN CONTENT --------- */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 70px);
}

.center-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    padding-bottom: 150px; /* Space for player */
}

.center-content::-webkit-scrollbar {
    width: 8px;
}

.center-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.hero-section {
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 50px;
    font-weight: 800;
    margin-bottom: 10px;
}

.accent {
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 18px;
}

.spotifyPlaylists h2 {
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 700;
}

.cardContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 15px;
    width: calc(20% - 20px);
    min-width: 180px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.card h2 {
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card p {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.card .play {
    position: absolute;
    bottom: 85px;
    right: 25px;
    width: 45px;
    height: 45px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--accent-glow);
}

.card:hover .play {
    opacity: 1;
    transform: translateY(0);
}

/* --------- RIGHT SIDEBAR --------- */
.library-sidebar {
    width: 320px;
    background: rgba(15, 10, 20, 0.6);
    backdrop-filter: blur(30px);
    border-left: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: transform 0.3s ease;
}

.heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.heading h2 {
    font-size: 18px;
    font-weight: 600;
}

.songlist {
    flex: 1;
    overflow-y: auto;
}

.songlist::-webkit-scrollbar {
    width: 4px;
}

.songlist::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.songlist ul {
    list-style: none;
}

.songlist li {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.songlist li:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--glass-border);
}

.songlist .info {
    flex: 1;
    overflow: hidden;
}

.songlist .info div:first-child {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.songlist .info div:last-child {
    font-size: 12px;
    color: var(--text-secondary);
}

.close-sidebar {
    display: none;
}

/* --------- FLOATING PLAYER --------- */
.now-playing-bar {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1100px;
    background: rgba(20, 15, 30, 0.9);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 15px rgba(176, 82, 255, 0.1);
    overflow: hidden;
}

.songInfoWrapper {
    width: 30%;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
}

#playerCover {
    width: 55px;
    height: 55px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.songInfo {
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.playerControls {
    width: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.playbutton {
    display: flex;
    align-items: center;
    gap: 25px;
}

.playbutton .icon {
    width: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    filter: invert(1);
    opacity: 0.8;
}

.playbutton .icon:hover {
    transform: scale(1.15);
    opacity: 1;
}

.play-btn {
    width: 40px !important;
    background: white;
    padding: 10px;
    border-radius: 50%;
    filter: invert(0) !important;
    opacity: 1 !important;
}

.play-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 0 15px var(--accent-glow);
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.songTime {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    min-width: 90px;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.seekbar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.circle {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    box-shadow: 0 0 12px var(--accent-glow);
    transition: left 0.1s linear;
}

.volumeControl {
    width: 25%;
    display: flex;
    justify-content: flex-end;
}

.volume {
    display: flex;
    align-items: center;
    gap: 12px;
}

.range input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* --------- RESPONSIVE DESIGN --------- */
@media (max-width: 1000px) {
    .library-sidebar {
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        z-index: 200;
        background: rgba(15, 10, 20, 0.95);
    }

    .library-sidebar.left {
        left: -100%;
    }

    .hamburgerContainer,
    .close-sidebar {
        display: block;
        cursor: pointer;
    }

    .close-sidebar {
        position: absolute;
        top: 20px;
        right: 20px;
    }

    .nav-links {
        display: none;
    }

    .card {
        width: calc(33.33% - 20px);
    }

    .now-playing-bar {
        width: 95%;
        flex-wrap: wrap;
        padding: 15px;
        bottom: 15px;
        border-radius: 20px;
    }

    .songInfoWrapper,
    .volumeControl {
        display: none;
    }

    .playerControls {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .card {
        width: calc(50% - 10px);
    }

    .hero-section h1 {
        font-size: 32px;
    }
}

/* --------- AUTH PAGES (Login/Signup) --------- */
.auth-body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 50px 40px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: authFadeIn 0.8s ease-out;
    margin: 20px;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card .logo-area {
    justify-content: center;
    margin-bottom: 30px;
}

.auth-card h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 700;
}

.auth-card p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 5px;
}

.auth-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px 20px;
    color: white;
    font-family: 'Outfit';
    font-size: 16px;
    transition: all 0.3s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(176, 82, 255, 0.2);
}

.auth-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 15px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    box-shadow: 0 10px 20px var(--accent-glow);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px var(--accent-glow);
}

.auth-footer {
    margin-top: 30px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: white;
}

/* --------- AUTH UI (In main app) --------- */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 15px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px var(--accent-glow);
}

.user-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.logoutbtn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logoutbtn:hover {
    color: #ff4d4d;
}

/* --------- TOAST NOTIFICATIONS --------- */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translate(-50%, -50px);
    background: #1e1e2e;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

.toast-success .toast-icon { background: #00c853; }
.toast-error .toast-icon { background: #ff3d00; }

.auth-footer p {
    margin-bottom: 5px;
/* --------- MODAL SYSTEM --------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(30, 20, 50, 0.8);
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 32px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.modal-content h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: white;
}

.modal-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.modal-btn {
    background: #b052ff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 0 20px rgba(176, 82, 255, 0.3);
}

.modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(176, 82, 255, 0.5);
}

/* --------- AUTH ALTERNATIVE BUTTONS --------- */
.signup-alt-btn {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 10px 24px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
    font-family: "Outfit";
}

.signup-alt-btn:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}
