@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&display=swap');

:root {
    --primary-purple: #8b5cf6;
    --purple-hover: #7c3aed;
    --purple-light: #a78bfa;
    --primary-orange: #f97316;
    --orange-hover: #ea580c;
    --danger-red: #ef4444;
    --danger-red-hover: #dc2626;
    --star-bloom-color: rgba(167, 139, 250, 0.5);
}

/* --- THEME COLORS --- */
@media (prefers-color-scheme: light) {
    :root {
        --bg-color: #ffffff;
        --card-bg: rgba(255, 255, 255, 0.6);
        --chat-card-bg: rgba(248, 250, 252, 0.7);
        --dropdown-bg: rgba(255, 255, 255, 0.8);
        --text-color: #1e293b;
        --text-secondary: #64748b;
        --border-color: rgba(226, 232, 240, 0.7);
        --input-bg: #ffffff;
        --code-bg: #f8fafc;
        --prompt-card-bg: #f8fafc;
        --prompt-border: #e2e8f0;
        --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
        --tag-feature-bg: rgba(34, 197, 94, 0.1);
        --tag-feature-text: #16a34a;
        --tag-fix-bg: rgba(239, 68, 68, 0.1);
        --tag-fix-text: #dc2626;
        --tag-improvement-bg: rgba(59, 130, 246, 0.1);
        --tag-improvement-text: #2563eb;
        --tag-teaser-bg: rgba(249, 115, 22, 0.1);
        --tag-teaser-text: #f97316;
    }
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --card-bg: rgba(30, 41, 59, 0.6);
        --chat-card-bg: rgba(30, 41, 59, 0.6);
        --dropdown-bg: rgba(30, 41, 59, 0.8);
        --text-color: #f1f5f9;
        --text-secondary: #94a3b8;
        --border-color: rgba(51, 65, 85, 0.7);
        --input-bg: #1e293b;
        --code-bg: #1e293b;
        --prompt-card-bg: #1e293b;
        --prompt-border: #334155;
        --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
        --tag-feature-bg: rgba(74, 222, 128, 0.1);
        --tag-feature-text: #4ade80;
        --tag-fix-bg: rgba(248, 113, 113, 0.1);
        --tag-fix-text: #f87171;
        --tag-improvement-bg: rgba(96, 165, 250, 0.1);
        --tag-improvement-text: #60a5fa;
        --tag-teaser-bg: rgba(251, 146, 60, 0.1);
        --tag-teaser-text: #fb923c;
    }
}

/* --- BASICS --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Rubik', sans-serif; background: var(--bg-color); color: var(--text-color); min-height: 100vh; transition: background-color 0.3s ease, color 0.3s ease; text-shadow: 0 0 20px currentColor; }
#starfield-canvas, #click-particle-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
#click-particle-canvas { z-index: 9999; }

/* --- NAVBAR --- */
.navbar { position: fixed; top: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 1000; background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 2px dashed var(--border-color); border-radius: 50px; padding: 0.75rem 1.5rem; display: flex; align-items: center; gap: 2rem; min-width: 600px; max-width: 90vw; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); transition: border-color 0.3s ease; }
.navbar:hover { border-color: var(--purple-light); }
@media (prefers-color-scheme: dark) { .navbar { background: rgba(0, 0, 0, 0.2); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); } }
.navbar-brand { font-size: 1.25rem; font-weight: 700; color: var(--primary-purple); text-decoration: none; }
.navbar-nav { display: flex; align-items: center; gap: 1.5rem; flex: 1; justify-content: center; }
.nav-link { color: var(--text-color); text-decoration: none; font-weight: 500; padding: 0.5rem 1rem; border-radius: 25px; transition: all 0.3s ease; font-size: 0.9rem; }
.nav-link:hover { background: rgba(139, 92, 246, 0.1); color: var(--primary-purple); box-shadow: 0 0 15px 3px rgba(139, 92, 246, 0.2); }
.nav-link.active { background: var(--primary-purple); color: white; }
.profile-section { position: relative; margin-left: auto; }
.profile-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-purple); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; color: white; }
.profile-btn:hover { transform: scale(1.05); box-shadow: 0 0 25px 5px rgba(139, 92, 246, 0.5); }
.profile-dropdown { position: absolute; top: calc(100% + 0.5rem); right: 0; background: var(--dropdown-bg); border: 2px dashed var(--border-color); border-radius: 12px; padding: 0.5rem; min-width: 200px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15); opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s ease; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); z-index: 999; }
.profile-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.profile-dropdown-item { display: block; width: 100%; padding: 0.75rem 1rem; color: var(--text-color); text-decoration: none; border-radius: 8px; transition: all 0.2s ease; border: none; background: none; cursor: pointer; font-size: 0.9rem; text-align: left; }
.profile-dropdown-item:hover { background: rgba(139, 92, 246, 0.1); box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.15); }

/* --- MOBILE NAV --- */
.mobile-nav-toggle { display: none; background: transparent; border: none; cursor: pointer; padding: 0.5rem; z-index: 1001; }
.mobile-nav-toggle .hamburger-icon { width: 24px; height: 20px; position: relative; }
.mobile-nav-toggle .hamburger-icon span { display: block; position: absolute; height: 3px; width: 100%; background: var(--text-color); border-radius: 3px; left: 0; transition: all 0.3s ease-in-out; }
.mobile-nav-toggle .hamburger-icon span:nth-child(1) { top: 0; }
.mobile-nav-toggle .hamburger-icon span:nth-child(2) { top: 8px; }
.mobile-nav-toggle .hamburger-icon span:nth-child(3) { top: 16px; }
body.mobile-nav-open .mobile-nav-toggle .hamburger-icon span:nth-child(1) { top: 8px; transform: rotate(135deg); }
body.mobile-nav-open .mobile-nav-toggle .hamburger-icon span:nth-child(2) { opacity: 0; left: -24px; }
body.mobile-nav-open .mobile-nav-toggle .hamburger-icon span:nth-child(3) { top: 8px; transform: rotate(-135deg); }
.mobile-nav { position: fixed; top: 0; right: -100%; width: 280px; height: 100vh; background: var(--dropdown-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-left: 2px dashed var(--border-color); box-shadow: -10px 0 30px rgba(0,0,0,0.15); z-index: 998; transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94); padding: 8rem 2rem 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
body.mobile-nav-open .mobile-nav { right: 0; }
.mobile-nav .nav-link { font-size: 1.1rem; padding: 0.75rem 1.25rem; }
.mobile-nav .nav-link.active { box-shadow: 0 0 15px 3px rgba(139, 92, 246, 0.2); }
#mobile-nav-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.5); z-index: 997; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
body.mobile-nav-open #mobile-nav-overlay { opacity: 1; visibility: visible; }

/* --- LAYOUT & CARDS --- */
.main-container { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 8rem 2rem 2rem; }
.page-header { text-align: center; margin-bottom: 3rem; max-width: 700px; }
.main-title { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; line-height: 1.1; color: var(--text-color); margin-bottom: 1rem; text-shadow: none; }
.main-title span { background: linear-gradient(135deg, var(--primary-purple), var(--purple-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-subtitle { font-size: clamp(1rem, 2vw, 1.25rem); color: var(--text-secondary); max-width: 600px; margin: 0 auto; }
.card { background: var(--card-bg); border: 2px dashed var(--border-color); border-radius: 16px; padding: 2.5rem; box-shadow: var(--shadow); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); transition: all 0.3s ease; }
.card:hover { border-color: var(--purple-light); box-shadow: 0 0 20px 4px rgba(139, 92, 246, 0.15); }

/* --- BUTTONS & INPUTS --- */
.btn { display: inline-block; text-decoration: none; font-weight: 600; cursor: pointer; border: none; transition: all 0.3s ease; }
.btn-primary { background: var(--primary-purple); color: white; padding: 0.75rem 1.5rem; border-radius: 8px; font-size: 0.9rem; }
.btn-primary:hover { background: var(--purple-hover); box-shadow: 0 0 20px 4px rgba(139, 92, 246, 0.4); transform: translateY(-2px); }
.btn-secondary { background: transparent; color: var(--primary-purple); border: 2px solid var(--primary-purple); padding: 0.75rem 1.5rem; border-radius: 8px; }
.btn-secondary:hover { background: rgba(139, 92, 246, 0.1); transform: translateY(-2px); box-shadow: 0 0 20px 4px rgba(139, 92, 246, 0.25); }
.btn-danger { background: var(--danger-red); color: white; padding: 0.75rem 1.5rem; border-radius: 8px; font-size: 0.9rem; }
.btn-danger:hover { background: var(--danger-red-hover); box-shadow: 0 0 20px 4px rgba(239, 68, 68, 0.4); transform: translateY(-2px); }
input, textarea { width: 100%; padding: 0.875rem 1rem; border: 2px dashed var(--border-color); border-radius: 12px; background: var(--input-bg); color: var(--text-color); font-size: 1rem; transition: all 0.3s ease; outline: none; font-family: inherit; }
input:focus, textarea:focus { border-style: solid; border-color: var(--primary-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1); }
input:hover, textarea:hover { border-color: var(--purple-light); box-shadow: 0 0 10px 2px rgba(167, 139, 250, 0.2); }
.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--text-secondary); font-size: 0.875rem; }

/* --- HOME PAGE HERO & PROMPT --- */
.main-container.home { justify-content: flex-start; padding-top: 10rem; gap: 6rem; text-align: center; }
.hero-section .main-title { font-size: clamp(3rem, 7vw, 5.5rem); }
.hero-subtitle { font-size: clamp(1.25rem, 3vw, 1.75rem); color: var(--text-secondary); font-weight: 500; margin: 1.5rem 0 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.cta-buttons { display: flex; justify-content: center; gap: 1rem; margin-bottom: 4rem; }
.cta-buttons .btn { padding: 0.875rem 2rem; border-radius: 50px; font-size: 1rem; }
.interactive-prompt-section { width: 100%; max-width: 768px; padding: 1.5rem; border-radius: 24px; background: var(--card-bg); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border: 2px dashed var(--border-color); margin: 0 auto; }
.prompt-input-wrapper { position: relative; background: var(--prompt-card-bg); border-radius: 16px; padding: 1rem; border: 1px solid var(--prompt-border); }
#home-prompt-input { width: 100%; height: 100px; border: none; background: transparent; color: var(--text-color); font-size: 1rem; resize: none; outline: none; padding-right: 50px; }
.prompt-send-btn { position: absolute; bottom: 1rem; right: 1rem; width: 36px; height: 36px; border-radius: 8px; border: none; background: var(--primary-orange); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.prompt-send-btn:hover { background: var(--orange-hover); box-shadow: 0 0 15px 3px rgba(249, 115, 22, 0.5); }
.suggestion-text { text-align: left; margin: 1.5rem 0.5rem 0.75rem; color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; }
.suggestion-pills { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: flex-start; }
.suggestion-pill { background: transparent; border: 1px solid var(--prompt-border); color: var(--text-secondary); padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.875rem; cursor: pointer; transition: all 0.2s; }
.suggestion-pill:hover { border-color: var(--primary-purple); color: var(--primary-purple); background: rgba(139, 92, 246, 0.1); box-shadow: 0 0 15px 3px rgba(139, 92, 246, 0.2); }

/* --- PRICING SECTION (FIXED) --- */
.pricing-section { width: 100%; max-width: 1100px; margin: 4rem auto 0; text-align: center; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 3rem; justify-items: center; }
.pricing-card {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column; /* FIX: Restored Column Direction */
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
    box-shadow: var(--shadow);
    height: 100%; /* Ensure equal height */
}
.pricing-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.2); border-color: var(--primary-purple); }
.pricing-card.pro { border: 2px solid var(--primary-purple); background: linear-gradient(to bottom, var(--card-bg), rgba(139, 92, 246, 0.05)); }
.popular-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary-purple); color: white; padding: 0.3rem 1rem; border-radius: 20px; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; box-shadow: 0 4px 10px rgba(139, 92, 246, 0.4); }
.plan-header { margin-bottom: 2rem; border-bottom: 2px dashed var(--border-color); padding-bottom: 1.5rem; }
.pricing-card h3 { font-size: 1.5rem; color: var(--text-color); margin-bottom: 0.5rem; }
.price { font-size: 3rem; font-weight: 800; color: var(--text-color); line-height: 1; margin: 1rem 0; }
.price .period { font-size: 1rem; font-weight: 500; color: var(--text-secondary); }
.plan-description { color: var(--text-secondary); font-size: 0.95rem; }
.features-list {
    list-style: none; /* FIX: Removed Bullets */
    padding-left: 0;
    text-align: left;
    margin-bottom: 2rem;
    flex-grow: 1; /* FIX: Pushes button to bottom */
}
.features-list li { margin-bottom: 1rem; display: flex; align-items: center; gap: 0.75rem; color: var(--text-color); font-size: 0.95rem; }
.features-list li .check { color: var(--primary-purple); font-weight: 800; font-size: 1.1rem; }

/* --- COMPARISON / MOCKUPS (FIXED) --- */
.info-section { width: 100%; max-width: 1100px; text-align: center; }
.section-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; margin-bottom: 1rem; }
.section-subtitle { font-size: clamp(1rem, 2vw, 1.25rem); color: var(--text-secondary); max-width: 650px; margin: 0 auto 3rem auto; line-height: 1.6; }
.comparison-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 3rem;
}
.comparison-card {
    flex: 1;
    min-width: 320px;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.mockup-window {
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden; /* FIX: Prevents text spill */
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    height: 300px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease;
}
.comparison-card:hover .mockup-window { transform: translateY(-5px); }
.mockup-window.generic { border-color: var(--text-secondary); }
.generic-scroll { padding: 1rem; font-family: 'SFMono-Regular', monospace; font-size: 0.75rem; color: #94a3b8; overflow: hidden; position: relative; }
.generic-scroll::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 100px; background: linear-gradient(to bottom, transparent, #0f172a); }
.mockup-window.rocode { border: 2px solid var(--primary-purple); box-shadow: 0 0 20px rgba(139, 92, 246, 0.15); }
.mockup-tabs-header { background: #1e293b; padding: 8px 10px 0; display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); }
.mockup-tab { padding: 6px 12px; font-size: 0.75rem; border-radius: 6px 6px 0 0; color: #64748b; background: #0f172a; border: 1px solid transparent; }
.mockup-tab.active { background: #0f172a; color: var(--primary-purple); border-top: 2px solid var(--primary-purple); font-weight: 600; }
.mockup-code-content { padding: 1rem; font-family: 'SFMono-Regular', monospace; font-size: 0.8rem; color: #e2e8f0; }
.badge-label { text-align: center; font-weight: 700; font-size: 1.1rem; margin-top: 0.5rem; }
.badge-label.bad { color: var(--text-secondary); }
.badge-label.good { color: var(--primary-purple); }

/* --- FEATURES GRID --- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; text-align: left; }
.feature-card { background: var(--card-bg); border: 2px dashed var(--border-color); border-radius: 16px; padding: 2rem; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); transition: all 0.3s ease; }
.feature-card:hover { transform: translateY(-5px); border-color: var(--purple-light); box-shadow: 0 0 25px 5px rgba(139, 92, 246, 0.2); }
.feature-card h3 { font-size: 1.25rem; font-weight: 600; color: var(--text-color); margin-bottom: 0.75rem; }
.feature-card p { color: var(--text-secondary); line-height: 1.6; }

/* --- AUTH PAGES (LOGIN/SIGNUP) --- */
.auth-container { justify-content: center; gap: 2rem; }
.content-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; max-width: 1400px; }
.login-section, .signup-section { grid-column: 2; flex-shrink: 0; width: 100%; max-width: 400px; justify-self: center; }
.auth-container .container { width: 100%; max-width: 400px; }
.auth-preview-panel { width: 320px; height: 450px; background: #0f172a; border: 2px solid var(--border-color); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.5); font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; transition: transform 0.3s ease; grid-column: 1; justify-self: end; margin-right: 2rem; }
.auth-preview-panel:hover { transform: translateY(-5px) scale(1.02); border-color: var(--primary-purple); box-shadow: 0 20px 50px rgba(139, 92, 246, 0.2); }
.terminal-header { background: #1e293b; padding: 12px; display: flex; align-items: center; border-bottom: 1px solid var(--border-color); }
.terminal-dots { display: flex; gap: 6px; margin-right: 15px; }
.dot { width: 10px; height: 10px; border-radius: 50%; } .dot.red { background: #ef4444; } .dot.yellow { background: #f59e0b; } .dot.green { background: #22c55e; }
.terminal-tab { background: #0f172a; padding: 4px 12px; border-radius: 4px; font-size: 0.75rem; color: #cbd5e1; border-top: 2px solid var(--primary-purple); }
.terminal-body { padding: 1.5rem; font-size: 0.8rem; color: #e2e8f0; line-height: 1.6; flex-grow: 1; opacity: 0.9; }
.terminal-footer { padding: 10px 1.5rem; border-top: 1px solid var(--border-color); background: #1e293b; color: var(--primary-purple); font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; }
.k { color: #c084fc; } .g { color: #60a5fa; } .f { color: #f472b6; } .s { color: #4ade80; } .c { color: #64748b; font-style: italic; } .fn { color: #fbbf24; }
h1.form-title { text-align: center; margin-bottom: 2rem; font-size: 1.875rem; font-weight: 700; background: linear-gradient(135deg, var(--primary-purple), var(--purple-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.submit-btn { width: 100%; padding: 0.875rem; background: linear-gradient(135deg, var(--primary-purple), var(--purple-hover)); color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; margin-top: 1rem; }
.submit-btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 0 20px 4px rgba(139, 92, 246, 0.4); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.footer-link { text-align: center; margin-top: 1.5rem; color: var(--text-secondary); font-size: 0.875rem; }
.footer-link a { color: var(--primary-purple); text-decoration: none; font-weight: 600; }
#message, #password-message, #feedback-message, #delete-message, #key-message { padding: 0.75rem; border-radius: 8px; font-size: 0.875rem; text-align: center; display: none; word-wrap: break-word; border: 1px solid transparent; margin-top: 1rem; }
#message.error, #password-message.error, #feedback-message.error, #delete-message.error, #key-message.error { background-color: rgba(239, 68, 68, 0.1); color: var(--danger-red); border-color: rgba(239, 68, 68, 0.3); }
#message.success, #password-message.success, #feedback-message.success, #delete-message.success, #key-message.success { background-color: rgba(34, 197, 94, 0.1); color: var(--tag-feature-text); border-color: rgba(34, 197, 94, 0.3); }
@media (max-width: 1024px) { .auth-preview-panel { display: none; } .content-grid { display: flex; flex-direction: column; justify-content: center; gap: 2rem; } }

/* --- ACCOUNT PAGE --- */
.account-container { width: 100%; max-width: 600px; }
#account-page .card { margin-bottom: 2rem; }
#account-page .card h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; }
#account-page .card p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.95rem; }
.card-footer { display: flex; justify-content: flex-end; align-items: center; margin-top: 1rem; }
.subscription-info { display: flex; justify-content: space-between; align-items: center; }
.current-plan span { background: var(--primary-purple); color: white; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; margin-left: 0.5rem; }

/* --- CHAT PAGE --- */
#chat-page body { overflow-y: hidden; overflow-x: hidden; }
.chat-container { display: flex; height: 100dvh; padding: 7rem 1.5rem 1.5rem; gap: 1.5rem; overflow: auto; }
.sidebar, .chat-main, .code-viewer-panel, .config-panel { background: var(--chat-card-bg); border: 2px dashed var(--border-color); backdrop-filter: blur(15px); border-radius: 16px; }
.sidebar { flex: 0 0 15%; min-width: 220px; display: flex; flex-direction: column; padding: 1rem; }
.chat-main { flex: 1 1 35%; min-width: 300px; display: flex; flex-direction: column; overflow: hidden; }
.code-viewer-panel { flex: 1 1 35%; min-width: 300px; display: flex; flex-direction: column; padding: 0; min-height: 0; }
.config-panel { flex: 0 0 15%; min-width: 220px; display: flex; flex-direction: column; padding: 1.5rem; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem; margin-bottom: 1rem; }
.sidebar-header h2 { font-size: 1.25rem; margin: 0; }
.new-chat-btn { background: var(--primary-purple); color: white; border: none; border-radius: 8px; padding: 0.5rem 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.new-chat-btn:hover { background: var(--purple-hover); box-shadow: 0 0 20px 4px rgba(139, 92, 246, 0.4); }
.conversation-list { list-style: none; flex-grow: 1; overflow-y: auto; padding-right: 0.5rem; }
.conversation-list li { position: relative; padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 0.5rem; font-weight: 500; cursor: pointer; transition: background-color 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation-list li.active, .conversation-list li:hover { background: rgba(139, 92, 246, 0.1); }
.conversation-list li.active { color: var(--primary-purple); }
.conversation-actions { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); display: none; background: rgba(139, 92, 246, 0.1); backdrop-filter: blur(5px); padding: 0.25rem; border-radius: 6px; }
.conversation-list li:hover .conversation-actions { display: flex; gap: 0.25rem; }
.conversation-actions button { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0.25rem; border-radius: 4px; transition: all 0.2s; }
.conversation-actions button:hover { background: rgba(139, 92, 246, 0.2); box-shadow: 0 0 10px 2px rgba(139, 92, 246, 0.2); }
.chat-messages { flex-grow: 1; padding: 1.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.message-container { display: flex; flex-direction: column; max-width: 95%; }
.message-container.user { align-self: flex-end; align-items: flex-end; max-width: 75%; }
.message-container.ai { align-self: flex-start; align-items: flex-start; }
.message { padding: 0.75rem 1.25rem; border-radius: 16px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; }
.message.user { background: var(--primary-purple); color: white; border-bottom-right-radius: 4px; }
.message.ai { background: var(--input-bg); border: 2px solid var(--border-color); border-bottom-left-radius: 4px; color: var(--text-color); white-space: normal; }
.chat-input-area { padding: 1rem; border-top: 2px solid var(--border-color); }
#chat-form { display: flex; gap: 1rem; align-items: flex-end; }
#chat-input { flex-grow: 1; padding: 0.875rem 1rem; border: 2px dashed var(--border-color); border-radius: 12px; background: var(--input-bg); color: var(--text-color); font-size: 1rem; transition: border-color 0.3s ease, background-color 0.3s ease; outline: none; resize: none; font-family: inherit; line-height: 1.5; overflow-y: hidden; }
.send-btn { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; border: none; background: var(--primary-purple); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; }
.send-btn:hover { transform: scale(1.05); background: var(--purple-hover); box-shadow: 0 0 25px 5px rgba(139, 92, 246, 0.5); }
.send-btn.stop-mode { background-color: var(--primary-orange) !important; border-color: var(--primary-orange) !important; animation: pulse-orange 2s infinite; }
.send-btn.stop-mode:hover { background-color: var(--orange-hover) !important; }
.send-btn svg { pointer-events: none; }
@keyframes pulse-orange { 0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); } 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); } }
.code-viewer-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem 0; flex-wrap: wrap; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border-color); margin-bottom: 0; }
.code-viewer-actions { display: flex; gap: 0.5rem; }
.code-action-btn { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); padding: 0.3rem 0.8rem; border-radius: 8px; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.code-action-btn:hover { border-color: var(--primary-purple); color: var(--primary-purple); background: rgba(139, 92, 246, 0.05); box-shadow: 0 0 15px 3px rgba(139, 92, 246, 0.2); }
.code-tabs { display: flex; flex-grow: 1; align-items: flex-end; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.code-tabs::-webkit-scrollbar { display: none; }
.code-tab { display: flex; align-items: center; padding: 0.5rem 1rem; background: var(--input-bg); border: 2px solid var(--border-color); border-bottom: none; border-top-left-radius: 8px; border-top-right-radius: 8px; margin-right: 2px; cursor: pointer; font-size: 0.875rem; color: var(--text-secondary); white-space: nowrap; position: relative; top: 2px; transition: all 0.2s ease; }
.code-tab.active { background: var(--code-bg); color: var(--text-color); border-color: var(--border-color); border-bottom: 2px solid var(--code-bg); }
.code-tab:not(.active):hover { background: var(--card-bg); }
.tab-name-input { background: transparent; border: none; color: inherit; font-family: inherit; font-size: inherit; padding: 0; outline: 1px solid var(--primary-purple); border-radius: 2px; }
.close-tab-btn { margin-left: 0.5rem; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.close-tab-btn:hover { background: var(--border-color); color: var(--text-color); }
#add-tab-btn { background: none; border: 2px dashed var(--border-color); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); font-size: 1.25rem; font-weight: bold; cursor: pointer; transition: all 0.2s ease; flex-shrink: 0; margin-left: 0.5rem; }
#add-tab-btn:hover { border-color: var(--primary-purple); color: var(--primary-purple); transform: rotate(90deg); }
.code-content { flex-grow: 1; position: relative; display: flex; }
.editor-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--code-bg); border: 1px solid var(--border-color); border-top: none; border-radius: 0 0 8px 8px; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 0.9em; line-height: 1.5; display: none; }
.editor-wrapper.active { display: block; }
.code-editor, .pre-editor { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; padding: 1rem; padding-left: 3.8em; border: none; border-radius: 0; font-family: inherit; font-size: inherit; line-height: inherit; white-space: pre; word-wrap: normal; overflow: auto; box-sizing: border-box; }
.code-editor { background: transparent; color: transparent; caret-color: var(--text-color); resize: none; outline: none; z-index: 1; }
.pre-editor { pointer-events: none; z-index: 0; }
.pre-editor code { display: block; padding: 0; margin: 0; font-family: inherit; line-height: inherit; font-size: inherit; background: none; border: none; }
.pre-editor.line-numbers { padding-left: 3.8em; }
.line-numbers .line-numbers-rows { position: absolute; pointer-events: none; top: 1rem; font-size: 100%; left: 0; width: 3em; letter-spacing: -1px; border-right: 1px solid var(--border-color); user-select: none; }
.line-numbers-rows > span { pointer-events: none; display: block; counter-increment: linenumber; }
.line-numbers-rows > span:before { content: counter(linenumber); color: var(--text-secondary); display: block; padding-right: 0.8em; text-align: right; }
.config-group { margin-bottom: 1rem; }
.config-item { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; transition: opacity 0.3s ease; }
.config-item.expandable { cursor: pointer; }
.config-label { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.4; flex-grow: 1; }
.config-arrow { margin-left: 0.5rem; transition: transform 0.3s ease; color: var(--text-secondary); }
.config-arrow.expanded { transform: rotate(90deg); }
.config-sub-items { margin-top: 0.75rem; margin-left: 1rem; display: none; }
.config-sub-items.expanded { display: block; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--input-bg); border: 2px solid var(--border-color); transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: var(--text-secondary); transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-purple); }
input:checked + .slider:before { transform: translateX(20px); background-color: white; }
.config-item.disabled { opacity: 0.5; cursor: not-allowed; }
.config-item.disabled .config-label, .config-item.disabled .switch, .config-item.disabled.expandable { cursor: not-allowed; }
.chat-empty-state { margin: auto; max-width: 600px; text-align: center; }
.chat-empty-state .suggestion-text { text-align: center; }
.chat-empty-state .suggestion-pills { justify-content: center; }
.upgrade-btn { background: linear-gradient(45deg, var(--purple-light), var(--primary-purple)); color: white !important; font-weight: 600; box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3); }
.upgrade-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5); background: linear-gradient(45deg, #b39afd, #9a71f7); color: white !important; }
.config-select { width: 100%; padding: 0.5rem 0.75rem; border: 2px solid var(--border-color); border-radius: 8px; background-color: var(--input-bg); color: var(--text-color); font-size: 0.9rem; font-family: inherit; cursor: pointer; outline: none; transition: all 0.2s ease; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 0.5rem center; background-repeat: no-repeat; background-size: 1.5em 1.5em; }
.config-select:hover { border-color: var(--purple-light); }
.config-select:focus { border-color: var(--primary-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1); }
.config-select option:disabled { color: var(--text-secondary); }

/* --- OTHER PAGES & WALKTHROUGH --- */
.legal-content { background: var(--card-bg); border: 2px dashed var(--border-color); border-radius: 16px; padding: 2rem 3rem; box-shadow: var(--shadow); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); width: 100%; max-width: 800px; margin: 0 auto; color: var(--text-color); }
.legal-content h1 { font-size: 2.25rem; margin-bottom: 1rem; border-bottom: 2px solid var(--border-color); padding-bottom: 1rem; }
.legal-content h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; color: var(--primary-purple); }
.legal-content p, .legal-content li { line-height: 1.7; color: var(--text-secondary); margin-bottom: 1rem; }
.legal-content a { color: var(--primary-purple); text-decoration: none; }
.legal-content a:hover { text-decoration: underline; }
.legal-content ul, .legal-content ol { padding-left: 1.5rem; }
footer, .site-footer { width: 100%; padding: 2rem; text-align: center; color: var(--text-secondary); font-size: 0.875rem; margin-top: auto; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 0.5rem; }
.footer-links a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--primary-purple); text-decoration: underline; }
.info-content { max-width: 800px; padding: 2rem 3rem; }
.info-content h2 { font-size: 1.5rem; margin-top: 1.5rem; margin-bottom: 0.75rem; color: var(--primary-purple); }
.info-content h2:first-child { margin-top: 0; }
.info-content p { line-height: 1.7; color: var(--text-secondary); margin-bottom: 1rem; }
.info-content a { color: var(--primary-purple); font-weight: 600; text-decoration: none; }
.info-content a:hover { text-decoration: underline; }
.studio-logo-container { margin-top: 2.5rem; padding-top: 2rem; border-top: 2px dashed var(--border-color); text-align: center; }
.studio-logo { max-width: 200px; width: 100%; height: auto; opacity: 0.8; transition: opacity 0.3s ease; }
.studio-logo:hover { opacity: 1; }
.typing-dots { display: inline-block; padding: 0 5px; }
.typing-dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background-color: #8b5cf6; margin: 0 2px; opacity: 0.4; animation: typing 1.4s infinite ease-in-out both; }
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
.stream-cursor { display: inline-block; width: 8px; height: 1.2em; background-color: #8b5cf6; vertical-align: sub; animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
#walkthrough-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.8); z-index: 9998; }
.walkthrough-highlight { position: relative; z-index: 9999; border-radius: 8px; box-shadow: 0 0 12px 4px rgba(139, 92, 246, 0.7); transition: box-shadow 0.3s ease; }
#walkthrough-box { position: absolute; background: var(--card-bg); border: 2px dashed var(--border-color); border-radius: 12px; padding: 1.5rem; max-width: 350px; width: 90%; z-index: 10000; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); color: var(--text-color); line-height: 1.6; }
#walkthrough-text { font-size: 1rem; margin-bottom: 1.5rem; }
.walkthrough-nav { display: flex; justify-content: space-between; align-items: center; }
.walkthrough-step-nav { display: flex; gap: 0.5rem; }
#walkthrough-skip-btn, #walkthrough-back-btn, #walkthrough-next-btn { border: none; border-radius: 8px; padding: 0.5rem 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
#walkthrough-skip-btn, #walkthrough-back-btn { background: transparent; color: var(--text-secondary); }
#walkthrough-skip-btn:hover, #walkthrough-back-btn:hover { background: var(--input-bg); color: var(--text-color); box-shadow: 0 0 15px 3px rgba(139, 92, 246, 0.15); }
#walkthrough-next-btn { background: var(--primary-purple); color: white; }
#walkthrough-next-btn:hover { background: var(--purple-hover); box-shadow: 0 0 20px 4px rgba(139, 92, 246, 0.4); }
#walkthrough-arrow { position: absolute; width: 0; height: 0; border-style: solid; }
.arrow-up { border-width: 0 10px 10px 10px; border-color: transparent transparent var(--border-color) transparent; top: -12px; left: calc(50% - 10px); }
.arrow-down { border-width: 10px 10px 0 10px; border-color: var(--border-color) transparent transparent transparent; bottom: -12px; left: calc(50% - 10px); }
.arrow-left { border-width: 10px 10px 10px 0; border-color: transparent var(--border-color) transparent transparent; top: calc(50% - 10px); left: -12px; }
.arrow-right { border-width: 10px 0 10px 10px; border-color: transparent transparent transparent var(--border-color); top: calc(50% - 10px); right: -12px; }

/* --- ARTICLES PAGE --- */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; width: 100%; max-width: 1200px; }
.article-card { background: var(--card-bg); border: 2px dashed var(--border-color); border-radius: 16px; padding: 1.5rem; box-shadow: var(--shadow); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); transition: all 0.3s ease; text-decoration: none; color: var(--text-color); display: flex; flex-direction: column; }
.article-card:hover { transform: translateY(-5px); border-color: var(--purple-light); box-shadow: 0 0 25px 5px rgba(139, 92, 246, 0.25); }
.article-card h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.article-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; flex-grow: 1; }
.article-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--text-secondary); }
.article-tag { background: rgba(139, 92, 246, 0.1); color: var(--primary-purple); padding: 0.25rem 0.75rem; border-radius: 20px; font-weight: 500; }

/* --- CHANGELOG STYLES (NEW CARDS) --- */
.timeline { width: 100%; max-width: 800px; display: flex; flex-direction: column; gap: 2rem; }
.changelog-entry { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.entry-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.entry-header h2 { font-size: 1.75rem; font-weight: 700; margin: 0; }
.version-tag { background: var(--primary-purple); color: white; font-size: 0.8rem; font-weight: 600; padding: 0.25rem 0.75rem; border-radius: 20px; }
.entry-date { color: var(--text-secondary); font-size: 0.9rem; margin-left: auto; white-space: nowrap; }
.entry-body ul { list-style: none; padding-left: 0; }
.entry-body li { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.75rem; line-height: 1.6; background: var(--input-bg); padding: 1rem; border-radius: 12px; border: 1px dashed var(--border-color); }
.change-tag { flex-shrink: 0; font-size: 0.8rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 6px; text-transform: uppercase; }
.change-tag.feature { background: var(--tag-feature-bg); color: var(--tag-feature-text); }
.change-tag.fix { background: var(--tag-fix-bg); color: var(--tag-fix-text); }
.change-tag.improvement { background: var(--tag-improvement-bg); color: var(--tag-improvement-text); }
.change-tag.teaser { background: var(--tag-teaser-bg); color: var(--tag-teaser-text); }

/* --- PLUGIN MODAL STYLES (NEW) --- */
#plugin-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(5px); z-index: 10000; display: flex; align-items: center; justify-content: center; opacity: 0; animation: fadeIn 0.3s forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.plugin-modal { background: var(--card-bg); border: 2px solid var(--border-color); width: 90%; max-width: 600px; border-radius: 20px; padding: 2rem; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.5); max-height: 90vh; overflow-y: auto; }
.close-modal-btn { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 2rem; color: var(--text-secondary); cursor: pointer; line-height: 0.5; }
.modal-subtitle { color: var(--text-secondary); margin-bottom: 2rem; }
.steps-container { display: flex; flex-direction: column; gap: 1.5rem; }
.step-card { display: flex; gap: 1rem; background: var(--input-bg); padding: 1rem; border-radius: 12px; border: 1px dashed var(--border-color); align-items: flex-start; }
.step-number { background: var(--primary-purple); color: white; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.step-content { flex-grow: 1; }
.step-content h3 { margin: 0 0 0.25rem 0; font-size: 1.1rem; }
.step-content p { margin: 0 0 0.75rem 0; font-size: 0.9rem; color: var(--text-secondary); }
.key-generation-box { display: flex; gap: 0.5rem; }
#modal-api-key-input { font-family: monospace; font-size: 0.9rem; padding: 0.5rem; width: 100%; }
#modal-generate-btn, #modal-copy-btn { background: var(--primary-purple); color: white; border: none; padding: 0 1rem; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.instruction-image-placeholder { width: 100%; height: 60px; background: rgba(0,0,0,0.2); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: var(--text-secondary); border: 1px solid var(--border-color); }
.small-btn { padding: 0.5rem 1rem; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 6px; }

/* --- FIX 1: BETTER BETA BANNER --- */
.beta-banner {
    position: fixed;
    /* Move it down so it doesn't touch the navbar */
    top: 7rem; 
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background: rgba(249, 115, 22, 0.15); /* Slightly darker for contrast */
    color: var(--primary-orange);
    border: 1px solid var(--primary-orange);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 900; /* Below Navbar (1000) */
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.beta-banner p {
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
}

.beta-banner-close {
    background: transparent;
    border: none;
    color: var(--primary-orange);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.beta-banner-close:hover {
    opacity: 1;
    background: rgba(249, 115, 22, 0.2);
    border-radius: 4px;
}

/* --- FIX 2: DISCORD CALLOUT (New Class) --- */
.discord-callout {
    background: rgba(88, 101, 242, 0.1);
    border: 1px solid #5865F2;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap; /* Allows wrapping on mobile */
}

.discord-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.discord-btn {
    background-color: #5865F2;
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s;
}

.discord-btn:hover {
    background-color: #4752c4;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
    transform: translateY(-2px);
}

/* Mobile Adjustment for Banner */
@media (max-width: 768px) {
    .beta-banner {
        top: 6rem; /* Adjust for mobile navbar height */
        width: 95%;
        padding: 0.75rem;
        flex-direction: row;
        align-items: flex-start;
    }
    .beta-banner-close {
        margin-left: 0.5rem;
        margin-top: -2px; /* Align with text top */
    }
}

.usage-meter {
    padding: 1rem; /* Increased padding */
    margin: 0 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Adds space between elements */
}

/* In style.css, replace the existing .usage-text (near line 1021) with this: */

.usage-text {
    font-size: 0.85rem;
    display: block;          /* Changed from 'flex' to 'block' so text flows naturally */
    text-align: center;      /* Centers the text */
    justify-content: normal; /* Resets the spacing issue */
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-weight: 600;
}

.upgrade-link {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700; /* Bolder */
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    padding: 0.6rem 0; /* Taller button */
    border-radius: 6px;
    background: linear-gradient(45deg, var(--purple-light), var(--primary-purple));
    color: white !important;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

/* --- SYNTAX HIGHLIGHTING (PRISM.JS THEME) --- */
/* Base overrides */
code[class*="language-"],
pre[class*="language-"] {
    color: var(--text-color);
    text-shadow: none !important;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace !important;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    line-height: 1.5;
    tab-size: 4;
    hyphens: none;
}

/* Comments (Grey/Italic) */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: var(--text-secondary);
    font-style: italic;
}

/* Punctuation ((), {}, [], etc.) */
.token.punctuation {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Numbers, Booleans, Constants (Orange) */
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: var(--primary-orange);
}

/* Strings, Chars (Green) */
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: var(--tag-feature-text);
}

/* Operators (+, -, =, etc.) */
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: var(--text-color);
}

/* Keywords (local, if, then, end, function) - Purple */
.token.atrule,
.token.attr-value,
.token.keyword {
    color: var(--primary-purple);
    font-weight: 500;
}

/* Functions & Class Names (Blue) */
/* We define specific colors here to ensure contrast against your backgrounds */
.token.function,
.token.class-name {
    color: #3b82f6; /* Default Blue */
}

.token.regex,
.token.important,
.token.variable {
    color: var(--danger-red);
}

.token.important,
.token.bold {
    font-weight: bold;
}
.token.italic {
    font-style: italic;
}

/* --- GLOW EFFECTS (Dark Mode Only) --- */
@media (prefers-color-scheme: dark) {
    /* 
       Apply bloom to the editor container AND every single element inside it.
       'currentColor' ensures the glow matches the text color (Purple glows Purple, White glows White).
    */
    code[class*="language-"],
    pre[class*="language-"],
    code[class*="language-"] * {
        text-shadow: 0 0 20px currentColor !important;
    }
}

/* --- LIGHT MODE ADJUSTMENTS --- */
@media (prefers-color-scheme: light) {
    .token.function,
    .token.class-name {
        color: #2563eb; /* Darker Blue for Light Mode */
    }
    
    /* Ensure code background in editor is explicitly transparent to show the highlights */
    .code-editor {
        color: transparent !important;
        background: transparent !important;
        caret-color: var(--text-color); /* Cursor remains visible */
    }
}

/* --- USAGE BAR STYLES --- */
.usage-bar-container {
    width: 100%;
    height: 8px; /* Height of the bar */
    background-color: var(--card-bg); /* Track color */
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin: 4px 0 8px 0; /* Spacing */
    overflow: hidden;
    position: relative;
}

.usage-bar {
    height: 100%;
    width: 0%; /* JS will update this */
    background: linear-gradient(90deg, var(--primary-purple), var(--purple-light));
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* Optional: Make the text smaller to fit better */
/* In style.css, replace the existing .usage-text (near line 1021) with this: */

.usage-text {
    font-size: 0.85rem;
    display: block;          /* Changed from 'flex' to 'block' so text flows naturally */
    text-align: center;      /* Centers the text */
    justify-content: normal; /* Resets the spacing issue */
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-weight: 600;
}