:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;

    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --border-color: rgba(255, 255, 255, 0.1);

    --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 40px rgba(102, 126, 234, 0.3);

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    padding: 2rem;
}

/* Header Styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: #667eea;
    filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.5));
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-medium);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning-color);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.status-badge.connected .status-dot {
    background: var(--success-color);
}

.status-badge.error .status-dot {
    background: var(--error-color);
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-interface {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-medium);
}

.chat-interface:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-glow);
}

/* Waveform Visualization */
.waveform-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    margin-bottom: 2rem;
}

.waveform {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.wave-bar {
    width: 6px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: all var(--transition-medium);
}

.waveform.active .wave-bar {
    animation: wave 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 wave {

    0%,
    100% {
        height: 20px;
        opacity: 0.6;
    }

    50% {
        height: 80px;
        opacity: 1;
    }
}

/* Control Panel */
.control-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.talk-button {
    position: relative;
    width: 180px;
    height: 180px;
    border: none;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-md), 0 0 0 0 rgba(102, 126, 234, 0.5);
}

.talk-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(102, 126, 234, 0.6);
}

.talk-button:active:not(:disabled) {
    transform: scale(0.95);
}

.talk-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.talk-button.talking {
    background: var(--secondary-gradient);
    animation: talking-pulse 2s ease-in-out infinite;
}

@keyframes talking-pulse {

    0%,
    100% {
        box-shadow: var(--shadow-md), 0 0 0 0 rgba(245, 87, 108, 0.7);
    }

    50% {
        box-shadow: var(--shadow-lg), 0 0 0 20px rgba(245, 87, 108, 0);
    }
}

.talk-button.processing {
    background: var(--accent-gradient);
}

.mic-icon {
    width: 48px;
    height: 48px;
    color: var(--text-primary);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.button-text {
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Close Button */
.close-button {
    position: relative;
    width: 120px;
    height: 60px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-md);
    margin-top: 1rem;
}

.close-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(239, 68, 68, 0.5);
}

.close-button:active:not(:disabled) {
    transform: scale(0.95);
}

.close-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.close-icon {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

.status-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-message p {
    margin: 0;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-medium);
}

/* Error Message */
.error-message {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn var(--transition-medium);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-icon {
    width: 24px;
    height: 24px;
    color: var(--error-color);
    flex-shrink: 0;
}

.error-text {
    color: var(--error-color);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Footer */
.footer {
    margin-top: 3rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: #764ba2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .chat-interface {
        padding: 2rem 1.5rem;
    }

    .talk-button {
        width: 150px;
        height: 150px;
    }

    .mic-icon {
        width: 40px;
        height: 40px;
    }

    .button-text {
        font-size: 1rem;
    }

    .close-button {
        width: 100px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .talk-button {
        width: 130px;
        height: 130px;
    }

    .waveform-container {
        height: 80px;
    }

    .close-button {
        width: 90px;
        height: 45px;
        font-size: 0.875rem;
    }
}