:root {
    --bg-color: #0f0f11;
    --surface-color: #1a1a1f;
    --primary-color: #00ff88;
    --primary-color-dim: rgba(0, 255, 136, 0.2);
    --danger-color: #ff3366;
    --text-main: #ffffff;
    --text-muted: #a0a0a5;
    --border-radius: 20px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--surface-color);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.header-title h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

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

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

/* Language Selector */
.language-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.lang-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lang-box:last-child {
    align-items: flex-end;
}

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

.lang-value {
    font-size: 1rem;
    font-weight: 600;
}

select {
    background: transparent;
    color: var(--text-main);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    text-align: right;
}

select option {
    background: var(--surface-color);
    color: var(--text-main);
}

.swap-icon {
    color: var(--primary-color);
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Transcript Area */
.transcript-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 20px;
}

/* Custom Scrollbar */
.transcript-area::-webkit-scrollbar {
    width: 6px;
}
.transcript-area::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.welcome-message {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: auto 0;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--border-radius);
}

/* Chat Bubbles */
.msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

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

.msg.user {
    align-self: flex-end;
    background: var(--primary-color-dim);
    color: var(--primary-color);
    border-bottom-right-radius: 4px;
}

.msg.ai {
    align-self: flex-start;
    background: var(--surface-color);
    border-bottom-left-radius: 4px;
}

.status-indicator {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
    padding: 5px;
}

/* Footer / Controls */
footer {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: linear-gradient(to top, var(--bg-color) 70%, transparent);
}

/* Audio Visualizer */
.audio-visualizer {
    display: flex;
    gap: 4px;
    height: 30px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.audio-visualizer.active {
    opacity: 1;
}

.bar {
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
    height: 4px;
}

.audio-visualizer.active .bar {
    animation: bounce 0.8s infinite alternate;
}

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

@keyframes bounce {
    0% { height: 4px; }
    100% { height: 25px; }
}

/* Mic Button */
.mic-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #000;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 20px var(--primary-color-dim);
    transition: var(--transition);
}

.mic-btn span {
    font-size: 32px;
}

.mic-btn:hover {
    transform: scale(1.05);
}

.mic-btn.active {
    background: var(--danger-color);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.4);
    color: #fff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(255, 51, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-content h2 {
    color: var(--primary-color);
}

.modal-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 15px;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary-color);
}

.help-text {
    font-size: 0.8rem;
}

.help-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.primary-btn {
    background: var(--primary-color);
    color: #000;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: var(--transition);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--primary-color-dim);
}
