:root {
    --bg-dark: #050505;
    --bg-panel: #121212;
    --primary: #00f3ff;
    --secondary: #bc13fe;
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 100px;
    /* Space for player */
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    padding-bottom: 5px;
}

.highlight {
    color: var(--primary);
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.5);
}

.badge {
    font-size: 0.8rem;
    background: var(--secondary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 8px;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

.cta-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 12px 30px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    clip-path: polygon(10% 0, 100% 0, 100% 80%, 90% 100%, 0 100%, 0 20%);
}

.cta-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 16px;
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.secondary-btn:hover {
    background: rgba(0, 243, 255, 0.1);
}

.full-width {
    width: 100%;
}

/* Header */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--text-main);
    white-space: nowrap;
    /* Prevent logo wrapping */
    display: flex;
    align-items: center;
}

.nav-btn {
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    margin-left: 1rem;
    position: relative;
}

.nav-btn.active,
.nav-btn:hover {
    color: var(--text-main);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.lang-switcher {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-family: var(--font-heading);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.3s;
}

.lang-btn:hover {
    color: var(--text-main);
}

.lang-btn.active-lang {
    color: var(--primary);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.4);
}

.divider {
    margin: 0 4px;
    opacity: 0.5;
}

/* Mobile Header Adjustments */
@media (max-width: 600px) {
    .glass-header {
        padding: 0.8rem 1rem;
        /* Compact padding */
    }

    .logo {
        font-size: 1.4rem;
        /* Smaller logo */
    }

    .badge {
        font-size: 0.7rem;
        padding: 2px 4px;
        margin-left: 6px;
    }

    .nav-btn {
        font-size: 1rem;
        padding: 0.4rem 0.6rem;
        margin-left: 0.5rem;
    }

    .lang-switcher {
        margin-left: 0.8rem;
        font-size: 0.8rem;
    }
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    padding: 2rem 5%;
    position: relative;
    overflow: hidden;
    gap: 2rem;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
}

.hero p {
    color: var(--text-dim);
    margin: 1.5rem 0 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding-top: 6rem;
        /* Space for fixed header */
        min-height: auto;
    }

    .hero-content {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    .hero-visual {
        width: 100%;
        margin-bottom: 1rem;
        order: -1;
        /* Force to top */
    }

    .hero-visual img {
        max-width: 90% !important;
        /* Ensure it fits */
        margin: 0 auto;
    }
}

.orb {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary), transparent 70%);
    filter: blur(80px);
    animation: pulse 5s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Section */
.section {
    padding: 2rem 5%;
    display: none;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Track Grid */
.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.track-card {
    background: var(--bg-panel);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid var(--glass-border);
    position: relative;
    cursor: pointer;
}

.track-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.2);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* Square */
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.track-card:hover .card-img-wrapper img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.track-card:hover .card-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 3rem;
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.card-info {
    padding: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-artist {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* Delete Button on Albums */
.delete-btn-album {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    font-size: 0.9rem;
}

.delete-btn-album:hover {
    background: red;
}

/* Album Details */
.album-details {
    padding-bottom: 2rem;
    animation: fadeIn 0.3s;
}

.album-header {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
    align-items: flex-end;
}

#detail-cover {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.album-meta h2 {
    font-size: 3rem;
    border: none;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.album-meta p {
    color: var(--text-dim);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Mobile Album Details Adjustments */
@media (max-width: 600px) {
    .album-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    #detail-cover {
        width: 200px;
        height: 200px;
        margin-bottom: 0.5rem;
    }

    .album-meta h2 {
        font-size: 2rem;
        /* Smaller title on mobile */
        word-wrap: break-word;
        /* Prevent overflowing text */
    }

    .album-meta {
        width: 100%;
    }
}


.song-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.song-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    transition: background 0.2s, border-left 0.2s;
    border-left: 3px solid transparent;
}

.song-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.song-row.active-song {
    background: rgba(0, 243, 255, 0.1);
    border-left: 3px solid var(--primary);
}

.song-row.active-song .song-title {
    color: var(--primary);
}

.song-num {
    width: 40px;
    color: var(--text-dim);
    font-weight: 600;
}

.song-main {
    flex: 1;
}

.song-title {
    font-weight: 600;
    font-size: 1rem;
}

.song-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
    /* Vital: Prevent shrinking on small screens */
    margin-left: 10px;
}

.play-mini-btn,
.delete-song-btn {
    background: transparent;
    color: var(--text-main);
    font-size: 1.1rem;
}

.delete-song-btn {
    color: #ff3366;
}

.play-mini-btn:hover {
    color: var(--primary);
}


/* Admin / Upload */
.auth-box {
    max-width: 400px;
    margin: 5rem auto;
    background: var(--bg-panel);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.auth-box input {
    width: 100%;
    padding: 12px;
    margin: 1.5rem 0;
    background: var(--bg-dark);
    border: 1px solid #333;
    color: white;
    border-radius: 4px;
}

.auth-box input:focus {
    border-color: var(--primary);
    outline: none;
}

.error-msg {
    color: #ff3366;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid #333;
    color: white;
    border-radius: 4px;
    font-family: var(--font-body);
}

.form-group textarea {
    resize: vertical;
}

.file-drop-area {
    border: 2px dashed #333;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    position: relative;
    transition: border-color 0.3s;
}

.file-drop-area:hover {
    border-color: var(--primary);
}

.file-drop-area input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.preview-area {
    margin-top: 1rem;
    padding: 0.5rem;
    background: #000;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-area img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 200;
    transition: transform 0.3s;
}

.player-bar.hidden {
    transform: translateY(100%);
}

.player-info {
    display: flex;
    align-items: center;
    width: 300px;
}

.player-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    margin-right: 1rem;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.player-thumb:hover {
    transform: scale(1.05);
}

.player-text h4 {
    margin-bottom: 0px;
    font-size: 1rem;
}

.player-text span {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
}

.ctrl-btn:hover {
    color: var(--text-main);
}

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--text-main);
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.play-btn:hover {
    transform: scale(1.1);
    color: var(--bg-dark);
}

.active-ctrl {
    color: var(--primary) !important;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.player-progress-container {
    flex: 1;
    margin: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-dim);
    font-size: 0.8rem;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    -webkit-appearance: none;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.player-extras {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 200px;
    justify-content: flex-end;
}

.volume-ctrl {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-ctrl input {
    width: 80px;
}

/* Lyrics Overlay */
.lyrics-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 150;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: flex-end;
    /* Sidebar style */
}

.lyrics-overlay.hidden {
    display: none;
}

.lyrics-content {
    width: 400px;
    height: 100%;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    padding: 2rem;
    padding-bottom: 5rem;
    position: relative;
    overflow-y: auto;
    animation: slideInRight 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    color: var(--text-dim);
    font-size: 1.5rem;
}

.lyrics-content h3 {
    margin-bottom: 2rem;
    color: var(--primary);
}

.lyrics-content pre {
    white-space: pre-wrap;
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-main);
    line-height: 1.8;
}

/* Utility */
.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 4rem;
        min-height: auto;
    }

    .hero-content {
        margin-bottom: 3rem;
    }

    .hero-visual {
        position: relative;
        right: auto;
        top: auto;
    }

    .orb {
        width: 300px;
        height: 300px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .player-bar {
        height: auto;
        /* Let it grow to fit content */
        min-height: 140px;
        flex-direction: column;
        padding: 1rem 1rem 1.5rem 1rem;
        /* More padding at bottom */
        gap: 0.5rem;
    }

    .player-info {
        width: 100%;
    }

    .player-controls {
        width: 100%;
        justify-content: center;
    }

    .player-progress-container {
        width: 100%;
        margin: 0;
    }

    .player-extras {
        display: flex;
        /* Show it! */
        position: absolute;
        right: 1rem;
        top: 20px;
        /* Align with top row */
        width: auto;
    }

    .volume-ctrl {
        display: none;
        /* Hide volume on mobile, phones have hw buttons */
    }

    .lyrics-content {
        width: 100%;
        padding-bottom: 160px;
        /* Ensure content clears the taller mobile player bar (130px) */
    }
}

/* Update specific for Edit Modal to reuse lyrics-overlay class but center it */
#edit-modal {
    justify-content: center !important;
    align-items: center !important;
    backdrop-filter: blur(5px);
    overflow: hidden;
    /* Ensure modal wrapper doesn't double scroll */
}

/* Target the content box specifically */
#edit-modal .glass-panel {
    max-height: 90vh;
    /* Leave room for margin */
    overflow-y: auto;
    /* Enable scrolling */
    width: 90%;
    max-width: 500px;
    /* Optional cap */
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

/* Edit Button */
.edit-btn-album,
.edit-btn-song {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--text-dim);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-right: 5px;
    cursor: pointer;
}

.edit-btn-album:hover,
.edit-btn-song:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 243, 255, 0.1);
}

.edit-btn-absolute {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.edit-btn-absolute:hover {
    background: var(--primary);
    color: black;
}

/* Lightbox - Final Robust Version */
.lightbox-overlay {
    position: fixed;
    /* Fallback, JS overrides to absolute */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 200000;
    /* Maximize Z-Index */
    background-color: rgba(0, 0, 0, 0.95);

    /* Centering Magic - Grid is often more reliable than flex depending on browser quirks */
    display: grid;
    place-items: center;
    padding: 20px;
    box-sizing: border-box;
    /* Force padding to be inside width/height */
}

.lightbox-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-overlay img {
    /* Explicit limits relative to VIEWPORT */
    max-width: 90vw;
    max-height: 80vh;

    width: auto;
    height: auto;
    object-fit: contain;

    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    display: block;
}

.close-btn-lightbox {
    position: absolute;
    /* Using absolute inside the fixed grid container might be safer if placed correctly, 
                           but fixed is safest for "always in corner". 
                           Let's stick to fixed to avoid grid cell confinement issues. */
    position: fixed;
    top: 10px;
    right: 10px;
    width: 48px;
    height: 48px;
    background: rgba(50, 50, 50, 0.8);
    /* Darker background for visibility */
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 200001;
    /* Above overlay */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.close-btn-lightbox:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

@media (max-width: 600px) {
    .close-btn-lightbox {
        top: 15px;
        right: 15px;
        width: 48px;
        /* Larger touch target */
        height: 48px;
        background: rgba(0, 0, 0, 0.7);
        /* More visible on mobile */
        font-size: 1.5rem;
    }
}

/* Hero Profile */
.hero-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease;
}

.profile-portrait img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    transition: transform 0.3s;
    cursor: pointer;
}

.profile-portrait img:hover {
    transform: scale(1.05);
}

.profile-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 1.3rem;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.social-link:hover {
    color: white;
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
}

.social-link.spot:hover {
    color: #1DB954;
    border-color: #1DB954;
    box-shadow: 0 0 15px rgba(29, 185, 84, 0.4);
}

.social-link.yt:hover {
    color: #FF0000;
    border-color: #FF0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

.social-link.soc:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

@media (max-width: 900px) {
    .hero-profile {
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
        background: rgba(0, 0, 0, 0.2);
        padding: 1.5rem;
        border-radius: 12px;
        border-top: none;
        margin-top: 1.5rem;
    }
}