/* ==============================================================================
   Ovozli AI Agent — Zamonaviy Premium Dark Glassmorphism CSS
   ============================================================================== */

:root {
    --bg-color: #090d16;
    --card-bg: rgba(17, 24, 39, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.4);
    --accent-cyan: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-amber: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Fon nurlari (Ambient Glows) */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}
.glow-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-emerald), transparent 70%);
    top: -100px;
    left: -100px;
}
.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
    bottom: -100px;
    right: -100px;
}

/* Asosiy konteyner */
.app-container {
    width: 100%;
    max-width: 840px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    position: relative;
    z-index: 1;
}

/* HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 20px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand-icon {
    font-size: 28px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}
.brand-text h1 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.badge-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--accent-emerald);
    font-weight: 600;
}
.badge-online .dot {
    width: 6px;
    height: 6px;
    background: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.header-links {
    display: flex;
    gap: 10px;
}
.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ASOSIY CHAT MAYDONI */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Xabarlar dizayni */
.msg-bubble {
    padding: 16px 20px;
    border-radius: 18px;
    line-height: 1.5;
    max-width: 85%;
    font-size: 14.5px;
    position: relative;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Card */
.system-welcome {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    max-width: 100%;
    text-align: center;
    backdrop-filter: blur(12px);
}
.welcome-icon {
    font-size: 32px;
    margin-bottom: 8px;
}
.system-welcome h3 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 700;
}
.system-welcome p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.prompt-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.prompt-chip:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
    transform: translateY(-1px);
}

/* Foydalanuvchi va Agent xabarlari */
.msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #059669, #0d9488);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.2);
}
.msg-agent {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--card-border);
    color: #f1f5f9;
    border-bottom-left-radius: 4px;
    backdrop-filter: blur(10px);
}
.tool-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* OVOZ VA RECORDING QISMI */
.voice-interaction-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 16px;
}
.status-indicator {
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 500;
    min-height: 20px;
    transition: var(--transition);
}

/* MIKROFON TUGMASI */
.mic-button-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mic-button {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.35);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    z-index: 2;
}
.mic-button:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 35px rgba(16, 185, 129, 0.45);
}
.mic-button:active {
    transform: scale(0.96);
}
.mic-button svg {
    width: 36px;
    height: 36px;
}

/* Recording paytida aylanuvchi va kengayuvchi halqa */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-emerald);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}
.mic-button.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 35px rgba(239, 68, 68, 0.5);
    animation: recordingBounce 1s infinite alternate;
}
.mic-button.recording + .pulse-ring {
    animation: pulseRing 1.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
@keyframes pulseRing {
    0% { transform: scale(1); opacity: 0.8; border-color: #ef4444; }
    100% { transform: scale(1.8); opacity: 0; border-color: #ef4444; }
}
@keyframes recordingBounce {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

/* Sound Wave bars */
.wave-container {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
}
.wave-bar {
    width: 4px;
    height: 6px;
    background: var(--accent-emerald);
    border-radius: 2px;
    animation: waveBounce 1.2s ease-in-out infinite;
}
.wave-bar:nth-child(2) { animation-delay: 0.15s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; }
.wave-bar:nth-child(4) { animation-delay: 0.45s; }
.wave-bar:nth-child(5) { animation-delay: 0.3s; }
.wave-bar:nth-child(6) { animation-delay: 0.15s; }
@keyframes waveBounce {
    0%, 100% { height: 6px; }
    50% { height: 22px; }
}

/* MATN YOZISH QATORI */
.text-input-form {
    display: flex;
    width: 100%;
    max-width: 540px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    padding: 6px 8px 6px 18px;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}
.text-input-form:focus-within {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}
.text-input-form input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.text-input-form input::placeholder {
    color: var(--text-muted);
}
.btn-send {
    background: var(--accent-emerald);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.btn-send:hover {
    background: #059669;
    transform: scale(1.05);
}
.btn-send svg {
    width: 18px;
    height: 18px;
}
