/* ========================================
   SHARED STYLES & CSS VARIABLES
   Used across all pages
   ======================================== */

:root {
    /* Dark Mode (Default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #15151f;
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f43f5e 100%);
    --accent-glow: rgba(124, 58, 237, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

/* Light Mode */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f43f5e 100%);
    --accent-glow: rgba(124, 58, 237, 0.2);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: 200;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }

[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

/* ========================================
   BACKGROUND EFFECTS
   ======================================== */

.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 60%, rgba(244, 63, 94, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
    animation: bgPulse 20s ease-in-out infinite;
}

[data-theme="light"] .bg-animation::before {
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 60%, rgba(244, 63, 94, 0.05) 0%, transparent 40%);
}

.bg-animation::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
}

@keyframes bgPulse {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(1deg); }
    50% { transform: translate(-1%, 2%) rotate(-1deg); }
    75% { transform: translate(-2%, -1%) rotate(0deg); }
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

[data-theme="light"] .bg-grid {
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

/* Floating Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(124, 58, 237, 0.3);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.25);
    top: 60%;
    right: 10%;
    animation-delay: -3s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: rgba(244, 63, 94, 0.2);
    bottom: 20%;
    left: 30%;
    animation-delay: -6s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ========================================
   PARTICLES
   ======================================== */

.floating-particle {
    position: absolute;
    border-radius: 50%;
    animation: particleFloat 6s ease-in-out infinite;
    opacity: 0.6;
    pointer-events: none;
}

.particle-1 { width: 20px; height: 20px; background: #4ECDC4; top: 20%; left: 10%; animation-delay: 0s; }
.particle-2 { width: 15px; height: 15px; background: #FF6B6B; top: 60%; left: 80%; animation-delay: 1s; }
.particle-3 { width: 10px; height: 10px; background: #5865F2; top: 30%; left: 60%; animation-delay: 2s; }
.particle-4 { width: 8px; height: 8px; background: #a855f7; top: 70%; left: 30%; animation-delay: 3s; }
.particle-5 { width: 12px; height: 12px; background: #f43f5e; top: 40%; left: 85%; animation-delay: 4s; }
.particle-6 { width: 6px; height: 6px; background: #10b981; top: 80%; left: 50%; animation-delay: 5s; }

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.6; }
    50% { transform: translateY(-30px) rotate(180deg) scale(1.2); opacity: 0.8; }
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 30px 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(124, 58, 237, 0.5), transparent);
}

.sidebar-header {
    padding: 0 25px 30px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 4px 20px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { transform: rotate(45deg) translateX(-100%); }
    50% { transform: rotate(45deg) translateX(100%); }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-section {
    padding: 0 15px;
    margin-bottom: 25px;
}

.nav-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 10px;
    margin-bottom: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-gradient);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(5px);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(236, 72, 153, 0.1));
    color: var(--text-primary);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.nav-link.active::before {
    transform: scaleY(1);
}

.nav-link .icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-link .badge {
    margin-left: auto;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    margin-left: 280px;
    padding: 40px;
    max-width: 1200px;
    transition: margin 0.3s ease;
}

/* ========================================
   PAGE HEADER
   ======================================== */

.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 60px 40px;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(124, 58, 237, 0.1), transparent);
    pointer-events: none;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    position: relative;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    text-align: center;
    padding: 80px 40px;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, rgba(124, 58, 237, 0.15), transparent);
    pointer-events: none;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
}

@keyframes glow {
    from { 
        text-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
        filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.3));
    }
    to { 
        text-shadow: 0 0 30px rgba(244, 63, 94, 0.8);
        filter: drop-shadow(0 0 30px rgba(244, 63, 94, 0.4));
    }
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* ========================================
   CONTENT BOX
   ======================================== */

.content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.5), transparent);
}

h2 {
    color: var(--accent-secondary);
    margin: 35px 0 18px 0;
    font-size: 1.4rem;
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    padding-bottom: 10px;
    position: relative;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 50px;
    height: 2px;
    background: var(--accent-gradient);
}

h2:first-of-type {
    margin-top: 0;
}

h3 {
    color: var(--accent-secondary);
    margin: 30px 0 15px 0;
    font-size: 1.2rem;
}

p, li {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.7;
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 10px;
    position: relative;
}

li::marker {
    color: var(--accent-secondary);
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

/* Last Updated */
.last-updated {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ========================================
   FEATURE CARDS
   ======================================== */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(124, 58, 237, 0.2);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card .icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.feature-card h3 {
    color: var(--accent-secondary);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========================================
   LINKS & BUTTONS
   ======================================== */

.links {
    text-align: center;
    margin-top: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.link-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.link-button:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.2);
}

.link-button:hover::before {
    left: 100%;
}

.link-button .icon {
    font-size: 1.2rem;
}

.invite-btn {
    background: var(--accent-gradient);
    border: none;
    font-size: 1.1rem;
    padding: 18px 35px;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.invite-btn:hover {
    box-shadow: 0 8px 30px var(--accent-glow);
    transform: translateY(-3px) scale(1.02);
}

/* ========================================
   NOTES & ALERTS
   ======================================== */

.notes-section {
    margin-top: 40px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 30px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.note-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 3px solid var(--accent-primary);
    transition: all 0.3s ease;
}

.note-item:hover {
    transform: translateX(5px);
}

.note-item .icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ========================================
   CODE BLOCKS
   ======================================== */

.code-block {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, rgba(124, 58, 237, 0.1), transparent);
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
}

.code-block-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.code-block pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
    position: relative;
}

.code-block .keyword {
    color: #c792ea;
}

.code-block .string {
    color: #c3e88d;
}

.code-block .comment {
    color: #546e7a;
    font-style: italic;
}

/* ========================================
   BACK LINK
   ======================================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 12px 24px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.back-link:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateX(-5px);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    text-align: center;
    padding: 40px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    position: relative;
    transition: border-color 0.3s ease;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.footer a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: 200;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 80px 20px 20px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .theme-toggle {
        right: 80px;
    }
}

@media (max-width: 768px) {
    .page-header h1,
    .hero h1 {
        font-size: 2.2rem;
    }

    .page-header,
    .hero {
        padding: 40px 20px;
    }

    .content {
        padding: 25px;
    }

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

    .links {
        flex-direction: column;
        align-items: center;
    }

    .link-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .mobile-menu-btn {
        top: 15px;
        left: 15px;
        width: 40px;
        height: 40px;
    }

    .main-content {
        padding: 70px 15px 15px;
    }
}

@media (max-width: 480px) {
    .page-header h1,
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .feature-card {
        padding: 20px;
    }
}
