:root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --primary-color: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent-color: #8b5cf6;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success-color: #10b981;
    --error-color: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    position: relative;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-indicator {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-height: 1.5em;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

/* Visualizer */
.visualizer-container {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visualizer-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.5;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.visualizer-container.listening .visualizer-circle {
    animation: pulse-listen 2s infinite;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, transparent 70%);
}

.visualizer-container.speaking .visualizer-circle {
    animation: pulse-speak 1.5s infinite;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.5) 0%, transparent 70%);
}

.icon-container {
    z-index: 2;
    color: var(--text-primary);
}

.icon-container svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

/* Controls */
.mic-button {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 50px;
    padding: 1rem 3rem;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.mic-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.mic-button:active {
    transform: translateY(1px);
}

.mic-button.active {
    background: var(--error-color);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Transcript */
.transcript-container {
    width: 100%;
    height: 200px;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-color) transparent;
}

.message {
    padding: 0.8rem 1.2rem;
    border-radius: 1rem;
    max-width: 80%;
    line-height: 1.5;
    font-size: 0.95rem;
    animation: fade-in 0.3s ease-out;
}

.user-message {
    align-self: flex-end;
    background: var(--surface-color);
    color: var(--text-primary);
    border-bottom-right-radius: 0.2rem;
}

.ai-message {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-bottom-left-radius: 0.2rem;
}

/* Footer */
footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.modal-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-content input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: white;
    margin-bottom: 0.5rem;
    font-family: inherit;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions button {
    flex: 1;
    padding: 0.8rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
}

.modal-actions button:first-child {
    background: var(--primary-color);
    color: white;
}

.modal-actions button.secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Animations */
@keyframes pulse-listen {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.2;
    }

    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

@keyframes pulse-speak {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }

    25% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    50% {
        transform: scale(0.95);
        opacity: 0.6;
    }

    75% {
        transform: scale(1.05);
        opacity: 0.7;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.6;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}