/* ============================================================
   GitaGuru AI — Premium Chatbot Styles
   ============================================================ */

:root {
    /* Color palette — warm spiritual tones */
    --bg-primary: #0e0d13;
    --bg-secondary: #16141f;
    --bg-tertiary: #1e1b2e;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(227, 155, 55, 0.2);

    /* Saffron / Gold accent */
    --accent: #e39b37;
    --accent-light: #f0c060;
    --accent-dim: rgba(227, 155, 55, 0.15);
    --accent-glow: rgba(227, 155, 55, 0.3);

    /* Text */
    --text-primary: #ede8e0;
    --text-secondary: #9a9298;
    --text-muted: #665e6b;

    /* Bot message accent */
    --bot-bg: rgba(227, 155, 55, 0.06);
    --bot-border: rgba(227, 155, 55, 0.12);

    /* User message */
    --user-bg: rgba(120, 100, 220, 0.12);
    --user-border: rgba(120, 100, 220, 0.2);
    --user-accent: #8b78d0;

    /* Verse card */
    --verse-bg: rgba(227, 155, 55, 0.05);
    --verse-border: rgba(227, 155, 55, 0.15);

    /* Misc */
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    font-size: 16px;
}

body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

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

.particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
    animation: float var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: 0.5;
    filter: blur(60px);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ---- App Layout ---- */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 860px;
    margin: 0 auto;
}

/* ---- Header ---- */
.app-header {
    flex-shrink: 0;
    padding: 16px 24px;
    background: rgba(14, 13, 19, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.app-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
    animation: pulse-dot 2s ease-in-out infinite;
}

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

.status-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Chat Container ---- */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Welcome Card ---- */
.welcome-card {
    text-align: center;
    max-width: 560px;
    margin: 40px auto;
    padding: 40px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    animation: fadeUp 0.6s ease-out;
}

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

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.welcome-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.welcome-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.chip {
    padding: 8px 16px;
    font-size: 0.82rem;
    font-family: 'Inter', sans-serif;
    color: var(--accent-light);
    background: var(--accent-dim);
    border: 1px solid var(--accent-glow);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.chip:hover {
    background: rgba(227, 155, 55, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 155, 55, 0.15);
}

/* ---- Chat Messages ---- */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeUp 0.35s ease-out;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.message.bot .message-avatar {
    background: var(--accent-dim);
    border: 1px solid var(--accent-glow);
}

.message.user .message-avatar {
    background: var(--user-bg);
    border: 1px solid var(--user-border);
}

.message-body {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    line-height: 1.65;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: var(--bot-bg);
    border: 1px solid var(--bot-border);
    border-top-left-radius: 4px;
}

.message.user .message-bubble {
    background: var(--user-bg);
    border: 1px solid var(--user-border);
    border-top-right-radius: 4px;
    color: var(--text-primary);
}

/* ---- Verse Citation Cards ---- */
.verse-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.verse-card {
    padding: 12px 16px;
    background: var(--verse-bg);
    border: 1px solid var(--verse-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.verse-card:hover {
    background: rgba(227, 155, 55, 0.1);
    border-color: var(--accent-glow);
}

.verse-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.verse-ref {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.verse-toggle {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.verse-card.expanded .verse-toggle {
    transform: rotate(180deg);
}

.verse-translation {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-top: 4px;
}

.verse-sanskrit {
    font-family: 'Noto Serif Devanagari', serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    display: none;
}

.verse-card.expanded .verse-sanskrit {
    display: block;
}

/* ---- Loading Indicator ---- */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: var(--bot-bg);
    border: 1px solid var(--bot-border);
    border-radius: var(--radius);
    border-top-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.4;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ---- Input Area ---- */
.input-area {
    flex-shrink: 0;
    padding: 16px 24px 20px;
    background: rgba(14, 13, 19, 0.85);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 6px 6px 18px;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--accent-glow);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

#question-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    padding: 8px 0;
}

#question-input::placeholder {
    color: var(--text-muted);
}

#send-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #c57f20);
    color: #0e0d13;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

#send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(227, 155, 55, 0.35);
}

#send-btn:active {
    transform: scale(0.95);
}

#send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-hint {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .app-container {
        max-width: 100%;
    }

    .chat-container {
        padding: 16px;
    }

    .welcome-card {
        padding: 28px 20px;
        margin: 20px auto;
    }

    .welcome-card h2 {
        font-size: 1.25rem;
    }

    .suggestion-chips {
        flex-direction: column;
        align-items: stretch;
    }

    .chip {
        white-space: normal;
        text-align: left;
    }

    .message-body {
        max-width: 85%;
    }

    .input-area {
        padding: 12px 16px 16px;
    }
}
