/* ============================================================
   Ousian.xyz — Theme
   Color Palette:
     - Deep Navy:     #0d0f1a, #111328
     - Royal Blue:    #1a1d42, #252a5e
     - Hydro Aqua:    #4fc3f7, #29b6f6, #00bcd4
     - Lavender:      #b388ff, #e0c3fc
     - Gold (accent): #ffd54f, #ffca28
     - White:         #f0f4ff, #dce6ff
   ============================================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
    /* Backgrounds */
    --bg-primary: #0a0c18;
    --bg-secondary: #0f1126;
    --bg-surface: #141735;
    --bg-surface-hover: #1a1e48;
    --bg-elevated: #1c2050;

    /* Hydro Aqua */
    --aqua-50: #e0f7fa;
    --aqua-100: #b2ebf2;
    --aqua-200: #80deea;
    --aqua-300: #4fc3f7;
    --aqua-400: #29b6f6;
    --aqua-500: #00bcd4;
    --aqua-glow: rgba(79, 195, 247, 0.15);
    --aqua-glow-strong: rgba(79, 195, 247, 0.3);

    /* Lavender */
    --lavender-300: #e0c3fc;
    --lavender-400: #b388ff;
    --lavender-500: #9c64ff;

    /* Gold accent */
    --gold-300: #ffd54f;
    --gold-400: #ffca28;
    --gold-500: #ffb300;

    /* Text */
    --text-primary: #edf2ff;
    --text-secondary: #a4b0d6;
    --text-muted: #6b7aaa;
    --text-accent: var(--aqua-300);

    /* Borders */
    --border-subtle: rgba(79, 195, 247, 0.08);
    --border-default: rgba(79, 195, 247, 0.15);
    --border-strong: rgba(79, 195, 247, 0.25);

    /* Gradients */
    --gradient-aqua: linear-gradient(135deg, #4fc3f7, #00bcd4);
    --gradient-lavender: linear-gradient(135deg, #b388ff, #e0c3fc);
    --gradient-gold: linear-gradient(135deg, #ffd54f, #ffca28);
    --gradient-hero: linear-gradient(135deg, #4fc3f7 0%, #b388ff 50%, #ffd54f 100%);
    --gradient-surface: linear-gradient(180deg, rgba(79, 195, 247, 0.04) 0%, transparent 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(79, 195, 247, 0.15);

    /* Spacing */
    --header-height: 64px;
    --input-area-height: auto;
    --max-chat-width: 800px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Background Effects ---------- */
.bg-effects {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(79, 195, 247, 0.06);
    animation: ripple-expand 12s ease-out infinite;
}

.ripple-1 {
    width: 600px;
    height: 600px;
    bottom: -200px;
    left: -100px;
    animation-delay: 0s;
}

.ripple-2 {
    width: 800px;
    height: 800px;
    top: -300px;
    right: -200px;
    animation-delay: 4s;
    border-color: rgba(179, 136, 255, 0.05);
}

.ripple-3 {
    width: 500px;
    height: 500px;
    bottom: 10%;
    right: 20%;
    animation-delay: 8s;
    border-color: rgba(255, 213, 79, 0.04);
}

@keyframes ripple-expand {
    0% { transform: scale(0.8); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.water-shimmer {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 80%, rgba(79, 195, 247, 0.04), transparent),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(179, 136, 255, 0.03), transparent),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 213, 79, 0.02), transparent);
    animation: shimmer-drift 20s ease-in-out infinite alternate;
}

@keyframes shimmer-drift {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-20px) scale(1.02); }
}

/* ---------- App Container ---------- */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
}

/* ---------- Header ---------- */
.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(15, 17, 38, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

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

.logo-mark {
    display: flex;
    align-items: center;
    animation: logo-float 6s ease-in-out infinite;
}

@keyframes logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.header-title h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    line-height: 1.2;
}

.title-accent {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: rgba(79, 195, 247, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(79, 195, 247, 0.12);
    color: var(--aqua-300);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-glow);
}

.btn-new-chat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: rgba(79, 195, 247, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all var(--transition-fast);
}

.btn-new-chat:hover {
    background: rgba(79, 195, 247, 0.12);
    color: var(--aqua-300);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-glow);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 8px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 0 14px rgba(76, 175, 80, 0.6); }
}

.status-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---------- Chat Area ---------- */
.chat-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.chat-area::-webkit-scrollbar {
    width: 6px;
}

.chat-area::-webkit-scrollbar-track {
    background: transparent;
}

.chat-area::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.15);
    border-radius: 3px;
}

.chat-area::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 195, 247, 0.25);
}

/* ---------- Welcome Screen ---------- */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px 24px;
    text-align: center;
    animation: fade-up 0.8s ease-out;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-emblem {
    margin-bottom: 24px;
    animation: emblem-spin 20s linear infinite;
}

@keyframes emblem-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.welcome-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: 40px;
    font-weight: 300;
}

.quick-prompts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 560px;
    width: 100%;
}

.quick-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(20, 23, 53, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: left;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(10px);
}

.quick-prompt:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

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

/* ---------- Messages ---------- */
.messages-container {
    display: flex;
    flex-direction: column;
    padding: 24px;
    max-width: var(--max-chat-width);
    width: 100%;
    margin: 0 auto;
    gap: 4px;
}

.message {
    display: flex;
    gap: 12px;
    animation: msg-appear 0.4s ease-out;
    padding: 12px 0;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 2px;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
    color: #1a1a2e;
}

.message.assistant .message-avatar {
    background: var(--gradient-aqua);
    color: #0a0c18;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message.user .message-sender {
    color: var(--gold-300);
}

.message.assistant .message-sender {
    color: var(--aqua-300);
}

.message-text {
    font-size: 0.925rem;
    line-height: 1.7;
    color: var(--text-primary);
    word-wrap: break-word;
}

.message-text p {
    margin-bottom: 8px;
}

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

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: typing-wave 1.8s ease-in-out infinite;
}

.typing-dot:nth-child(1) {
    background: var(--aqua-300);
    animation-delay: 0s;
}
.typing-dot:nth-child(2) {
    background: var(--lavender-400);
    animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
    background: var(--aqua-400);
    animation-delay: 0.4s;
}

@keyframes typing-wave {
    0%, 100% {
        transform: translateY(0) scale(0.8);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-8px) scale(1.1);
        opacity: 1;
        box-shadow: 0 0 12px rgba(79, 195, 247, 0.5);
    }
    50% {
        transform: translateY(0) scale(0.9);
        opacity: 0.6;
    }
}

/* ---------- Input Area ---------- */
.input-area {
    flex-shrink: 0;
    padding: 16px 24px 20px;
    background: rgba(15, 17, 38, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
}

.input-wrapper {
    max-width: var(--max-chat-width);
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 8px 8px 8px 20px;
    transition: all var(--transition-base);
}

.input-wrapper:focus-within {
    border-color: var(--aqua-400);
    box-shadow: 0 0 0 3px var(--aqua-glow), var(--shadow-glow);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.925rem;
    line-height: 1.5;
    resize: none;
    max-height: 150px;
    padding: 8px 0;
}

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

.btn-send {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient-aqua);
    color: #0a0c18;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.btn-send:not(:disabled):hover {
    transform: scale(1.08);
    box-shadow: 0 0 16px rgba(79, 195, 247, 0.4);
}

.btn-send:not(:disabled):active {
    transform: scale(0.95);
}

.input-footer-text {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 10px;
    opacity: 0.7;
    font-style: italic;
}

/* ---------- Streaming Cursor ---------- */

/* Shimmer placeholder — shown while waiting for first token */
.message-text .thinking-shimmer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}

.thinking-shimmer .shimmer-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        rgba(79, 195, 247, 0.06) 0%,
        rgba(179, 136, 255, 0.15) 40%,
        rgba(79, 195, 247, 0.06) 80%
    );
    background-size: 200% 100%;
    animation: shimmer-slide 1.8s ease-in-out infinite;
}

.thinking-shimmer .shimmer-line:nth-child(1) { width: 75%; animation-delay: 0s; }
.thinking-shimmer .shimmer-line:nth-child(2) { width: 55%; animation-delay: 0.15s; }
.thinking-shimmer .shimmer-line:nth-child(3) { width: 65%; animation-delay: 0.3s; }

@keyframes shimmer-slide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Active streaming cursor — shown after text starts flowing */
.streaming-cursor::after {
    content: '';
    display: inline-block;
    width: 2.5px;
    height: 1.15em;
    margin-left: 3px;
    vertical-align: text-bottom;
    background: var(--aqua-300);
    border-radius: 2px;
    animation: cursor-glow 1s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.5), 0 0 4px rgba(79, 195, 247, 0.3);
}

@keyframes cursor-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(79, 195, 247, 0.5); }
    50% { opacity: 0.3; box-shadow: 0 0 4px rgba(79, 195, 247, 0.15); }
}

/* ---------- Code Blocks ---------- */
.message-text pre {
    background: rgba(10, 12, 24, 0.8);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin: 10px 0;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
}

.message-text pre code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    color: var(--aqua-200);
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
}

.message-text code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    background: rgba(79, 195, 247, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--aqua-200);
    border: 1px solid rgba(79, 195, 247, 0.1);
}

.message-text p {
    margin-bottom: 8px;
}

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

/* ---------- Error Messages ---------- */
.error-message {
    border-left: 3px solid #ef5350;
    padding-left: 12px;
    margin-left: -3px;
}

/* ---------- Generated Images ---------- */
.generated-image-container {
    position: relative;
    display: inline-block;
    margin: 8px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-default);
    max-width: 512px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.generated-image-container:hover {
    border-color: var(--lavender-400);
    box-shadow: 0 0 20px rgba(179, 136, 255, 0.2), var(--shadow-lg);
    transform: translateY(-2px);
}

.generated-image {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
    transition: transform var(--transition-base);
    background: var(--bg-surface);
    min-height: 200px;
}

.generated-image:hover {
    transform: scale(1.02);
}

.image-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 17, 38, 0.8);
    backdrop-filter: blur(10px);
    color: var(--lavender-300);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    border: 1px solid rgba(179, 136, 255, 0.2);
}

.image-caption {
    margin-top: 10px;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---------- Image Loading Indicator ---------- */
.image-loading {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0;
    max-width: 400px;
}

.image-loading-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 400px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(179, 136, 255, 0.15);
    background: var(--bg-surface);
}

/* Animated gradient shimmer */
.image-loading-canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            135deg,
            rgba(179, 136, 255, 0.05) 0%,
            rgba(79, 195, 247, 0.08) 25%,
            rgba(179, 136, 255, 0.12) 50%,
            rgba(79, 195, 247, 0.08) 75%,
            rgba(179, 136, 255, 0.05) 100%
        );
    background-size: 400% 400%;
    animation: canvas-shimmer 4s ease-in-out infinite;
}

/* Sweeping light bar */
.image-loading-canvas::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(179, 136, 255, 0.08) 40%,
        rgba(224, 195, 252, 0.15) 50%,
        rgba(179, 136, 255, 0.08) 60%,
        transparent 100%
    );
    animation: canvas-sweep 2.5s ease-in-out infinite;
}

@keyframes canvas-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes canvas-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Center icon */
.image-loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 2;
}

.image-loading-icon .icon-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(179, 136, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: icon-breathe 3s ease-in-out infinite;
}

.image-loading-icon .icon-ring::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--lavender-400);
    border-right-color: var(--aqua-300);
    animation: ring-spin 2s linear infinite;
}

.image-loading-icon .icon-emoji {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(179, 136, 255, 0.4));
}

@keyframes icon-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

@keyframes ring-spin {
    to { transform: rotate(360deg); }
}

/* Floating particles */
.image-loading-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    animation: particle-float 4s ease-in-out infinite;
}

.particle:nth-child(1) { left: 15%; bottom: -5%; animation-delay: 0s; animation-duration: 3.5s; background: var(--lavender-400); }
.particle:nth-child(2) { left: 35%; bottom: -5%; animation-delay: 0.7s; animation-duration: 4s; background: var(--aqua-300); }
.particle:nth-child(3) { left: 55%; bottom: -5%; animation-delay: 1.4s; animation-duration: 3.8s; background: var(--lavender-300); }
.particle:nth-child(4) { left: 75%; bottom: -5%; animation-delay: 2.1s; animation-duration: 4.2s; background: var(--aqua-400); }
.particle:nth-child(5) { left: 45%; bottom: -5%; animation-delay: 0.3s; animation-duration: 3.3s; background: var(--gold-300); }
.particle:nth-child(6) { left: 85%; bottom: -5%; animation-delay: 1.8s; animation-duration: 4.5s; background: var(--lavender-400); }
.particle:nth-child(7) { left: 25%; bottom: -5%; animation-delay: 2.5s; animation-duration: 3.6s; background: var(--aqua-200); }

@keyframes particle-float {
    0% { transform: translateY(0) scale(0); opacity: 0; }
    10% { opacity: 1; transform: translateY(0) scale(1); }
    90% { opacity: 0.6; }
    100% { transform: translateY(-400px) scale(0); opacity: 0; }
}

/* Progress bar */
.image-loading-progress {
    width: 100%;
    height: 3px;
    background: rgba(179, 136, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.image-loading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--lavender-400), var(--aqua-300), var(--lavender-400));
    background-size: 200% 100%;
    border-radius: var(--radius-full);
    animation: progress-indeterminate 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(179, 136, 255, 0.4);
}

@keyframes progress-indeterminate {
    0% { width: 0%; margin-left: 0%; background-position: 0% 0%; }
    50% { width: 60%; margin-left: 20%; background-position: 100% 0%; }
    100% { width: 0%; margin-left: 100%; background-position: 0% 0%; }
}

/* Status text */
.image-loading-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--lavender-300);
    font-style: italic;
}

.image-loading-status .status-icon {
    font-size: 0.9rem;
    animation: status-sparkle 2s ease-in-out infinite;
}

@keyframes status-sparkle {
    0%, 100% { opacity: 0.5; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

.image-loading-status .status-msg {
    animation: status-fade 3s ease-in-out infinite;
}

@keyframes status-fade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .app-header {
        padding: 0 16px;
    }

    .header-subtitle {
        display: none;
    }

    .quick-prompts {
        grid-template-columns: 1fr;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .messages-container {
        padding: 16px;
    }

    .input-area {
        padding: 12px 16px 16px;
    }

    .status-text {
        display: none;
    }
}

@media (max-width: 380px) {
    .header-title h1 {
        font-size: 1.1rem;
    }
}

/* ---------- Selection ---------- */
::selection {
    background: rgba(79, 195, 247, 0.3);
    color: var(--text-primary);
}
