/* ============================================
   🌟 OREN AI Chat - Premium Design System
   Created by Maor Shpiezer
   ============================================ */

/* CSS Variables */
:root {
    /* Purple Theme Colors */
    --primary-dark: #0d0015;
    --primary: #1a0a2e;
    --primary-light: #2d1b4e;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-glow: #c4b5fd;
    --accent-dark: #6d28d9;
    --secondary: #7c3aed;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --glass-bg: rgba(26, 10, 46, 0.6);
    --glass-border: rgba(139, 92, 246, 0.2);
    --glass-hover: rgba(139, 92, 246, 0.1);
    --shadow-color: rgba(139, 92, 246, 0.3);
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Accessibility - Skip Link */
.skip-link {
    position: absolute;
    top: -100px;
    right: 0;
    background: var(--accent);
    color: white;
    padding: var(--space-md) var(--space-lg);
    z-index: 10000;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: var(--space-md);
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
}

/* Screen reader only - visually hidden but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .oren-particle,
    .mini-particle,
    .particle,
    .shape {
        animation: none !important;
    }

    .background-slideshow .slide {
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.9);
        --glass-border: rgba(255, 255, 255, 0.5);
        --text-primary: #ffffff;
        --text-secondary: #e0e0e0;
    }

    .message-content {
        border-width: 2px;
    }

    .btn-icon {
        border-width: 2px;
    }
}

/* OREN Orbital Logo */
.oren-logo-container {
    width: 180px;
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.oren-orbit-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid #7c3aed;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.3);
}

.oren-particle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 15px #00ff88, 0 0 30px #00ff88;
    top: 50%;
    left: 50%;
    margin: -7px;
    animation: oren-orbit 8s linear infinite;
}

.oren-particle:nth-child(1) {
    animation-delay: 0s;
}

.oren-particle:nth-child(2) {
    animation-delay: -2.66s;
}

.oren-particle:nth-child(3) {
    animation-delay: -5.33s;
}

@keyframes oren-orbit {
    from {
        transform: rotate(0deg) translateX(87px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(87px) rotate(-360deg);
    }
}

.oren-center {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 1;
}

/* Mini OREN Logo for message avatars */
.mini-oren-logo {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-orbit-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #7c3aed;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

.mini-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff88, 0 0 15px #00ff88;
    top: 50%;
    left: 50%;
    margin: -3px;
    animation: mini-orbit 6s linear infinite;
}

.mini-particle:nth-child(1) {
    animation-delay: 0s;
}

.mini-particle:nth-child(2) {
    animation-delay: -2s;
}

.mini-particle:nth-child(3) {
    animation-delay: -4s;
}

@keyframes mini-orbit {
    from {
        transform: rotate(0deg) translateX(18px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(18px) rotate(-360deg);
    }
}

.mini-center {
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 900;
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    z-index: 1;
}

/* Header Logo Text */
.header-logo-text {
    font-family: 'Heebo', sans-serif;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(90deg, #5EDFFF 0%, #8B7DFF 50%, #B86FFF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--primary-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Animated Background
   ============================================ */
.background-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.gradient-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(109, 40, 217, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(124, 58, 237, 0.2) 0%, transparent 60%),
        linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    50% { filter: hue-rotate(20deg) brightness(1.1); }
}

/* Particles */
.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-light);
    border-radius: 50%;
    animation: float 20s infinite;
    opacity: 0.6;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* Floating Shapes */
.floating-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: morphFloat 20s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    top: 10%;
    left: -5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #c4b5fd, #8b5cf6);
    top: 60%;
    right: -5%;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    bottom: 10%;
    left: 30%;
    animation-delay: -10s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    top: 30%;
    right: 20%;
    animation-delay: -3s;
}

.shape-5 {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #6d28d9, #4c1d95);
    top: 70%;
    left: 10%;
    animation-delay: -7s;
}

.shape-6 {
    width: 220px;
    height: 220px;
    background: linear-gradient(135deg, #8b5cf6, #c4b5fd);
    top: 5%;
    right: 30%;
    animation-delay: -12s;
}

@keyframes morphFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        border-radius: 50%;
    }
    25% {
        transform: translate(30px, -30px) scale(1.1) rotate(90deg);
        border-radius: 40% 60% 60% 40%;
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9) rotate(180deg);
        border-radius: 60% 40% 40% 60%;
    }
    75% {
        transform: translate(20px, 30px) scale(1.05) rotate(270deg);
        border-radius: 40% 60% 50% 50%;
    }
}

/* Full Width Background Slideshow */
.background-slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}

/* Show slideshow when landscape theme is active */
body.theme-landscape .background-slideshow {
    opacity: 1;
    visibility: visible;
}

/* Hide gradient effects when landscape is active */
body.theme-landscape .gradient-bg {
    opacity: 0.3;
}

body.theme-landscape .floating-shapes {
    opacity: 0.2;
}

body.theme-landscape .aurora {
    opacity: 0.3;
}

.slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.slide.active {
    opacity: 0.5;
}

/* Theme button active state */
.btn-icon.theme-active {
    background: var(--gradient-purple);
    border-color: var(--accent);
    color: white;
}

.slide-1 {
    background-image: url('https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1920&q=80');
    background-position: center 30%;
}

.slide-2 {
    background-image: url('https://images.unsplash.com/photo-1493246507139-91e8fad9978e?w=1920&q=80');
    background-position: center 40%;
}

.slide-3 {
    background-image: url('https://images.unsplash.com/photo-1518173946687-a4c036bc0a94?w=1920&q=80');
    background-position: center 50%;
}

.slide-4 {
    background-image: url('https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=1920&q=80');
    background-position: center 40%;
}

.slide-5 {
    background-image: url('https://images.unsplash.com/photo-1507400492013-162706c8c05e?w=1920&q=80');
    background-position: center 50%;
}

.slide-6 {
    background-image: url('https://images.unsplash.com/photo-1434725039720-aaad6dd32dfe?w=1920&q=80');
    background-position: center 40%;
}

/* Overlay gradient on slideshow */
.slideshow-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(13, 0, 21, 0.4) 0%,
        rgba(26, 10, 46, 0.2) 50%,
        rgba(13, 0, 21, 0.5) 100%
    );
    z-index: 1;
}

/* Aurora Effect */
.aurora {
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 60%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(139, 92, 246, 0.1) 20%,
        rgba(124, 58, 237, 0.15) 40%,
        rgba(109, 40, 217, 0.1) 60%,
        transparent 100%
    );
    filter: blur(80px);
    animation: aurora 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes aurora {
    0%, 100% { transform: translateX(-10%) rotate(-5deg); }
    50% { transform: translateX(10%) rotate(5deg); }
}

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

/* ============================================
   Header
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--space-md) var(--space-xl);
    background: rgba(13, 0, 21, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.header-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* OREN AI SVG Logo */
.orenai-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.orenai-svg {
    overflow: visible;
}

.twinkle {
    transform-origin: center;
    filter: drop-shadow(0 0 8px rgba(140, 120, 255, .55));
    animation: twinkle 2.2s ease-in-out infinite;
}

.twinkle.t2 {
    animation-duration: 2.8s;
    animation-delay: .35s;
}

.twinkle.t3 {
    animation-duration: 3.4s;
    animation-delay: .8s;
}

/* Ring shimmer rotation animation */
.ring-shimmer {
    transform-origin: 210px 210px;
    animation: shimmerRotate 3s linear infinite;
}

@keyframes shimmerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Ring glow pulse */
.ring-glow {
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@keyframes twinkle {
    0%, 100% {
        opacity: .25;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.logo-text {
    position: relative;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.title-section {
    display: flex;
    flex-direction: column;
}

.main-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-icon:hover {
    background: var(--glass-hover);
    color: var(--accent-light);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-color);
}

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

/* ============================================
   Chat Container
   ============================================ */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-md);
    padding-bottom: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: var(--radius-full);
}

/* ============================================
   Welcome Section
   ============================================ */
.welcome-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    animation: fadeInUp 0.8s ease;
}

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

.welcome-avatar {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: var(--space-xl);
}

.avatar-ring {
    display: none;
}

.avatar-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float-gentle 4s ease-in-out infinite;
}

.avatar-inner .orenai-svg {
    width: 180px;
    height: 180px;
}

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

.welcome-title {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.greeting-text {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.name-text {
    font-size: 2rem;
    font-weight: 700;
}

.highlight {
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: var(--space-2xl);
}

.suggestion-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    max-width: 500px;
    width: 100%;
}

.suggestion-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: right;
    font-family: inherit;
    font-size: 0.95rem;
}

.suggestion-card:hover {
    background: var(--glass-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--shadow-color);
}

.card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* ============================================
   Chat Messages
   ============================================ */
.message {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    animation: messageIn 0.4s ease;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.message.assistant .message-avatar {
    background: var(--gradient-purple);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.message.user .message-avatar {
    background: var(--primary-light);
    border: 1px solid var(--glass-border);
}

.message-content {
    max-width: 100%;
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    line-height: 1.7;
}

.message.assistant .message-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-top-right-radius: var(--radius-sm);
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.8) 0%, rgba(30, 10, 60, 0.9) 50%, rgba(0, 0, 0, 0.8) 100%);
    border-top-left-radius: var(--radius-sm);
    animation: userMessageFade 0.5s ease;
}

@keyframes userMessageFade {
    from {
        opacity: 0;
        background: linear-gradient(135deg, rgba(124, 58, 237, 0.3) 0%, rgba(30, 10, 60, 0.4) 50%, rgba(0, 0, 0, 0.3) 100%);
    }
    to {
        opacity: 1;
        background: linear-gradient(135deg, rgba(124, 58, 237, 0.8) 0%, rgba(30, 10, 60, 0.9) 50%, rgba(0, 0, 0, 0.8) 100%);
    }
}

.message-content p {
    margin-bottom: var(--space-sm);
}

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

.message-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.4);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: var(--space-sm) 0;
}

.message-content pre code {
    background: none;
    padding: 0;
}

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

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* ============================================
   Input Container
   ============================================ */
.input-container {
    position: sticky;
    bottom: 0;
    padding: var(--space-md);
    padding-top: var(--space-lg);
    background: linear-gradient(transparent, var(--primary-dark) 30%);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 4px 8px 4px 4px;
    transition: all var(--transition-normal);
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--shadow-color);
}

.input-glow {
    position: absolute;
    inset: -2px;
    background: var(--gradient-purple);
    border-radius: var(--radius-xl);
    filter: blur(20px);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    z-index: -1;
}

.input-wrapper:focus-within .input-glow {
    opacity: 0.3;
}

#userInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 18px;
    padding: 12px 16px;
    resize: none;
    min-height: 24px;
    max-height: 200px;
    line-height: 1.5;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#userInput::-webkit-scrollbar {
    display: none;
}

#userInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-purple);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    overflow: hidden;
}

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

.send-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px var(--shadow-color);
}

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

.send-btn svg {
    width: 22px;
    height: 22px;
    transition: transform var(--transition-fast);
}

.send-btn:not(:disabled):hover svg {
    transform: translateX(-2px) translateY(-2px);
}

.send-ripple {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s ease;
}

.send-btn:not(:disabled):active .send-ripple {
    opacity: 1;
    transform: scale(2);
}

.input-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hint-icon {
    animation: flash 2s ease-in-out infinite;
}

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

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(13, 0, 21, 0.9);
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-radius: 50%;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--accent);
    animation: spinnerRotate 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    inset: 10px;
    border-right-color: var(--accent-light);
    animation: spinnerRotate 2s linear infinite reverse;
}

.spinner-ring:nth-child(3) {
    inset: 20px;
    border-bottom-color: var(--accent-glow);
    animation: spinnerRotate 2.5s linear infinite;
}

@keyframes spinnerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   Mobile Responsive Design
   ============================================ */
@media (max-width: 768px) {
    :root {
        --space-md: 12px;
        --space-lg: 18px;
        --space-xl: 24px;
    }

    .header {
        padding: var(--space-sm) var(--space-md);
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .main-title {
        font-size: 1.25rem;
    }

    .subtitle {
        font-size: 0.7rem;
    }

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

    .welcome-avatar {
        width: 100px;
        height: 100px;
    }

    .avatar-inner {
        font-size: 2.5rem;
    }

    .welcome-avatar {
        width: 120px;
        height: 120px;
        margin-bottom: var(--space-md);
    }

    .avatar-inner .orenai-svg {
        width: 120px;
        height: 120px;
    }

    .greeting-text {
        font-size: 1.65rem;
    }

    .name-text {
        font-size: 1.93rem;
    }

    .welcome-subtitle {
        font-size: 1.27rem;
    }

    .suggestion-cards {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
        padding: 0 var(--space-sm);
    }

    .suggestion-card {
        padding: var(--space-sm) var(--space-md);
    }

    .message {
        gap: var(--space-sm);
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .message-content {
        max-width: 85%;
        padding: var(--space-sm) var(--space-md);
        font-size: 1.05rem;
    }

    .input-wrapper {
        padding: 4px 8px 4px 4px;
    }

    #userInput {
        font-size: 16px;
        padding: 10px 14px;
    }

    .send-btn {
        width: 44px;
        height: 44px;
    }

    /* Adjust floating shapes for mobile */
    .shape {
        filter: blur(80px);
        opacity: 0.3;
    }

    .shape-1 { width: 200px; height: 200px; }
    .shape-2 { width: 150px; height: 150px; }
    .shape-3 { width: 180px; height: 180px; }
    .shape-4 { width: 100px; height: 100px; }
    .shape-5, .shape-6 { display: none; }

    /* Smaller world images on mobile */
    .world-image {
        width: 250px;
        height: 150px;
        opacity: 0.1;
    }

    /* Background slideshow adjustments for mobile */
    .slide {
        background-position: center center;
        background-size: cover;
    }

    .slide.active {
        opacity: 0.4;
    }

    .slideshow-overlay {
        background: linear-gradient(
            180deg,
            rgba(13, 0, 21, 0.5) 0%,
            rgba(26, 10, 46, 0.3) 50%,
            rgba(13, 0, 21, 0.6) 100%
        );
    }
}

@media (max-width: 480px) {
    .header-content {
        gap: var(--space-sm);
    }

    .title-section {
        display: none;
    }

    .welcome-section {
        min-height: 50vh;
        padding-top: var(--space-xl);
    }

    .welcome-avatar {
        width: 100px;
        height: 100px;
        margin-bottom: var(--space-md);
    }

    .avatar-inner .orenai-svg {
        width: 100px;
        height: 100px;
    }

    .avatar-inner {
        font-size: 2rem;
    }

    .greeting-text {
        font-size: 1.54rem;
    }

    .name-text {
        font-size: 1.76rem;
    }

    .welcome-subtitle {
        font-size: 1.21rem;
        margin-bottom: var(--space-xl);
    }

    .suggestion-card {
        font-size: 1rem;
    }

    .card-icon {
        font-size: 1.25rem;
    }

    .message-content {
        max-width: 90%;
        font-size: 1.05rem;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .header {
        padding-top: max(var(--space-md), env(safe-area-inset-top));
    }

    .input-container {
        padding-bottom: max(var(--space-md), env(safe-area-inset-bottom));
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(26, 10, 46, 0.9);
        --glass-border: rgba(139, 92, 246, 0.5);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .background-container,
    .header-actions,
    .input-container,
    .loading-overlay {
        display: none !important;
    }

    .app-container {
        background: white;
    }

    .message-content {
        background: #f0f0f0 !important;
        color: black !important;
    }
}
