/* Mai Voice Agent - Modern, Beautiful, Responsive Design */

:root {
    --color-primary: #3b82f6;
    --color-secondary: #1d4ed8;
    --color-accent: #06b6d4;
    --color-background: #f6f8fa;
    --color-surface: #fff;
    --color-surface-light: #f1f5f9;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --shadow-lg: 0 8px 32px 0 rgba(59, 130, 246, 0.10);
    --shadow-glow: 0 0 32px 0 rgba(59, 130, 246, 0.15);
    --radius-lg: 1.5rem;
    --radius-md: 1rem;
    --radius-sm: 0.5rem;
    --radius-full: 9999px;
    --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

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

html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-background);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 60% 10%, #3b82f6 0%, transparent 60%),
                radial-gradient(circle at 10% 80%, #1d4ed8 0%, transparent 70%);
    opacity: 0.07;
    z-index: 0;
    pointer-events: none;
}

.main-wrapper {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 0;
    overflow: hidden;
}

/* Header */
.header-new {
    width: 100%;
    max-width: 420px;
    margin: 0.7rem auto 0.5rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    background: transparent;
    z-index: 2;
}

.avatar-glow {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    margin-bottom: 0.2rem;
    animation: avatarPulse 3s ease-in-out infinite;
}

.mai-avatar-new {
    width: 62px;
    height: 62px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid #fff;
    background: var(--color-surface);
    box-shadow: 0 2px 8px 0 rgba(59,130,246,0.10);
}

@keyframes avatarPulse {
    0%, 100% { box-shadow: 0 0 32px 0 rgba(59,130,246,0.15); }
    50% { box-shadow: 0 0 48px 8px rgba(59,130,246,0.25); }
}

.header-content {
    text-align: center;
    width: 100%;
}

.main-title {
    font-size: 2rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.03em;
    margin-bottom: 0.1rem;
}

.main-subtitle {
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.disclaimer-new {
    background: rgba(59,130,246,0.07);
    border: 1px solid rgba(59,130,246,0.13);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.7rem;
    font-size: 0.95rem;
    color: var(--color-text);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    box-shadow: 0 2px 8px 0 rgba(59,130,246,0.04);
}
.disclaimer-icon {
    font-size: 1.5rem;
    margin-top: 0.1rem;
}

/* Voice Section */
.voice-section {
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    z-index: 2;
}

.voice-card {
    width: 100%;
    max-width: 520px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.1rem 1.2rem 1.1rem 1.2rem;
    margin: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    border-top: 3px solid #3b82f6;
    animation: fadeInUp 0.8s cubic-bezier(.4,0,.2,1);
}

.voice-status-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 1px 4px 0 rgba(59,130,246,0.07);
    border: 1px solid #e0e7ef;
    background: #f1f5fa;
    color: #3b82f6;
    transition: all var(--transition);
}
.status-indicator.connected {
    background: rgba(16,185,129,0.12);
    color: var(--color-success);
    border: 1px solid rgba(16,185,129,0.18);
}
.status-indicator.disconnected {
    background: rgba(239,68,68,0.10);
    color: var(--color-error);
    border: 1px solid rgba(239,68,68,0.18);
}
.status-indicator.connecting {
    background: rgba(245,158,11,0.10);
    color: var(--color-warning);
    border: 1px solid rgba(245,158,11,0.18);
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: currentColor;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.voice-description-new {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 0.7rem;
    text-align: center;
    line-height: 1.5;
}
.highlight {
    color: var(--color-primary);
    font-weight: 700;
}

.voice-controls-row {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
}
.voice-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition);
    min-width: 120px;
    position: relative;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 2px 8px 0 rgba(59,130,246,0.10);
    letter-spacing: 0.01em;
}
.voice-btn.start {
    background: var(--gradient-primary);
}
.voice-btn.stop {
    background: linear-gradient(135deg, var(--color-error), #dc2626);
}
.voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.voice-btn:hover:not(:disabled) {
    filter: brightness(1.08) saturate(1.2);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 16px 0 rgba(59,130,246,0.13);
}

.voice-messages {
    margin-bottom: 0.7rem;
    padding: 0.5rem 0.7rem;
    background: var(--color-surface-light);
    border-radius: var(--radius-md);
    border: 1px solid #e0e7ef;
    min-height: 40px;
    max-height: 80px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.95rem;
    box-shadow: 0 1px 4px 0 rgba(59,130,246,0.04);
}
.voice-message {
    padding: 0.3rem 0.7rem;
    margin: 0.2rem 0;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    line-height: 1.5;
}
.voice-message.user {
    background: rgba(59,130,246,0.10);
    border-left: 3px solid var(--color-primary);
    color: var(--color-text);
}
.voice-message.mai {
    background: rgba(16,185,129,0.10);
    border-left: 3px solid var(--color-success);
    color: var(--color-text);
}

/* Wave Animation */
.wave-animation {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 3px;
    margin: 0.5rem 0 0.2rem 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    height: 32px;
}
.wave-animation.active {
    opacity: 1;
}
.wave-bar {
    width: 4px;
    height: 8px;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: waveBar 1.2s 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; }
.wave-bar:nth-child(6) { animation-delay: 0.3s; }
.wave-bar:nth-child(7) { animation-delay: 0.2s; }
.wave-bar:nth-child(8) { animation-delay: 0.1s; }
@keyframes waveBar {
    0%, 100% {
        height: 8px;
        background: var(--gradient-primary);
    }
    50% {
        height: 28px;
        background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    }
}

/* Footer */
.footer-new {
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.5rem 0 0.7rem 0;
    background: transparent;
    z-index: 2;
    position: absolute;
    bottom: 0;
    left: 0;
}
.footer-content {
    color: var(--color-text-muted);
    font-size: 0.93rem;
    text-align: center;
}
.footer-content a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
    transition: color var(--transition);
}
.footer-content a:hover {
    color: var(--color-secondary);
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(32px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 600px) {
    .main-wrapper {
        padding: 0;
    }
    .header-new {
        max-width: 98vw;
        margin: 0.5rem auto 0.2rem auto;
        gap: 0.5rem;
    }
    .avatar-glow {
        width: 48px;
        height: 48px;
    }
    .mai-avatar-new {
        width: 40px;
        height: 40px;
    }
    .main-title {
        font-size: 1.3rem;
    }
    .voice-card {
        max-width: 98vw;
        padding: 0.5rem 0.2rem 0.5rem 0.2rem;
    }
    .voice-controls-row {
        flex-direction: column;
        gap: 0.4rem;
    }
    .voice-btn {
        width: 100%;
        min-width: 0;
        font-size: 0.95rem;
        padding: 0.5rem 0.2rem;
    }
    .voice-messages {
        font-size: 0.9rem;
        min-height: 30px;
        max-height: 50px;
    }
    .wave-animation {
        height: 14px;
    }
    .wave-bar {
        width: 1.5px;
    }
}

@media (max-width: 400px) {
    .main-title {
        font-size: 1.3rem;
    }
    .main-subtitle {
        font-size: 0.9rem;
    }
    .voice-card {
        padding: 0.7rem 0.1rem 0.7rem 0.1rem;
    }
}

/* Utility */
.hidden { display: none !important; }
.visible { display: block !important; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 700;
    z-index: 10000;
    max-width: 280px;
    box-shadow: 0 4px 16px 0 rgba(59,130,246,0.13);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-size: 1rem;
}
.notification-info { background: var(--color-primary); }
.notification-success { background: var(--color-success); }
.notification-warning { background: var(--color-warning); }
.notification-error { background: var(--color-error); }
