/* ============================================
   ApexAurum - Alchemical Design System
   ============================================ */

:root {
    /* Core palette - aged gold meets deep shadow */
    --gold: #C9A227;
    --gold-light: #E8D48A;
    --gold-dim: #8B7355;
    --gold-glow: rgba(201, 162, 39, 0.15);

    /* Backgrounds - layered darkness */
    --bg-deep: #0A0A0B;
    --bg-surface: #111113;
    --bg-elevated: #1A1A1D;
    --bg-hover: #222226;

    /* Text hierarchy */
    --text-primary: #F5F5F4;
    --text-secondary: #A8A8A6;
    --text-muted: #6B6B69;

    /* Accent - subtle teal for contrast */
    --accent: #2DD4BF;
    --accent-dim: #0D9488;

    /* Functional */
    --border: rgba(255, 255, 255, 0.08);
    --border-gold: rgba(201, 162, 39, 0.3);

    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-deep);
    overflow-x: hidden;
}

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

img, svg {
    display: block;
    max-width: 100%;
}

ul {
    list-style: none;
}

/* ============================================
   Utilities
   ============================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ============================================
   Navigation
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-sm) 0;
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.logo-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border-radius: 8px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--gold);
}

.nav-cta {
    padding: 0.5rem 1rem;
    background: var(--gold-glow);
    border: 1px solid var(--border-gold);
    border-radius: 6px;
    color: var(--gold) !important;
}

.nav-cta:hover {
    background: rgba(201, 162, 39, 0.25);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-fast);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(80px + var(--space-xl)) var(--space-md) var(--space-xl);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, var(--gold-glow), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(45, 212, 191, 0.05), transparent);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.hero-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    margin-bottom: var(--space-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: rgba(45, 212, 191, 0.1);
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 100px;
}

.hero-title {
    margin-bottom: var(--space-md);
}

.title-line {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

.title-line.accent {
    color: var(--gold);
}

.hero-subtitle {
    max-width: 560px;
    margin-bottom: var(--space-lg);
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.btn-primary {
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: 0 4px 24px rgba(201, 162, 39, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(201, 162, 39, 0.35);
}

.btn-secondary {
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-outline {
    color: var(--gold);
    background: transparent;
    border: 1px solid var(--border-gold);
}

.btn-outline:hover {
    background: var(--gold-glow);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: var(--space-xl);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
}

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

/* Hero Glyph */
.hero-glyph {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(280px, 35vw, 450px);
    opacity: 0.15;
    color: var(--gold);
    animation: rotate-slow 120s linear infinite;
}

@keyframes rotate-slow {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ============================================
   Section Styles
   ============================================ */

section {
    padding: var(--space-2xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Features Section
   ============================================ */

.features {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-md);
}

.feature-card {
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all var(--transition-base);
}

.feature-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    color: var(--gold);
    background: var(--gold-glow);
    border-radius: 10px;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.feature-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ============================================
   Agents Section
   ============================================ */

.agents {
    background: var(--bg-deep);
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-md);
}

.agent-card {
    position: relative;
    padding: var(--space-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
    transition: all var(--transition-base);
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.agent-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-4px);
}

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

.agent-symbol {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-md);
    color: var(--gold);
    opacity: 0.8;
}

.agent-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.agent-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gold-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
}

.agent-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ============================================
   Protocol Section
   ============================================ */

.protocol {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.protocol-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.protocol-text .section-title {
    text-align: left;
}

.protocol-desc {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.protocol-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.protocol-list li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-left: var(--space-md);
    border-left: 2px solid var(--gold-dim);
}

.protocol-realm {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
}

.protocol-detail {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.protocol-convergence {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding: var(--space-md);
    background: var(--gold-glow);
    border-radius: 8px;
    border-left: 3px solid var(--gold);
}

.protocol-convergence strong {
    color: var(--gold);
}

/* Protocol Visual */
.protocol-visual {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.realm {
    position: absolute;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
}

.realm-private {
    top: 10%;
    left: 10%;
}

.realm-shared {
    top: 10%;
    right: 10%;
}

.realm-bridge {
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gold-glow);
}

.protocol-connections {
    position: absolute;
    width: 100%;
    height: 100%;
    color: var(--gold);
}

/* ============================================
   Beta Section
   ============================================ */

.beta {
    background: var(--bg-deep);
    text-align: center;
}

.beta-content {
    max-width: 560px;
    margin: 0 auto;
}

.beta-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.beta-form {
    margin-bottom: var(--space-lg);
}

.form-group {
    display: flex;
    gap: var(--space-sm);
    max-width: 480px;
    margin: 0 auto var(--space-sm);
}

.form-input {
    flex: 1;
    padding: 0.875rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--gold);
}

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

.beta-alt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    padding: var(--space-xl) 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.footer-brand .logo-symbol {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.footer-brand .logo-text {
    font-size: 1rem;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
    margin: var(--space-sm) 0;
}

.footer-links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--gold);
}

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

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 900px) {
    .protocol-content {
        grid-template-columns: 1fr;
    }

    .protocol-visual {
        order: -1;
        height: 200px;
    }

    .hero-glyph {
        opacity: 0.08;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: var(--space-sm);
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: var(--space-sm);
        border-radius: 6px;
    }

    .nav-links a:hover {
        background: var(--bg-hover);
    }

    .nav-toggle {
        display: flex;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-md);
    }

    .form-group {
        flex-direction: column;
    }

    .beta-alt {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero-glyph {
        display: none;
    }

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

/* ============================================
   Chat Page
   ============================================ */

.chat-page {
    min-height: 100vh;
    padding-top: 68px;
}

.chat-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 68px);
}

/* Chat Sidebar */
.chat-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* Persona Selector */
.persona-selector {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.persona-btn {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    gap: 0 var(--space-sm);
    align-items: center;
    padding: var(--space-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.persona-btn:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.persona-btn.active {
    background: var(--gold-glow);
    border-color: var(--border-gold);
}

.persona-icon {
    grid-row: span 2;
    width: 40px;
    height: 40px;
    color: var(--gold);
    opacity: 0.7;
}

.persona-btn.active .persona-icon {
    opacity: 1;
}

.persona-name {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.persona-title {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* API Key Input */
.api-key-input {
    display: flex;
    gap: var(--space-xs);
}

.api-key-input input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.api-key-input input:focus {
    border-color: var(--gold);
}

.api-key-input input::placeholder {
    color: var(--text-muted);
}

.toggle-visibility {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-visibility:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.eye-icon {
    width: 16px;
    height: 16px;
}

.api-key-note {
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.api-key-note a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.api-key-note a:hover {
    color: var(--gold-light);
}

/* Model Selector */
.model-selector {
    display: flex;
    gap: var(--space-xs);
}

.model-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-sm) var(--space-xs);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.model-btn:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.model-btn.active {
    background: var(--gold-glow);
    border-color: var(--border-gold);
}

.model-name {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.model-btn.active .model-name {
    color: var(--gold);
}

.model-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Clear Chat Button */
.clear-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.625rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.clear-chat-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border-color: rgba(255, 255, 255, 0.12);
}

.clear-chat-btn svg {
    width: 16px;
    height: 16px;
}

/* Chat Main Area */
.chat-main {
    display: flex;
    flex-direction: column;
    background: var(--bg-deep);
}

.chat-header {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.current-persona {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.current-persona-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.1em;
}

.current-persona-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
    margin: auto;
    max-width: 400px;
}

.welcome-glyph {
    width: 100px;
    height: 100px;
    margin-bottom: var(--space-md);
    color: var(--gold);
    opacity: 0.4;
}

.welcome-message h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.welcome-message p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: var(--space-sm);
    max-width: 80%;
    animation: message-in 0.3s ease;
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    align-self: flex-start;
}

.message-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

.message.user .message-avatar {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.message.assistant .message-avatar {
    background: var(--gold-glow);
    color: var(--gold);
    font-family: var(--font-display);
}

.message-content {
    padding: var(--space-sm) var(--space-md);
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.message.user .message-content {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin-bottom: 0.75em;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: var(--space-sm) var(--space-md);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0.4;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* Error message */
.message-error {
    padding: var(--space-sm) var(--space-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #FCA5A5;
    font-size: 0.85rem;
}

/* Chat Input */
.chat-input-area {
    padding: var(--space-md);
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.chat-input-container {
    display: flex;
    gap: var(--space-sm);
    max-width: 800px;
    margin: 0 auto;
}

.chat-input-container textarea {
    flex: 1;
    padding: 0.875rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    resize: none;
    min-height: 48px;
    max-height: 200px;
    transition: border-color var(--transition-fast);
}

.chat-input-container textarea:focus {
    border-color: var(--gold);
}

.chat-input-container textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border: none;
    border-radius: 12px;
    color: var(--bg-deep);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

.input-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Chat Responsive */
@media (max-width: 768px) {
    .chat-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .chat-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
        padding: var(--space-sm);
    }

    .sidebar-section {
        flex: 1;
        min-width: 200px;
    }

    .sidebar-section:first-child {
        flex: 2;
        min-width: 100%;
    }

    .persona-selector {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .persona-btn {
        flex: 1;
        min-width: 120px;
        grid-template-columns: 32px 1fr;
    }

    .persona-icon {
        width: 32px;
        height: 32px;
    }

    .message {
        max-width: 90%;
    }
}
