:root {
    --bg-color: #121212;
    --card-bg: #181818;
    --text-primary: #FFFFFF;
    --text-secondary: #B3B3B3;
    --spotify-green: #1DB954;
    --spotify-green-hover: #1ed760;
    --error-red: #E22134;
    --warning-orange: #ffb86c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #282828;
    position: relative;
    z-index: 1001;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0;
}

.top-nav {
    display: flex;
}

.menu-trigger {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.menu-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--spotify-green);
    transform: translateY(-1px);
}

.menu-icon {
    width: 18px;
    height: 2px;
    background: var(--spotify-green);
    position: relative;
    display: inline-block;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    width: 18px;
    height: 2px;
    background: var(--spotify-green);
    position: absolute;
    left: 0;
}

.menu-icon::before { top: -6px; }
.menu-icon::after { bottom: -6px; }

/* Navigation Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.nav-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    display: flex !important; /* Keep flex but hide via opacity */
}

.overlay-content {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.close-menu {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 3rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-menu:hover {
    color: white;
}

.nav-links {
    list-style: none;
    padding: 0;
}

.nav-links li {
    margin: 1.5rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.nav-overlay:not(.hidden) .nav-links li {
    opacity: 1;
    transform: translateY(0);
}

.nav-links li:nth-child(1) { transition-delay: 0.1s; }
.nav-links li:nth-child(2) { transition-delay: 0.2s; }
.nav-links li:nth-child(3) { transition-delay: 0.3s; }
.nav-links li:nth-child(4) { transition-delay: 0.4s; }

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 2rem;
    font-weight: 800;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--spotify-green);
}

.nav-link.active {
    color: var(--spotify-green);
}

.nav-link.disabled {
    color: #444;
    cursor: default;
}

.nav-link.disabled:hover {
    color: #444;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
    color: inherit;
}

.logo:hover {
    opacity: 0.8;
}

h1 {
    font-weight: 800;
    letter-spacing: -0.5px;
    font-size: 1.5rem;
}

h2 {
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.centered-box {
    text-align: center;
}

.input-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

input,
textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #333;
    background: #282828;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--spotify-green);
}

button,
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 500px;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.1s, background-color 0.2s;
    border: none;
}

.btn-primary {
    background-color: var(--spotify-green);
    color: #000;
}

.btn-primary:hover {
    background-color: var(--spotify-green-hover);
    transform: scale(1.04);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    transform: scale(1.04);
}

.full-width {
    width: 100%;
    margin-top: 1rem;
}

.hidden {
    display: none !important;
}

#user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
}

#user-profile button {
    padding: 8px 16px;
    font-size: 0.8rem;
}

/* Loading animations */
#loading {
    margin-top: 2rem;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--spotify-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

.stats p {
    color: var(--text-primary);
    margin: 0;
}

#missing-tracks {
    text-align: left;
    background: #282828;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 2rem;
    max-height: 200px;
    overflow-y: auto;
}

.warning-text {
    color: #ffb86c;
    margin-bottom: 0.5rem;
}

#missing-list {
    list-style-type: disc;
    padding-left: 20px;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: var(--card-bg);
    border: 1px solid #333;
    border-radius: 6px;
    margin-top: 15px;
    height: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--spotify-green);
    transition: width 0.3s ease;
}

#progress-text {
    margin-top: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.or-separator {
    text-align: center;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    position: relative;
    display: flex;
    align-items: center;
}

.or-separator::before,
.or-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #333;
    margin: 0 1rem;
}

.legal-attribution {
    margin-top: 2rem;
    padding: 2rem 0;
    border-top: 1px solid #282828;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legal-attribution a {
    color: var(--spotify-green);
    text-decoration: none;
}

.legal-attribution a:hover {
    text-decoration: underline;
}
.label-hint {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Header Nav */
.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--spotify-green);
}

/* How to Use Section */
.instruction-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
}

.card-header h2 {
    margin: 0;
}

.lang-toggle {
    display: flex;
    background: #282828;
    padding: 3px;
    border-radius: 8px;
}

.lang-toggle button {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-toggle button.active {
    background: #3e3e3e;
    color: white;
}

#how-to-content {
    text-align: left;
    line-height: 1.6;
    margin-bottom: 2rem;
}

#how-to-content h3 {
    color: var(--spotify-green);
    font-size: 1.1rem;
    margin: 1.5rem 0 0.5rem 0;
}

#how-to-content .highlight-link {
    color: var(--spotify-green);
    text-decoration: underline;
    font-weight: 600;
}

#how-to-content p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.screenshot-gallery {
    background: #181818;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
    border: 1px solid #333;
}

.gallery-viewport {
    width: 100%;
    height: 180px; /* Mini version */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    margin-bottom: 1rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.gallery-viewport:hover {
    border-color: var(--spotify-green);
}

.gallery-viewport img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.gallery-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.btn-icon {
    background: #333;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--spotify-green);
}

#gallery-counter {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 45px;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Image Modal */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover {
    color: var(--spotify-green);
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 50px;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
    user-select: none;
    z-index: 2001;
}

.modal-nav-btn:hover {
    background: rgba(29, 185, 84, 0.8);
}

.modal-nav-btn.prev {
    left: 20px;
}

.modal-nav-btn.next {
    right: 20px;
}

/* Downloader Specific */
.download-actions .btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.how-to-mini ol {
    padding-left: 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.how-to-mini li {
    margin-bottom: 0.5rem;
}

.how-to-mini strong {
    color: white;
}

/* Maintenance Notice */
.maintenance-notice {
    background: rgba(226, 33, 52, 0.1);
    border: 1px solid var(--error-red);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.5s ease;
}

.maintenance-highlight {
    color: #ffb86c;
    display: block;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

.premium-notice {
    color: var(--spotify-green);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    animation: fadeIn 0.5s ease;
}

.client-id-group {
    max-width: 400px;
    margin: 2rem auto !important;
    text-align: center !important;
}

.client-id-group label {
    text-align: center !important;
    margin-bottom: 0.8rem;
}

.client-id-group input {
    text-align: center;
    letter-spacing: 1px;
}

.client-id-group .label-hint {
    margin-top: 0.8rem;
}

.client-id-group a {
    color: var(--spotify-green);
    text-decoration: underline;
}

/* Instruction Refinements */
.setup-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.setup-list li {
    margin-bottom: 0.6rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.4rem;
}

.setup-list li:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.setup-list code {
    background: #000;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--spotify-green);
}

.security-note {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 2rem;
    text-align: center;
}

.instruction-card hr {
    border: none;
    border-top: 1px solid #333;
    margin: 2rem 0;
}

/* Mobile Adaptation */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    header {
        padding: 1rem 0;
        margin-bottom: 2rem;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .centered-box, .input-card {
        padding: 1.5rem;
        width: 100%;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        margin-bottom: 0.8rem;
    }

    .header-nav {
        gap: 0.5rem;
    }

    #how-to-btn {
        font-size: 0.8rem;
    }

    .stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .client-id-group {
        margin: 1.5rem 0 !important;
    }

    .maintenance-notice {
        padding: 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    header {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }

    .logo {
        width: 100%;
        justify-content: center;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
    }

    .overlay-content {
        padding: 2rem;
    }

    .nav-link {
        font-size: 1.2rem;
    }
}

/* Donation Section Styles */
.donation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.donation-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    transition: all 0.3s ease;
    text-align: left;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.donation-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--spotify-green);
}

.donation-card.yoomoney {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background: rgba(75, 62, 114, 0.3);
    padding: 1rem;
    text-decoration: none;
    border-color: #4b3e72;
}

.donation-card.yoomoney:hover {
    background: rgba(75, 62, 114, 0.5);
    transform: translateY(-2px);
}

.donation-card .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    padding: 0;
    border: none;
    margin-bottom: 0;
}

.crypto-icon {
    width: 28px;
    height: 28px;
    background: #282828;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.crypto-icon.btc { color: #f7931a; }
.crypto-icon.eth { color: #627eea; }
.crypto-icon.usdt { color: #26a17b; }
.crypto-icon.ton { color: #0088cc; }

.address-box {
    display: flex;
    background: #000;
    border-radius: 8px;
    padding: 2px;
    overflow: hidden;
    border: 1px solid #333;
    align-items: center;
}

.crypto-address {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.75rem;
    padding: 8px 10px;
    flex: 1;
    cursor: default;
}

.address-actions {
    display: flex;
    gap: 4px;
    padding-right: 4px;
}

.address-actions button {
    background: #181818;
    border: none;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    transition: all 0.2s;
    width: auto;
    margin: 0;
}

.address-actions button:hover {
    background: #333;
    color: var(--spotify-green);
    transform: none;
}

.qr-container {
    margin-top: 0.5rem;
    background: white;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
}

.qr-container img {
    max-width: 140px;
    display: block;
}

.logo img {
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: rotate(5deg) scale(1.1);
}
