/* VedaAstra AI - Cosmic Vedic Design System */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-cosmic: #070913;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --border-gold: rgba(245, 158, 11, 0.3);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent-gold: #F59E0B;
    --accent-gold-glow: #FBBF24;
    --accent-indigo: #6366F1;
    --accent-purple: #8B5CF6;
    --accent-cyan: #06B6D4;
    --accent-red: #EF4444;
    --text-main: #F9FAFB;
    --text-muted: #9CA3AF;
    --text-gold: #FDE68A;
    --shadow-cosmic: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --shadow-gold: 0 0 20px rgba(245, 158, 11, 0.25);
    --font-primary: 'Outfit', 'Noto Sans Devanagari', sans-serif;
}

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

body {
    background-color: var(--bg-cosmic);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(245, 158, 11, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
    color: var(--text-main);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Stars Animation */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 400 400"><circle cx="50" cy="80" r="1" fill="%23ffffff" opacity="0.6"/><circle cx="180" cy="40" r="1.5" fill="%23fbbf24" opacity="0.8"/><circle cx="320" cy="150" r="1" fill="%23ffffff" opacity="0.5"/><circle cx="90" cy="280" r="1.2" fill="%23a78bfa" opacity="0.7"/><circle cx="270" cy="310" r="1" fill="%23ffffff" opacity="0.6"/><circle cx="350" cy="60" r="1.5" fill="%23f59e0b" opacity="0.9"/></svg>') repeat;
    animation: starPulse 8s infinite alternate ease-in-out;
}

@keyframes starPulse {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0.9; transform: scale(1.02); }
}

/* App Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    background: rgba(11, 15, 25, 0.85);
    border-bottom: 1px solid var(--border-gold);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--shadow-gold);
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(90deg, #FDE68A, #F59E0B, #A78BFA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timer-badge {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--accent-red);
    color: #FCA5A5;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.8); }
}

.lang-btn, .api-key-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-gold);
    color: var(--text-gold);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.lang-btn:hover, .api-key-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    box-shadow: var(--shadow-gold);
}

.badge-tier {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold-glow);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* App Main Layout */
.app-container {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 67px);
}

/* Sidebar Navigation */
sidebar {
    background: rgba(11, 15, 25, 0.6);
    border-right: 1px solid var(--border-glass);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(245, 158, 11, 0.15));
    color: var(--text-gold);
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
    font-weight: 600;
}

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

/* Main Content Area */
main {
    padding: 24px;
    overflow-y: auto;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out forwards;
}

.tab-content.active {
    display: block;
}

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

/* Section Header */
.section-header {
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-gold);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Cards & Glassmorphism */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-cosmic);
}

.glass-card.gold-glow {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
}

/* Form Controls */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-gold);
}

.form-control {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #070913;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

/* Kundli Chart Container */
.chart-layout {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 24px;
}

.chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.chart-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.chart-tab-btn.active {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--accent-gold);
    color: var(--text-gold);
}

/* North Indian Kundli SVG */
.kundli-svg-container {
    width: 100%;
    max-width: 440px;
    aspect-ratio: 1;
    background: rgba(11, 15, 25, 0.8);
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow-gold);
}

.kundli-svg {
    width: 100%;
    height: 100%;
}

.kundli-grid-line {
    stroke: var(--accent-gold);
    stroke-width: 1.5;
    opacity: 0.8;
}

.kundli-house-num {
    fill: var(--accent-gold-glow);
    font-size: 11px;
    font-weight: 700;
}

.kundli-planet-text {
    fill: #F9FAFB;
    font-size: 11px;
    font-weight: 600;
}

/* Planetary Table */
.planetary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.planetary-table th, .planetary-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.88rem;
}

.planetary-table th {
    color: var(--text-gold);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
}

.planetary-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Dasha Timeline */
.dasha-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.25s ease;
}

.dasha-card.current {
    border-color: var(--accent-gold);
    background: rgba(245, 158, 11, 0.08);
    box-shadow: var(--shadow-gold);
}

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

.dasha-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-gold);
}

.dasha-dates {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* AI Chat Interface */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    max-width: 88%;
    border-radius: 16px;
    padding: 16px 20px;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    color: white;
}

.chat-message.ai {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    box-shadow: var(--shadow-gold);
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-gold);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.25s ease;
}

.chip:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--accent-gold);
}

.chat-input-box {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 0.95rem;
    outline: none;
}

/* Classical Sources & Hindu Scriptural Tip Box */
.source-box {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--accent-gold);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-top: 12px;
    font-size: 0.88rem;
}

.shloka-text {
    font-family: 'Noto Sans Devanagari', serif;
    color: var(--text-gold);
    font-style: italic;
    margin-top: 4px;
}

.hindu-tip-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
    padding: 14px 18px;
    margin-top: 14px;
    box-shadow: var(--shadow-gold);
}

.caution-box {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid #EF4444;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin-top: 10px;
    font-size: 0.82rem;
    color: #FCA5A5;
}

/* Paywall & API Key Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-card {
    background: #0B0F19;
    border: 2px solid var(--accent-gold);
    box-shadow: var(--shadow-gold);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    padding: 30px;
    text-align: center;
    position: relative;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-gold);
    margin-bottom: 12px;
}

.rate-badge {
    background: rgba(245, 158, 11, 0.2);
    border: 1px dashed var(--accent-gold);
    color: var(--accent-gold-glow);
    padding: 10px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 16px 0;
}

/* Responsive Mobile Layout */
@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    sidebar {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }
    .chart-layout {
        grid-template-columns: 1fr;
    }
}

/* Nominatim Dynamic City Suggestions Dropdown */
.suggestions-dropdown {
    position: relative;
    background: #0B0F19;
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 50;
    margin-top: 4px;
    display: none;
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-glass);
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: rgba(245, 158, 11, 0.2);
    color: var(--text-gold);
}

/* Mic Speech Recognition Animation */
.mic-listening {
    animation: micPulse 1s infinite alternate;
    background: rgba(239, 68, 68, 0.6) !important;
    border-color: #EF4444 !important;
}

@keyframes micPulse {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
    100% { transform: scale(1.15); box-shadow: 0 0 20px rgba(239, 68, 68, 0.9); }
}

