/* Reset and base styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #a855f7;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
}

html, body {
    height: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

/* App container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Background orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    top: -300px;
    left: -200px;
    animation: float1 20s ease-in-out infinite;
}

.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    bottom: -200px;
    right: -150px;
    animation: float2 25s ease-in-out infinite;
}

.bg-orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-tertiary) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    animation: float3 30s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(50px, 30px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-40px, -20px); }
}

@keyframes float3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo svg {
    color: var(--accent-primary);
}

.language-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.lang-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success-glow);
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
    gap: 2rem;
}

/* Status text */
.status-container {
    text-align: center;
    margin-bottom: 1rem;
}

.status-text {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Voice button */
.voice-button-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-button-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.voice-button-glow.active {
    opacity: 1;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

.voice-button {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 40px rgba(99, 102, 241, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.voice-button:hover {
    transform: scale(1.05);
    box-shadow: 
        0 15px 50px rgba(99, 102, 241, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.voice-button:active {
    transform: scale(0.98);
}

.voice-button.listening {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    box-shadow: 
        0 10px 40px rgba(239, 68, 68, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.voice-button.processing {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-tertiary) 100%);
}

.voice-button-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Pulse rings */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    pointer-events: none;
}

.voice-button.listening .pulse-ring {
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring-1 { animation-delay: 0s; }
.pulse-ring-2 { animation-delay: 0.5s; }
.pulse-ring-3 { animation-delay: 1s; }

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Voice icon */
.voice-icon {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Wave animation */
.wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 48px;
}

.wave-bar {
    width: 6px;
    height: 20px;
    background: white;
    border-radius: 3px;
    animation: waveBar 1s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes waveBar {
    0%, 100% { height: 20px; }
    50% { height: 40px; }
}

/* Transcript container */
.transcript-container {
    width: 100%;
    max-width: 500px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.transcript-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.transcript-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    backdrop-filter: blur(20px);
}

.transcript-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.transcript-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Response container */
.response-container {
    width: 100%;
    max-width: 500px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.response-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.response-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex;
    gap: 1rem;
    backdrop-filter: blur(20px);
}

.response-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.response-avatar svg {
    color: white;
}

.response-text {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    flex: 1;
}

/* Recommendation container */
.recommendation-container {
    width: 100%;
    max-width: 500px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.recommendation-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.recommendation-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(20px);
}

.recommendation-icon {
    width: 64px;
    height: 64px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 30px var(--success-glow);
}

.recommendation-icon svg {
    color: white;
}

.recommendation-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.recommendation-specialist {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 1.5rem;
}

.new-conversation-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-conversation-btn:hover {
    background: var(--glass-bg);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* Footer */
.footer {
    padding: 1.5rem 2rem;
    position: relative;
    z-index: 10;
}

.disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.disclaimer svg {
    opacity: 0.5;
}

/* Loading state */
.voice-button.loading .voice-icon {
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 640px) {
    .header {
        padding: 1rem 1.5rem;
    }
    
    .status-text {
        font-size: 1.5rem;
    }
    
    .voice-button {
        width: 140px;
        height: 140px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .transcript-box,
    .response-box,
    .recommendation-card {
        padding: 1rem;
    }
}

/* Smooth scrolling for transcript area */
.transcript-text,
.response-text {
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

.transcript-text::-webkit-scrollbar,
.response-text::-webkit-scrollbar {
    width: 4px;
}

.transcript-text::-webkit-scrollbar-thumb,
.response-text::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 2px;
}

