/**
 * AstroIyer - Spiritual Modern Astrology Theme
 * A mystical, animated, and modern design with spiritual elements
 * This file should be loaded AFTER Tailwind CSS
 */

/* ============================================
   CSS Variables & Root Styles - Devotional Temple Theme
   ============================================ */
:root {
    /* Devotional Temple Color Palette */
    --color-primary: #ea580c;        /* Sacred Saffron/Orange */
    --color-primary-dark: #c2410c;   /* Deep Saffron */
    --color-primary-light: #fb923c;  /* Light Saffron */
    --color-accent: #fbbf24;          /* Divine Gold */
    --color-accent-light: #fcd34d;    /* Bright Gold */
    --color-secondary: #dc2626;      /* Sacred Red */
    --color-tertiary: #b91c1c;        /* Deep Red/Maroon */
    --color-sacred: #fef3c7;          /* Sacred Cream */
    
    /* Background Colors - Bright & Devotional */
    --color-bg-primary: #fff7ed;     /* Warm Cream Background */
    --color-bg-secondary: #ffedd5;   /* Light Orange Cream */
    --color-bg-tertiary: #fed7aa;    /* Soft Saffron */
    --color-bg-accent: #fef3c7;      /* Golden Cream */
    
    /* Text Colors */
    --color-text-primary: #1c1917;   /* Dark Brown/Black */
    --color-text-secondary: rgba(28, 25, 23, 0.85);
    --color-text-muted: rgba(28, 25, 23, 0.65);
    
    /* Legacy colors for compatibility - Devotional Theme */
    --color-cosmic-purple: #ea580c;
    --color-deep-purple: #c2410c;
    --color-mystical-blue: #1e1b4b;
    --color-gold: #fbbf24;
    --color-saffron: #ea580c;
    --color-orange-glow: #fb923c;
    --color-dark-bg: #fff7ed;
    --color-starry-bg: #ffedd5;
    
    /* Fonts */
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Inter', sans-serif;
    --font-serif: 'Crimson Text', serif;
    
    /* Enhanced Shadows & Glows - Devotional Theme */
    --shadow-sm: 0 2px 8px rgba(234, 88, 12, 0.15);
    --shadow-md: 0 4px 16px rgba(234, 88, 12, 0.2);
    --shadow-lg: 0 8px 32px rgba(234, 88, 12, 0.25);
    --shadow-xl: 0 16px 48px rgba(234, 88, 12, 0.3);
    --glow-primary: 0 0 30px rgba(234, 88, 12, 0.4);
    --glow-accent: 0 0 30px rgba(251, 191, 36, 0.5);
    --glow-combined: 0 0 40px rgba(234, 88, 12, 0.3), 0 0 20px rgba(251, 191, 36, 0.4);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing */
    --spacing-section: 80px;
    --spacing-element: 24px;
}

* {
    box-sizing: border-box;
}

/* Override Tailwind body styles - Devotional Theme */
body {
    font-family: var(--font-body) !important;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 25%, #fed7aa 50%, #fef3c7 75%, #fff7ed 100%) !important;
    background-size: 400% 400% !important;
    animation: gradientShift 20s ease infinite !important;
    min-height: 100vh !important;
    position: relative !important;
    overflow-x: hidden !important;
    color: var(--color-text-primary) !important;
    font-weight: 400;
    line-height: 1.6;
}

/* Animated Gradient Background - Devotional Warm Colors */
@keyframes gradientShift {
    0% {
        background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 30%, #fed7aa 60%, #fef3c7 100%);
    }
    16.66% {
        background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 25%, #fef3c7 50%, #fde68a 75%, #fcd34d 100%);
    }
    33.33% {
        background: linear-gradient(135deg, #fed7aa 0%, #fef3c7 20%, #fbbf24 40%, #f59e0b 60%, #ea580c 80%, #fb923c 100%);
    }
    50% {
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 25%, #ea580c 50%, #fb923c 75%, #fcd34d 100%);
    }
    66.66% {
        background: linear-gradient(135deg, #ea580c 0%, #fb923c 30%, #fef3c7 60%, #fde68a 90%, #ffedd5 100%);
    }
    83.33% {
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 30%, #fed7aa 60%, #ffedd5 90%, #fff7ed 100%);
    }
    100% {
        background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 30%, #fed7aa 60%, #fef3c7 100%);
    }
}

/* ============================================
   Animated Background - Devotional Patterns
   ============================================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(3px 3px at 20% 30%, rgba(234, 88, 12, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(251, 191, 36, 0.4), transparent),
        radial-gradient(2px 2px at 50% 50%, rgba(220, 38, 38, 0.25), transparent),
        radial-gradient(3px 3px at 80% 10%, rgba(234, 88, 12, 0.35), transparent),
        radial-gradient(2px 2px at 90% 80%, rgba(251, 191, 36, 0.3), transparent),
        radial-gradient(2px 2px at 33% 80%, rgba(234, 88, 12, 0.3), transparent),
        radial-gradient(2px 2px at 70% 20%, rgba(251, 191, 36, 0.35), transparent);
    background-size: 200% 200%, 180% 180%, 150% 150%, 220% 220%, 190% 190%, 160% 160%, 210% 210%;
    background-position: 0% 0%, 100% 100%, 50% 50%, 25% 75%, 75% 25%, 40% 60%, 60% 40%;
    animation: starField 30s linear infinite;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

/* Animated Color Overlay - Devotional Warm Glow */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(234, 88, 12, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(251, 191, 36, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 50% 20%, rgba(220, 38, 38, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 40%, rgba(251, 191, 36, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 30% 70%, rgba(234, 88, 12, 0.1) 0%, transparent 40%);
    background-size: 200% 200%, 180% 180%, 220% 220%, 250% 250%, 190% 190%;
    animation: colorPulse 12s ease-in-out infinite, colorMove 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

@keyframes colorPulse {
    0%, 100% {
        background: radial-gradient(circle at 20% 50%, rgba(234, 88, 12, 0.2) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(251, 191, 36, 0.2) 0%, transparent 50%),
                    radial-gradient(circle at 50% 20%, rgba(220, 38, 38, 0.15) 0%, transparent 50%),
                    radial-gradient(circle at 70% 40%, rgba(251, 191, 36, 0.15) 0%, transparent 40%),
                    radial-gradient(circle at 30% 70%, rgba(234, 88, 12, 0.12) 0%, transparent 40%);
    }
    25% {
        background: radial-gradient(circle at 60% 30%, rgba(234, 88, 12, 0.25) 0%, transparent 50%),
                    radial-gradient(circle at 30% 70%, rgba(251, 191, 36, 0.25) 0%, transparent 50%),
                    radial-gradient(circle at 70% 60%, rgba(220, 38, 38, 0.2) 0%, transparent 50%),
                    radial-gradient(circle at 40% 20%, rgba(251, 191, 36, 0.18) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(234, 88, 12, 0.18) 0%, transparent 40%);
    }
    50% {
        background: radial-gradient(circle at 40% 80%, rgba(251, 191, 36, 0.3) 0%, transparent 50%),
                    radial-gradient(circle at 90% 40%, rgba(234, 88, 12, 0.3) 0%, transparent 50%),
                    radial-gradient(circle at 10% 30%, rgba(220, 38, 38, 0.25) 0%, transparent 50%),
                    radial-gradient(circle at 60% 60%, rgba(251, 191, 36, 0.2) 0%, transparent 40%),
                    radial-gradient(circle at 20% 50%, rgba(234, 88, 12, 0.2) 0%, transparent 40%);
    }
    75% {
        background: radial-gradient(circle at 80% 20%, rgba(234, 88, 12, 0.25) 0%, transparent 50%),
                    radial-gradient(circle at 20% 60%, rgba(251, 191, 36, 0.25) 0%, transparent 50%),
                    radial-gradient(circle at 50% 80%, rgba(220, 38, 38, 0.2) 0%, transparent 50%),
                    radial-gradient(circle at 70% 30%, rgba(251, 191, 36, 0.18) 0%, transparent 40%),
                    radial-gradient(circle at 30% 90%, rgba(234, 88, 12, 0.18) 0%, transparent 40%);
    }
}

@keyframes colorMove {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
    }
    50% {
        background-position: 100% 100%, 0% 0%, 50% 50%;
    }
}

@keyframes starField {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* ============================================
   Header Styles
   ============================================ */
header {
    background: rgba(255, 247, 237, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(234, 88, 12, 0.3) !important;
    box-shadow: 0 4px 30px rgba(234, 88, 12, 0.2);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(234, 88, 12, 0.15), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

header a span {
    font-family: var(--font-display);
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 50%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(234, 88, 12, 0.4);
    animation: glowPulse 3s ease-in-out infinite;
    letter-spacing: 2px;
}

@keyframes glowPulse {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 10px rgba(234, 88, 12, 0.5));
    }
    50% {
        filter: brightness(1.2) drop-shadow(0 0 20px rgba(234, 88, 12, 0.8));
    }
}

/* ============================================
   Main Container & Layout
   ============================================ */
main {
    position: relative;
    z-index: 1;
}

.max-w-4xl {
    position: relative;
}

/* Page Header */
.text-center h1 {
    font-family: var(--font-display);
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 50%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 0 40px rgba(234, 88, 12, 0.3);
    animation: fadeInUp 1s ease-out;
    margin-bottom: 1rem;
}

.text-center p {
    color: rgba(28, 25, 23, 0.8);
    font-size: 1.1rem;
    animation: fadeInUp 1s ease-out 0.2s both;
}

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

/* ============================================
   Chat Container - Mystical Glass Effect
   ============================================ */
#chat-container {
    background: rgba(15, 12, 41, 0.7) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(124, 58, 237, 0.3) !important;
    border-radius: 24px !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(251, 191, 36, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    overflow: hidden;
    position: relative;
    animation: containerFloat 6s ease-in-out infinite;
}

@keyframes containerFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

#chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fbbf24, #7c3aed, #f97316, transparent);
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% {
        opacity: 0.3;
        transform: translateX(-100%);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
        transform: translateX(100%);
    }
}

/* ============================================
   Chat Messages Area
   ============================================ */
#chat-messages {
    background: linear-gradient(180deg, rgba(15, 12, 41, 0.9) 0%, rgba(26, 22, 37, 0.95) 100%) !important;
    position: relative;
    overflow-y: auto;
    scroll-behavior: smooth;
}

#chat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(251, 191, 36, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: backgroundPulse 8s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Message Bubbles */
.chat-message, .mb-4 {
    animation: messageSlideIn 0.5s ease-out;
    margin-bottom: 1.5rem;
}

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

/* Bot Avatar - Small avatar at bottom of message */
.bot-avatar {
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 50%, #7c3aed 100%);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes orbGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(251, 191, 36, 0.6),
            0 0 40px rgba(124, 58, 237, 0.4),
            inset 0 2px 10px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(251, 191, 36, 0.9),
            0 0 60px rgba(124, 58, 237, 0.6),
            inset 0 2px 10px rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }
}

/* Bot Message Bubble */
.bot-message, .flex-1.bg-white.rounded-2xl {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(251, 191, 36, 0.2);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(124, 58, 237, 0.1);
    position: relative;
}

.bot-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #fbbf24, #7c3aed);
    border-radius: 2px 0 0 2px;
}

.bot-message p {
    color: #1f2937;
    line-height: 1.8;
}

.bot-message strong {
    color: #7c3aed;
    font-weight: 600;
}

/* User Message Bubble - Golden Gradient */
.user-message, .flex-1.bg-gradient-to-r.from-orange-500.to-amber-600 {
    background: linear-gradient(135deg, #f97316 0%, #fbbf24 50%, #ea580c 100%) !important;
    box-shadow: 
        0 4px 20px rgba(249, 115, 22, 0.4),
        0 0 30px rgba(251, 191, 36, 0.3);
    animation: messageGlow 2s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes messageGlow {
    0%, 100% {
        box-shadow: 
            0 4px 20px rgba(249, 115, 22, 0.4),
            0 0 30px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 
            0 6px 30px rgba(249, 115, 22, 0.6),
            0 0 50px rgba(251, 191, 36, 0.5);
    }
}

/* User Avatar */
.user-avatar, .flex-shrink-0.w-10.h-10.rounded-full:last-child {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* ============================================
   Input Forms - Modern Spiritual Design
   ============================================ */
#chat-input-area {
    background: rgba(15, 12, 41, 0.9) !important;
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(124, 58, 237, 0.3) !important;
    padding: 1.5rem;
}

.input-step {
    animation: formFadeIn 0.6s ease-out;
}

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

/* Labels */
label {
    color: rgba(28, 25, 23, 0.9) !important;
    font-weight: 500;
    font-family: var(--font-display);
    margin-bottom: 0.75rem;
    display: block;
}

/* Input Fields */
input[type="text"],
input[type="date"],
textarea {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid rgba(124, 58, 237, 0.3) !important;
    color: #1f2937 !important;
    border-radius: 12px !important;
    padding: 0.875rem 1.25rem !important;
    transition: all 0.3s ease !important;
    font-family: var(--font-body);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus {
    outline: none !important;
    border-color: #ea580c !important;
    box-shadow: 
        0 0 0 3px rgba(234, 88, 12, 0.2),
        0 4px 20px rgba(234, 88, 12, 0.3) !important;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1) !important;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: rgba(107, 114, 128, 0.6);
}

/* Buttons - Devotional Saffron Buttons */
button[type="button"],
.btn-submit {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 50%, #dc2626 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 0.875rem 1.75rem !important;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 
        0 4px 15px rgba(234, 88, 12, 0.4),
        0 0 20px rgba(251, 191, 36, 0.3);
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

button[type="button"]::before,
.btn-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button[type="button"]:hover::before,
.btn-submit:hover::before {
    width: 300px;
    height: 300px;
}

button[type="button"]:hover,
.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 6px 25px rgba(234, 88, 12, 0.6),
        0 0 40px rgba(251, 191, 36, 0.5);
}

button[type="button"]:active,
.btn-submit:active {
    transform: translateY(-1px);
}

button[type="button"]:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Category Buttons */
.category-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(124, 58, 237, 0.4) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.2), transparent);
    transition: left 0.5s;
}

.category-btn:hover {
    border-color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.15) !important;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.category-btn:hover::before {
    left: 100%;
}

.category-btn.active,
.category-btn.border-orange-500 {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(251, 191, 36, 0.2)) !important;
    border-color: #fbbf24 !important;
    color: #fbbf24 !important;
    box-shadow: 
        0 0 20px rgba(251, 191, 36, 0.4),
        inset 0 2px 10px rgba(255, 255, 255, 0.1);
    animation: categoryPulse 2s ease-in-out infinite;
}

@keyframes categoryPulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(251, 191, 36, 0.4),
            inset 0 2px 10px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(251, 191, 36, 0.6),
            inset 0 2px 10px rgba(255, 255, 255, 0.2);
    }
}

/* Textarea */
textarea {
    min-height: 120px;
    resize: vertical;
}

/* Character Counter */
#char-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* Error Messages */
.text-red-500 {
    color: #ff6b6b !important;
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* ============================================
   Loading States
   ============================================ */
.loading-spinner,
.animate-spin {
    border: 3px solid rgba(251, 191, 36, 0.2);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading-state {
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    justify-content: center;
}

#loading-state span {
    font-family: var(--font-display);
    font-size: 1.1rem;
    animation: loadingText 2s ease-in-out infinite;
}

@keyframes loadingText {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Typing Indicator */
.typing-indicator {
    display: inline-block;
    animation: typingDots 1.4s infinite;
}

@keyframes typingDots {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ============================================
   Scrollbar - Mystical Style
   ============================================ */
#chat-messages::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
    background: rgba(124, 58, 237, 0.1);
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #fbbf24, #7c3aed);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f97316, #6b21a8);
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.7);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    /* Container adjustments */
    .max-w-4xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Header text */
    .text-center h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .text-center p {
        font-size: 0.95rem !important;
        padding: 0 0.5rem;
    }
    
    /* Chat container */
    #chat-container {
        border-radius: 16px !important;
        margin: 0 0.5rem;
    }
    
    /* Chat messages area */
    #chat-messages {
        height: 500px !important;
        padding: 1rem !important;
    }
    
    /* Message bubbles - mobile */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .rounded-2xl {
        max-width: 95% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Bottom avatar styling */
    .flex.items-center.gap-2 {
        gap: 0.5rem !important;
        margin-top: 0.5rem !important;
        padding-top: 0.5rem !important;
    }
    
    .w-6.h-6 {
        width: 1.25rem !important;
        height: 1.25rem !important;
        font-size: 0.625rem !important;
    }
    
    /* Input area */
    #chat-input-area {
        padding: 1rem !important;
    }
    
    /* Form inputs - stack on mobile */
    .flex.gap-2 {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .flex.gap-2 input,
    .flex.gap-2 button {
        width: 100% !important;
    }
    
    /* Buttons */
    button[type="button"] {
        padding: 0.75rem 1rem !important;
        font-size: 0.875rem !important;
        width: 100% !important;
    }
    
    /* Category buttons grid */
    #category-buttons {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }
    
    .category-btn {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Labels */
    label {
        font-size: 0.875rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Input fields */
    input[type="text"],
    input[type="date"],
    textarea {
        padding: 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Textarea */
    textarea {
        min-height: 100px !important;
    }
    
    /* Character counter */
    #char-count {
        font-size: 0.75rem !important;
    }
    
    /* Loading state */
    #loading-state {
        padding: 1rem !important;
    }
    
    #loading-state span {
        font-size: 0.95rem !important;
    }
    
    /* Disclaimer */
    .mt-8.text-center {
        margin-top: 1.5rem !important;
        padding: 1rem !important;
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
    }
    
    .mt-8.text-center p {
        font-size: 0.75rem !important;
        line-height: 1.5 !important;
    }
    
    /* Page header spacing */
    .mb-10 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Star emoji */
    .text-6xl {
        font-size: 3rem !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    /* Even smaller adjustments */
    .max-w-4xl {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .text-center h1 {
        font-size: 1.75rem !important;
    }
    
    .text-center p {
        font-size: 0.875rem !important;
    }
    
    #chat-messages {
        height: 450px !important;
        padding: 0.75rem !important;
    }
    
    .rounded-2xl {
        max-width: 95% !important;
        padding: 0.625rem 0.875rem !important;
        font-size: 0.8125rem !important;
    }
    
    .w-6.h-6 {
        width: 1rem !important;
        height: 1rem !important;
        font-size: 0.5rem !important;
    }
    
    .w-5.h-5 {
        width: 1rem !important;
        height: 1rem !important;
        font-size: 0.5rem !important;
    }
    
    #category-buttons {
        grid-template-columns: 1fr !important;
    }
    
    .category-btn {
        padding: 0.875rem !important;
        font-size: 0.875rem !important;
    }
    
    button[type="button"] {
        padding: 0.875rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    #chat-input-area {
        padding: 0.75rem !important;
    }
    
    input[type="text"],
    input[type="date"],
    textarea {
        padding: 0.625rem !important;
        font-size: 0.8125rem !important;
    }
    
    .text-6xl {
        font-size: 2.5rem !important;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #chat-messages {
        height: 400px !important;
    }
    
    .pt-8 {
        padding-top: 1rem !important;
    }
    
    .pb-8 {
        padding-bottom: 1rem !important;
    }
}

/* ============================================
   Accessibility
   ============================================ */
*:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Prediction Display Styles
   ============================================ */
.prediction-section {
    animation: predictionReveal 1s ease-out;
}

@keyframes predictionReveal {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.prediction-section strong {
    color: #7c3aed;
    font-family: var(--font-display);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Disclaimer */
.text-xs.text-gray-500 {
    color: rgba(255, 255, 255, 0.6) !important;
    font-style: italic;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

/* Hidden Elements */
.hidden {
    display: none !important;
}

/* ============================================
   Additional Animation Keyframes
   ============================================ */
@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

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

@keyframes messageComplete {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes orbGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(251, 191, 36, 0.6),
            0 0 40px rgba(124, 58, 237, 0.4),
            inset 0 2px 10px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(251, 191, 36, 0.9),
            0 0 60px rgba(124, 58, 237, 0.6),
            inset 0 2px 10px rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }
}

/* Welcome message animation */
.welcome-message {
    animation: welcomeFadeIn 1s ease-out;
}

@keyframes welcomeFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Input step animations */
.input-step.hidden {
    display: none !important;
}

.input-step:not(.hidden) {
    animation: formSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes formSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Question form reveal */
#question-form:not(.hidden) {
    animation: questionFormReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes questionFormReveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   Home Page Styles
   ============================================ */

/* Pricing Banner */
.pricing-banner {
    animation: fadeInDown 0.8s ease-out;
}

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

/* Step Widget Container */
.step-content {
    min-height: 400px;
}

.step-content.hidden {
    display: none !important;
}

/* Category Options Hover Effects - Enhanced */
.category-option {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    transition: left 0.5s;
}

.category-option:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.4), 0 0 0 1px rgba(245, 158, 11, 0.3) !important;
    border-color: rgba(139, 92, 246, 0.6) !important;
    background: rgba(139, 92, 246, 0.15) !important;
}

.category-option:hover::before {
    left: 100%;
}

.category-option:active {
    transform: translateY(-4px) scale(1);
}

/* Step Indicators */
.step-indicator {
    transition: all 0.3s ease;
}

.step-indicator.active .w-12 {
    animation: stepPulse 2s ease-in-out infinite;
}

@keyframes stepPulse {
    0%, 100% {
        box-shadow: 0 0 25px rgba(234, 88, 12, 0.7), 0 0 50px rgba(251, 191, 36, 0.4);
    }
    50% {
        box-shadow: 0 0 35px rgba(234, 88, 12, 0.9), 0 0 70px rgba(251, 191, 36, 0.6);
    }
}

/* Category Tags - Desktop Layout */
#category-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    width: 100%;
}

.category-tag {
    flex-shrink: 0;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.category-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

.category-tag.active {
    background: rgba(234, 88, 12, 0.15) !important;
    border-color: #ea580c !important;
    color: #ea580c !important;
    box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

/* Form Inputs Focus States */
#birth-details-form input:focus {
    transform: translateY(-2px);
    box-shadow: 
        0 0 0 3px rgba(251, 191, 36, 0.2),
        0 4px 20px rgba(249, 115, 22, 0.3) !important;
}

/* FAQ Accordion */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(234, 88, 12, 0.5) !important;
    box-shadow: 0 8px 32px rgba(234, 88, 12, 0.2) !important;
}

.faq-question {
    cursor: pointer;
}

.faq-question:hover {
    background: rgba(234, 88, 12, 0.1) !important;
}

.faq-icon {
    color: #ea580c;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    animation: faqSlideDown 0.3s ease-out;
}

@keyframes faqSlideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Trust Building Cards */
.trust-card {
    transition: all 0.3s ease;
}

.trust-card:hover {
    transform: translateY(-5px);
    border-color: rgba(234, 88, 12, 0.5) !important;
    box-shadow: 0 8px 32px rgba(234, 88, 12, 0.2) !important;
}

/* Desktop-specific styles */
@media (min-width: 768px) {
    /* Step indicator bar - desktop layout */
    .step-indicator {
        flex: 1;
    }
    
    .step-connector {
        flex: 1;
        margin: 0 0.5rem;
        height: 0.375rem;
    }
    
    /* Category tags - ensure horizontal layout on desktop */
    #category-tags {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .category-tag {
        min-width: auto;
        padding: 0.5rem 1rem;
    }
    
    /* Widget container - desktop spacing */
    .max-w-5xl {
        margin-left: auto;
        margin-right: auto;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Step content - desktop min height */
    .step-content {
        min-height: 450px;
        padding: 2.5rem;
    }
    
    /* Step indicator bar - desktop */
    .step-indicator .w-12 {
        width: 3rem;
        height: 3rem;
    }
    
    /* Step indicator text - desktop */
    .step-indicator .ml-4 {
        margin-left: 1rem;
    }
    
    /* How It Works cards - desktop hover */
    .grid.grid-cols-1.md\\:grid-cols-3 > div:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 12px 40px rgba(234, 88, 12, 0.25);
    }
}

/* Responsive adjustments for home page */
@media (max-width: 768px) {
    /* Header pricing - hide on mobile, show in content */
    header .flex-1:last-child {
        display: none;
    }

    /* Step indicators - show only numbers on mobile */
    .step-indicator .hidden {
        display: none !important;
    }

    /* Category grid - single column on mobile */
    #category-grid {
        grid-template-columns: 1fr !important;
    }

    /* Step content padding */
    .step-content {
        min-height: 300px;
        padding: 1rem !important;
    }

    /* FAQ items */
    .faq-question {
        padding: 1rem !important;
        font-size: 0.9rem !important;
    }

    .faq-answer {
        padding: 0 1rem 1rem !important;
        font-size: 0.875rem !important;
    }
}

/* Loading spinner for predictions */
#predictions-loading {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Prediction result animation */
#predictions-result:not(.hidden) {
    animation: predictionReveal 0.8s ease-out;
}

/* Button hover effects */
button:not(:disabled):hover {
    transform: translateY(-2px);
}

button:not(:disabled):active {
    transform: translateY(0);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Enhanced Animated Background - Multiple Color Layers */
body {
    position: relative;
}

body::before {
    z-index: 0;
}

body::after {
    z-index: 0;
}

/* Ensure content is above animated backgrounds */
main, section, .max-w-7xl, .max-w-5xl, .max-w-4xl {
    position: relative;
    z-index: 1;
}

/* Additional animated color orbs for more dynamic effect */
.page-wrapper::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(251, 191, 36, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 70% 60%, rgba(124, 58, 237, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 50% 80%, rgba(249, 115, 22, 0.2) 0%, transparent 30%);
    animation: orbFloat 25s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }
    25% {
        transform: translate(10%, -10%) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-10%, 10%) scale(0.9);
        opacity: 0.5;
    }
    75% {
        transform: translate(5%, -5%) scale(1.05);
        opacity: 0.55;
    }
}
