/* ═══════════════════════════════════════════
 * Nisha.AI — Design System v2.1
 * Neural / Cyberpunk Aesthetic
   ═══════════════════════════════════════════ */

:root {
    --accent: #40e0d0;
    --accent-dim: rgba(64, 224, 208, 0.15);
    --accent-glow: rgba(64, 224, 208, 0.3);
    --purple: #007bff;
    --purple-dim: rgba(0, 123, 255, 0.15);
    --bg: #010a14;
    --surface: rgba(4, 15, 30, 0.75);
    --surface-hover: rgba(8, 25, 50, 0.85);
    --border: rgba(64, 224, 208, 0.15);
    --border-hover: rgba(64, 224, 208, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a0c4ff;
    --text-muted: #5e7ba8;
    --success: #00e676;
    --error: #ff5252;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── AMBIENT GLOW ── */
.glow-orb {
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    animation: float 18s infinite alternate ease-in-out;
}
#glow-1 {
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: -250px;
    left: -150px;
}
#glow-2 {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    bottom: -300px;
    right: -200px;
    animation-delay: -8s;
}
@keyframes float {
    0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    50% { transform: translate(30px, -20px) scale(1.1); opacity: 0.5; }
    100% { transform: translate(-20px, 15px) scale(0.95); opacity: 0.35; }
}

/* ── MAIN LAYOUT: Fullscreen Spline + Hologram Chat ── */
#app {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ── IMMERSIVE 3D BACKGROUND ── */
#character-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/ai_bhoomi_bg.png') center/cover no-repeat;
    background-color: #05101a;
    z-index: 0;
}
#character-viewport::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Soften and dim the artwork slightly so the 3D character and HUD UI remain legible */
    background: linear-gradient(to right, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 1;
}

#spline-robot {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: block;
}

#spline-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Loading Overlay */
#loading-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 50;
    transition: opacity 0.5s ease;
}
.loader-ring {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--accent);
}

/* HUD overlay on 3D viewport */
#character-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hud-brand {
    pointer-events: auto;
}
.logo {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.8);
}
.sub {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

.hud-stats {
    display: flex;
    gap: 12px;
    align-self: flex-start;
}
.hud-stat {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.hud-stat-val { font-weight: 800; color: var(--accent); font-size: 1.1rem; }
.hud-stat-label { font-size: 0.55rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.hud-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 8px 18px;
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
}
.pulse {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--success);
    animation: blink 2s infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }

#voice-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 8px 18px;
    align-self: flex-start;
}
.voice-bars {
    display: flex; gap: 3px; align-items: flex-end; height: 18px;
}
.voice-bars span {
    width: 3px; background: var(--accent); border-radius: 2px;
    animation: bar-idle 1.5s infinite ease-in-out;
}
.voice-bars span:nth-child(1) { height: 5px; animation-delay: 0s; }
.voice-bars span:nth-child(2) { height: 9px; animation-delay: 0.15s; }
.voice-bars span:nth-child(3) { height: 13px; animation-delay: 0.3s; }
.voice-bars span:nth-child(4) { height: 9px; animation-delay: 0.45s; }
.voice-bars span:nth-child(5) { height: 5px; animation-delay: 0.6s; }
.voice-bars.active span { animation: bar-active 0.3s infinite ease-in-out alternate; }
@keyframes bar-idle { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.4); } }
@keyframes bar-active { 0% { transform: scaleY(0.3); } 100% { transform: scaleY(1.8); } }
.voice-label { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted); }

/* 3D Control Buttons */
#spline-controls {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    gap: 8px;
    z-index: 20;
}
.ctrl-btn {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.ctrl-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: scale(1.1);
}

/* ── RIGHT: FLOATING CHAT UI ── */
#chat-section {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 600px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    background: rgba(3, 6, 12, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(64, 224, 208, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(64, 224, 208, 0.1);
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#chat-section.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* Floating Robo Trigger */
#floating-trigger {
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(64, 224, 208, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    cursor: pointer;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(64, 224, 208, 0.1);
}

#floating-trigger:hover {
    transform: scale(1.1);
    background: radial-gradient(circle, rgba(64, 224, 208, 0.3) 0%, transparent 70%);
    box-shadow: 0 0 30px rgba(64, 224, 208, 0.2);
}

#floating-trigger .trigger-label {
    position: absolute;
    top: -30px;
    background: var(--accent);
    color: #000;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

#floating-trigger:hover .trigger-label {
    opacity: 1;
    transform: translateY(0);
}

#close-chat {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

#close-chat:hover {
    color: var(--error);
}

#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(3, 6, 10, 0.5);
}
.header-tag { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 2px; color: var(--text-muted); }
.header-topic { font-size: 0.65rem; color: var(--text-muted); }
.header-topic strong { color: var(--accent); }

/* Language Toggle */
.lang-select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lang-select:hover {
    border-color: var(--accent);
}
.lang-select option {
    background: var(--bg);
    color: var(--text-primary);
}

/* Temporal Ribbon */
#temporal-ribbon {
    display: flex;
    gap: 8px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
}
.temp-chip {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}
.temp-chip.past { background: rgba(245, 158, 11, 0.08); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.temp-chip.present { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(0, 229, 255, 0.2); }
.temp-chip.future { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(167, 139, 250, 0.2); }

/* Messages */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.05) transparent;
}
#chat-messages::-webkit-scrollbar { width: 5px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

.msg-group {
    display: flex;
    gap: 12px;
    max-width: 90%;
    animation: msgSlide 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.msg-group.agent { align-self: flex-start; }
.msg-group.user { align-self: flex-end; flex-direction: row-reverse; }
@keyframes msgSlide { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.msg-avatar {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.7rem; flex-shrink: 0;
}
.agent .msg-avatar { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(0,229,255,0.2); }
.user .msg-avatar { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(167,139,250,0.2); }

.msg-content { display: flex; flex-direction: column; gap: 5px; }
.msg-bubble {
    padding: 14px 18px; border-radius: 16px;
    font-size: 0.88rem; line-height: 1.6;
}
.agent .msg-bubble {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-primary); border-bottom-left-radius: 4px;
}
.user .msg-bubble {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff; border-bottom-right-radius: 4px;
}
.msg-meta { font-family: var(--font-mono); font-size: 0.55rem; color: var(--text-muted); padding: 0 4px; }
.user .msg-meta { text-align: right; }

.msg-bubble code { background: rgba(0,229,255,0.1); color: var(--accent); padding: 2px 7px; border-radius: 5px; font-family: var(--font-mono); font-size: 0.78rem; }
.msg-bubble strong { color: var(--accent); }
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 { margin: 14px 0 6px; color: var(--accent); font-size: 0.95rem; }
.msg-bubble ul, .msg-bubble ol { padding-left: 18px; margin: 6px 0; }
.msg-bubble li { margin: 3px 0; }
.msg-bubble a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.msg-bubble p { margin: 6px 0; }

/* Typing */
#typing-indicator {
    display: none; align-items: center; gap: 10px;
    padding: 10px 24px; color: var(--accent);
    font-family: var(--font-mono); font-size: 0.65rem;
}
#typing-indicator.visible { display: flex; }
.typing-dots { display: flex; gap: 4px; }
.typing-dots span {
    width: 5px; height: 5px; background: var(--accent); border-radius: 50%;
    animation: dotPulse 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotPulse { 0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; } 40% { transform: scale(1); opacity: 1; } }

/* Input */
#input-area {
    padding: 18px 24px;
    background: rgba(3, 6, 10, 0.6);
    border-top: 1px solid var(--border);
    display: flex; gap: 10px; align-items: center;
}

/* File Upload Button */
.upload-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}
#user-input {
    flex: 1;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 14px 18px;
    color: var(--text-primary); font-family: var(--font-sans); font-size: 0.88rem;
    outline: none; transition: all 0.3s ease;
}
#user-input::placeholder { color: var(--text-muted); }
#user-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: var(--surface-hover);
}
#send-btn {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #0097a7);
    border: none; color: #000; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; flex-shrink: 0;
}
#send-btn:hover { transform: scale(1.05); box-shadow: 0 0 25px var(--accent-glow); }
#send-btn:active { transform: scale(0.95); }

/* Mic Button */
#mic-btn {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease; flex-shrink: 0;
}
#mic-btn:hover { border-color: var(--accent); color: var(--accent); }
#mic-btn.recording {
    background: rgba(255, 50, 50, 0.15);
    border-color: #ff5252;
    color: #ff5252;
    animation: micPulse 1s infinite;
}
@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255, 82, 82, 0); }
}

/* Particle Canvas */
#particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

/* Speaking glow on 3D viewport */
#character-viewport.speaking {
    box-shadow: inset 0 0 80px rgba(0, 229, 255, 0.12);
}
#character-viewport.speaking #spline-canvas {
    filter: brightness(1.15) contrast(1.05);
    transition: filter 0.5s ease;
}

/* ── IMAGE STUDIO ── */
#image-studio-toggle {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 500;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(64, 224, 208, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #fff;
    padding: 12px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
}
#image-studio-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.6);
}
#image-studio-toggle .studio-icon {
    font-size: 1.2rem;
}

#image-studio {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: rgba(3, 6, 12, 0.92);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 50px rgba(139, 92, 246, 0.08);
    z-index: 1001;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

#image-studio.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.studio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.05);
}
.studio-header h2 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #a78bfa;
    display: flex;
    align-items: center;
    gap: 8px;
}
.studio-header h2 span {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 1px;
}
.studio-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}
.studio-close:hover { color: var(--error); }

.studio-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.05) transparent;
}

.studio-section-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.studio-prompt-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.studio-prompt {
    width: 100%;
    min-height: 80px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    outline: none;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.5;
}
.studio-prompt::placeholder { color: var(--text-muted); }
.studio-prompt:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* Style Chips */
.style-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.style-chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}
.style-chip:hover {
    border-color: #a78bfa;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.1);
}
.style-chip.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(64, 224, 208, 0.15));
    border-color: #a78bfa;
    color: #fff;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

/* Dimension Controls */
.dimension-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}
.dim-select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.dim-select:hover { border-color: #a78bfa; }
.dim-select option { background: var(--bg); color: var(--text-primary); }

/* Generate Button */
.studio-generate-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.studio-generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.35);
}
.studio-generate-btn:active {
    transform: translateY(0);
}
.studio-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Generating animation */
.studio-generate-btn.generating {
    background: linear-gradient(270deg, #8b5cf6, #6d28d9, #a78bfa, #8b5cf6);
    background-size: 600% 600%;
    animation: gradientShift 2s ease infinite;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Generated Image Gallery */
.studio-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.generated-image-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: imgCardSlide 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes imgCardSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.generated-image-card img {
    width: 100%;
    display: block;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.image-card-info {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.image-card-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.image-card-meta .prompt-text {
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
}
.image-card-meta .meta-tags {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}
.image-card-meta .meta-tags span {
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.image-card-actions {
    display: flex;
    gap: 8px;
}
.img-action-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.img-action-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: #a78bfa;
}
.img-action-btn.download {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    border: none;
}
.img-action-btn.download:hover {
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Studio Progress */
.studio-progress {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
}
.studio-progress.active { display: flex; }

.progress-ring {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(139, 92, 246, 0.15);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.progress-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #a78bfa;
    letter-spacing: 1px;
}

/* Error state */
.studio-error {
    padding: 12px 16px;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.75rem;
    display: none;
}
.studio-error.visible { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    #chat-section { 
        top: 40vh; right: 0; left: 0; bottom: 0;
        width: 100%;
        border-radius: 24px 24px 0 0;
        border-left: none; border-right: none; border-bottom: none;
    }
    #spline-controls { bottom: auto; top: 100px; right: 10px; }
    #image-studio {
        width: 95%;
        max-height: 80vh;
    }
    #image-studio-toggle {
        bottom: 20px;
        left: 20px;
        padding: 10px 14px;
        font-size: 0.6rem;
    }
    .image-card-meta .prompt-text {
        max-width: 180px;
    }
}
