/* ── Harikatha Live — Devotional Aesthetic ── */

:root {
    --saffron: #e8a839;
    --saffron-deep: #c4841d;
    --turmeric: #f5c846;
    --tulsi: #4a7c59;
    --tulsi-dark: #2d5a3a;
    --yamuna: #1a2744;
    --yamuna-light: #253a5e;
    --vraja-dust: #f9f0e2;
    --vraja-cream: #fdf7ee;
    --ink: #1c1410;
    --ink-light: #4a3f35;
    --mist: rgba(255,255,255,0.06);

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;

    --radius: 12px;
    --radius-lg: 20px;
}

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

html, body {
    height: 100%;
    font-family: var(--font-body);
    background: var(--yamuna);
    color: var(--vraja-cream);
    overflow-x: hidden;
}

/* ── Background ── */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.lotus-glow {
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(
        ellipse at center,
        rgba(232, 168, 57, 0.08) 0%,
        rgba(232, 168, 57, 0.03) 40%,
        transparent 70%
    );
    border-radius: 50%;
    animation: glow-breathe 8s ease-in-out infinite;
}

@keyframes glow-breathe {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* ── Container ── */
.container {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.header {
    text-align: center;
    padding: 20px 0 12px;
}

.header-mark {
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--saffron);
    opacity: 0.7;
    margin-bottom: 4px;
}

.header-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 300;
    color: var(--vraja-cream);
    letter-spacing: 0.06em;
}

.header-sub {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 300;
    font-style: italic;
    color: var(--saffron);
    opacity: 0.7;
    margin-top: 4px;
}

/* ── Status bar ── */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.04em;
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transition: background 0.3s;
}

.status-dot.connected { background: #5cb85c; box-shadow: 0 0 6px #5cb85c; }
.status-dot.connecting { background: var(--turmeric); animation: pulse-dot 1s infinite; }
.status-dot.error { background: #d9534f; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Conversation ── */
.conversation {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 50vh;
}

.welcome-message {
    text-align: center;
    padding: 32px 16px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.55);
    font-style: italic;
}

.msg {
    padding: 12px 16px;
    border-radius: var(--radius);
    max-width: 90%;
    line-height: 1.6;
    font-size: 0.9rem;
    animation: msg-in 0.3s ease-out;
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg.user {
    align-self: flex-end;
    background: var(--yamuna-light);
    border: 1px solid rgba(232,168,57,0.15);
    color: var(--vraja-cream);
}

.msg.agent {
    align-self: flex-start;
    background: rgba(232,168,57,0.08);
    border: 1px solid rgba(232,168,57,0.12);
    color: var(--vraja-cream);
}

.msg.system {
    align-self: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    font-style: italic;
    padding: 6px 12px;
}

.msg.harikatha-found {
    align-self: center;
    background: rgba(74,124,89,0.15);
    border: 1px solid rgba(74,124,89,0.3);
    text-align: center;
    font-family: var(--font-display);
    color: var(--turmeric);
    font-size: 0.95rem;
}

/* ── Harikatha Player ── */
.harikatha-player {
    background: rgba(74,124,89,0.1);
    border: 1px solid rgba(74,124,89,0.25);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin: 8px 0;
    animation: msg-in 0.4s ease-out;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.player-icon { font-size: 1.2rem; }

.player-label {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--saffron);
    letter-spacing: 0.04em;
    font-weight: 600;
}

.player-title {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 10px;
    font-style: italic;
}

.harikatha-player audio {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    outline: none;
}

.player-question {
    background: rgba(232,168,57,0.08);
    border: 1px solid rgba(232,168,57,0.15);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--saffron);
    font-style: italic;
}

.player-question::before {
    content: "Q: ";
    font-weight: 600;
    font-style: normal;
}

.player-answer {
    background: rgba(45,90,60,0.15);
    border: 1px solid rgba(74,124,89,0.25);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--vraja-cream);
}

.player-answer::before {
    content: "A: ";
    font-weight: 600;
    color: var(--tulsi);
}

.player-media-buttons {
    display: flex;
    gap: 10px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.media-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: var(--vraja-cream);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.media-btn:hover {
    background: rgba(232,168,57,0.12);
    border-color: var(--saffron);
    color: var(--saffron);
}

.media-btn-video { border-color: rgba(66,133,244,0.3); }
.media-btn-video:hover { border-color: #4285F4; color: #82b1ff; }

.media-btn-audio { border-color: rgba(74,124,89,0.3); }
.media-btn-audio:hover { border-color: var(--tulsi); color: #7fd89e; }

/* ── Controls ── */
.controls {
    padding: 12px 0;
}

.text-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#textInput {
    flex: 1;
    background: var(--yamuna-light);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--vraja-cream);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

#textInput:focus {
    border-color: var(--saffron);
}

#textInput::placeholder {
    color: rgba(255,255,255,0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.btn-send {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    background: var(--saffron-deep);
    color: white;
}

.btn-send:hover { background: var(--saffron); }

.mic-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.btn-connect {
    padding: 10px 24px;
    border-radius: var(--radius);
    background: var(--tulsi);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.btn-connect:hover { background: var(--tulsi-dark); }
.btn-connect.connected { background: #d9534f; }
.btn-connect.connected:hover { background: #c9302c; }

.btn-mic {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--yamuna-light);
    border: 2px solid rgba(232,168,57,0.2);
    color: rgba(255,255,255,0.5);
    transition: all 0.2s;
}

.btn-mic:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-mic:not(:disabled):hover {
    border-color: var(--saffron);
    color: var(--saffron);
}

.btn-mic.recording {
    background: rgba(232,168,57,0.15);
    border-color: var(--saffron);
    color: var(--saffron);
    animation: mic-pulse 1.5s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232,168,57,0.3); }
    50% { box-shadow: 0 0 0 12px rgba(232,168,57,0); }
}

/* ── Visualiser ── */
#visualiser {
    display: block;
    margin: 4px auto;
    opacity: 0.5;
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 16px 0 8px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.25);
    line-height: 1.7;
}

.footer-attr {
    color: rgba(255,255,255,0.15);
}

/* ── Scrollbar ── */
.conversation::-webkit-scrollbar { width: 4px; }
.conversation::-webkit-scrollbar-track { background: transparent; }
.conversation::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .container { padding: 16px 12px; }
    .header-title { font-size: 1.6rem; }
    .btn-mic { width: 56px; height: 56px; }
}
