:root {
    --bg-deep: #030305;
    --bg-surface: #0a0a0c;
    --border-dim: rgba(255, 255, 255, 0.06);
    --border-highlight: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --accent-primary: #5024F4;
    --accent-secondary: #7B4FFF;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 0%, rgba(80, 36, 244, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 100%, rgba(123, 79, 255, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Glass Cards */
.glass-panel {
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-dim);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: var(--border-highlight);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

/* Syntax Highlighting Window */
.code-editor {
    background: #050507;
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    transition: border-color 0.3s;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-dim);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.editor-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.editor-controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-dots {
    display: flex;
    gap: 8px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #5024F4; box-shadow: 0 0 10px rgba(80, 36, 244, 0.3); }
.dot-yellow { background: #7B4FFF; box-shadow: 0 0 10px rgba(123, 79, 255, 0.3); }
.dot-green { background: #9D7FFF; box-shadow: 0 0 10px rgba(157, 127, 255, 0.3); }

/* Collapse Animation Logic */
.editor-content {
    padding: 24px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    /* Animation Props */
    max-height: 5000px; /* Large enough to fit content */
    opacity: 1;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease-in-out, padding 0.3s ease;
}

.editor-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

/* Chevron Rotation */
.chevron-icon {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.code-editor.is-collapsed .chevron-icon {
    transform: rotate(-90deg);
}

.code-editor.is-collapsed .editor-header {
    border-bottom-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Typography & Utilities */
.text-glow { text-shadow: 0 0 30px rgba(80, 36, 244, 0.3); }
.nav-link { position: relative; color: var(--text-secondary); transition: color 0.2s; }
.nav-link:hover { color: white; }
.nav-link::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-active { color: white; }
.nav-active::after { width: 100%; }

.tag {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; padding: 6px 12px; border-radius: 100px;
}

/* ─── Discord Invite Card ─────────────────────────────────────── */
.discord-invite {
    background: #1e1f22;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.discord-banner {
    height: 100px;
    background: linear-gradient(135deg, #5024F4 0%, #7B4FFF 60%, #9a6fff 100%);
    position: relative;
}

.discord-server-icon {
    position: absolute;
    bottom: -36px;
    left: 20px;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    border: 5px solid #1e1f22;
    background: #2b2d31;
    overflow: hidden;
    flex-shrink: 0;
}

.discord-server-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discord-body {
    padding: 48px 20px 20px;
}

.discord-server-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f2f3f5;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.discord-server-badge {
    font-size: 1rem;
    line-height: 1;
}

.discord-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: #b5bac1;
    margin-bottom: 4px;
}

.discord-stats .stat-online::before {
    content: '●';
    color: #23a55a;
    margin-right: 5px;
}

.discord-stats .stat-members::before {
    content: '●';
    color: #80848e;
    margin-right: 5px;
}

.discord-est {
    font-size: 0.82rem;
    color: #b5bac1;
    margin-bottom: 12px;
}

.discord-desc {
    font-size: 0.9rem;
    color: #b5bac1;
    line-height: 1.45;
    margin-bottom: 4px;
}

/* Starfield decoration */
.discord-stars {
    position: relative;
    height: 90px;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 8px;
}

.discord-stars .star {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.discord-stars .sparkle {
    position: absolute;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    line-height: 1;
    user-select: none;
}

.discord-stars .emoji-deco {
    position: absolute;
    font-size: 18px;
    line-height: 1;
    user-select: none;
}

.discord-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.discord-channel-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 0.82rem;
    color: #e3e5e8;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.discord-channel-badge:hover {
    background: rgba(255, 255, 255, 0.1);
}

.discord-details-toggle {
    background: none;
    border: none;
    color: #b5bac1;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 0 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
    font-family: inherit;
}

.discord-details-toggle:hover {
    color: #e3e5e8;
}

.discord-collapsible {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
}

.discord-collapsible.collapsed {
    max-height: 0;
    opacity: 0;
}

.discord-join-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: #248046;
    color: #fff;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    margin-top: 4px;
}

.discord-join-btn:hover {
    background: #1a6b3b;
    transform: translateY(-1px);
}
/* ─────────────────────────────────────────────────────────────── */

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-enter { animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; opacity: 0; }
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
