/* ============================================
   🍬 Jelly — Premium Dark Theme
   ============================================ */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.08);

    --text-primary: #f0f0f5;
    --text-secondary: #8b8b9e;
    --text-muted: #55556a;

    --accent-pink: #ff6b9d;
    --accent-purple: #7c3aed;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;

    --gradient-hero: linear-gradient(135deg, #7c3aed22, #ff6b9d22, #3b82f622);
    --gradient-pink: linear-gradient(135deg, #ff6b9d, #c084fc);
    --gradient-purple: linear-gradient(135deg, #7c3aed, #3b82f6);
    --gradient-card: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(255, 107, 157, 0.05));

    --shadow-glow: 0 0 60px rgba(124, 58, 237, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden { display: none !important; }

/* ── Custom Scrollbar ──────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Loading Skeleton ──────────── */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ── Navbar ────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
}

.nav-logo {
    font-size: 1.6rem;
    animation: jellyBounce 3s ease-in-out infinite;
}

@keyframes jellyBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.1); }
}

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

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover { color: var(--text-primary); }

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-pink);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after { width: 100%; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent-purple);
}

.nav-username {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-logout {
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
}

/* ── Buttons ───────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-discord {
    background: #5865F2;
    color: white;
}

.btn-discord:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
}

.discord-icon { flex-shrink: 0; }

/* ── Hero Section ──────────────── */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 120px 32px 80px;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, rgba(255, 107, 157, 0.06) 40%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 640px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-purple);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-emoji {
    display: inline-block;
    -webkit-text-fill-color: initial;
    animation: jellyBounce 3s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 24px 40px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
}

.hero-stat { text-align: center; }

.hero-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-glass);
}

/* Particles */
.hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-purple);
    border-radius: 50%;
    opacity: 0.4;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

/* ── Sections ──────────────────── */
.section {
    padding: 100px 32px;
    max-width: 1100px;
    margin: 0 auto;
}

.section-dark {
    max-width: 100%;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
}

.section-dark > * {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 48px;
}

/* ── Feature Cards ─────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-pink);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: rgba(124, 58, 237, 0.2);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.feature-usage {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(124, 58, 237, 0.15);
}

.feature-usage code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent-purple);
}

/* ── Stats Grid ────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    text-align: center;
    padding: 32px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: rgba(124, 58, 237, 0.15);
}

.stat-icon { font-size: 2rem; margin-bottom: 12px; }

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

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

/* ── Leaderboard ───────────────── */
.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.tab {
    padding: 10px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

.leaderboard-list {
    max-width: 600px;
    margin: 0 auto;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: var(--transition);
}

.leaderboard-entry:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.lb-rank {
    font-size: 1.25rem;
    font-weight: 800;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.lb-rank-1 { color: #ffd700; }
.lb-rank-2 { color: #c0c0c0; }
.lb-rank-3 { color: #cd7f32; }

.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-glass);
}

.lb-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.lb-value {
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.leaderboard-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Dashboard ─────────────────── */
.dashboard-content {
    max-width: 700px;
    margin: 0 auto;
}

.dashboard-profile {
    text-align: center;
    margin-bottom: 32px;
}

.dash-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-purple);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.3);
    margin-bottom: 12px;
}

.dash-username {
    font-size: 1.5rem;
    font-weight: 700;
}

.dash-joined {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.dash-stat-card {
    text-align: center;
    padding: 24px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
}

.dash-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.dashboard-history h4 {
    margin-bottom: 16px;
    font-weight: 600;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
}

.history-format {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.history-format-mp3 { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.history-format-mp4 { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }

.history-title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.history-status-completed { color: var(--accent-green); }
.history-status-failed { color: var(--accent-red); }
.history-status-expired { color: var(--text-muted); }

.history-empty {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Footer ────────────────────── */
.footer {
    padding: 24px 32px;
    border-top: 1px solid var(--border-glass);
    text-align: center;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-brand {
    font-weight: 700;
    font-size: 0.9rem;
}

.footer-sep { color: var(--text-muted); }

.footer-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ── Responsive ────────────────── */
@media (max-width: 768px) {
    .navbar { padding: 0 16px; }

    .nav-links {
        gap: 12px;
    }

    .nav-link:not(.nav-logout) {
        display: none;
    }

    .hero { padding: 100px 20px 60px; }

    .hero-stats {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

    .hero-stat-divider {
        width: 60px;
        height: 1px;
    }

    .section { padding: 60px 20px; }

    .features-grid { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .dashboard-stats { grid-template-columns: 1fr; }

    .leaderboard-tabs { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2.5rem; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ── Fade-in Animation ─────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }

.stat-card { opacity: 0; animation: fadeInUp 0.5s ease forwards; }
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* =========================================================================
   12. SERVERS GRID
   ========================================================================= */

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.server-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.server-card:hover {
    transform: translateY(-5px);
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: var(--shadow-glow);
}

.server-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
}

.server-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--text-primary);
}

.server-actions {
    width: 100%;
    margin-top: auto;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
    justify-content: center;
}

.status-here {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-invite {
    background: var(--accent-purple);
    color: white;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    width: 100%;
}

.btn-invite:hover {
    background: #6b21a8;
    transform: translateY(-2px);
}

.music-box {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background: rgba(255, 107, 157, 0.05);
    border: 1px solid rgba(255, 107, 157, 0.2);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.music-title {
    font-size: 0.875rem;
    color: var(--accent-pink);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.music-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.servers-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-glass);
}
