:root {
    /* Cosmic Color Palette */
    --cosmic-black: #0a0a1a;
    --space-navy: #0f1729;
    --midnight-blue: #1a1f3a;
    --nebula-purple: #2a1a4a;
    
    --gold-glow: #d4af37;
    --cosmic-purple: #8b5cf6;
    --electric-cyan: #06b6d4;
    --nebula-pink: #ec4899;
    --star-white: #ffffff;
    
    --card-glass: rgba(26, 31, 58, 0.7);
    --border-glow: rgba(212, 175, 55, 0.3);
}

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

body {
    font-family: 'Philosopher', sans-serif;
    background: radial-gradient(circle at 50% 50%, var(--midnight-blue) 0%, var(--space-navy) 50%, var(--cosmic-black) 100%);
    color: var(--star-white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Starfield */
.stars-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#stars1 {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400"><circle cx="25" cy="50" r="1" fill="white" opacity="0.8"/><circle cx="150" cy="80" r="1" fill="white" opacity="0.6"/><circle cx="300" cy="120" r="1.5" fill="white"/><circle cx="100" cy="200" r="1" fill="white" opacity="0.7"/><circle cx="250" cy="250" r="1" fill="white" opacity="0.9"/><circle cx="50" cy="350" r="1.5" fill="white" opacity="0.5"/></svg>') repeat;
    animation: twinkle 3s infinite ease-in-out;
}

#stars2 {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500"><circle cx="75" cy="100" r="1" fill="%2306b6d4" opacity="0.6"/><circle cx="200" cy="150" r="1.5" fill="%238b5cf6" opacity="0.5"/><circle cx="400" cy="200" r="1" fill="%23ec4899" opacity="0.7"/><circle cx="150" cy="350" r="1" fill="%2306b6d4" opacity="0.8"/><circle cx="350" cy="400" r="1.5" fill="white" opacity="0.4"/></svg>') repeat;
    animation: twinkle 4s infinite ease-in-out 1s;
}

#stars3 {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="600" height="600"><circle cx="100" cy="150" r="2" fill="white" opacity="0.9"/><circle cx="300" cy="250" r="1.5" fill="%23d4af37" opacity="0.7"/><circle cx="500" cy="350" r="2" fill="white" opacity="0.6"/><circle cx="200" cy="500" r="1.5" fill="white" opacity="0.8"/></svg>') repeat;
    animation: twinkle 5s infinite ease-in-out 2s;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Nebula Overlay */
.nebula-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
    animation: nebulaPulse 20s infinite ease-in-out;
}

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

/* App Container */
.app-container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Splash Screen */
.splash-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    animation: fadeIn 1s ease-in;
}

.splash-screen.active {
    display: flex;
}

.zodiac-wheel {
    width: 300px;
    height: 300px;
    margin-bottom: 40px;
    animation: rotateZodiac 60s linear infinite;
}

@keyframes rotateZodiac {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.zodiac-circle {
    animation: pulse 3s infinite ease-in-out;
}

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

.app-title {
    font-family: 'Cinzel', serif;
    font-size: 5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-glow), #ffd700, var(--gold-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(212, 175, 55, 0.5);
    margin-bottom: 20px;
    letter-spacing: 0.1em;
    animation: titleGlow 3s infinite ease-in-out;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.5)); }
    50% { filter: drop-shadow(0 0 40px rgba(212, 175, 55, 0.8)); }
}

.app-subtitle {
    font-size: 1.5rem;
    color: var(--electric-cyan);
    margin-bottom: 60px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Cosmic Button */
.cosmic-button {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 18px 50px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(139, 92, 246, 0.2));
    border: 2px solid var(--gold-glow);
    color: var(--star-white);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cosmic-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.cosmic-button:hover::before {
    left: 100%;
}

.cosmic-button:hover {
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

/* Onboarding Screen */
.onboarding-screen {
    display: none;
    min-height: 100vh;
    padding: 60px 20px;
}

.onboarding-content {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--gold-glow);
    margin-bottom: 15px;
    text-align: center;
}

.section-description {
    text-align: center;
    color: var(--electric-cyan);
    margin-bottom: 40px;
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Form Styles */
.birth-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

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

.form-group label {
    font-size: 0.95rem;
    color: var(--gold-glow);
    letter-spacing: 0.05em;
}

.form-group input {
    padding: 15px;
    background: rgba(15, 23, 41, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    color: var(--star-white);
    font-family: 'Philosopher', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold-glow);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Dashboard */
.dashboard-screen {
    display: none;
    animation: fadeIn 1s ease-in;
}

.app-header {
    margin-bottom: 40px;
}

.dashboard-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--gold-glow);
    margin-bottom: 10px;
}

.current-date {
    color: var(--electric-cyan);
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.cosmic-card {
    background: var(--card-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cosmic-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--gold-glow), var(--cosmic-purple), var(--electric-cyan));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.cosmic-card:hover::before {
    opacity: 0.3;
}

.cosmic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.large-card {
    grid-column: span 2;
}

.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.card-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: var(--gold-glow);
}

.zodiac-symbol {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px var(--gold-glow));
}

.card-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Horoscope */
.zodiac-sign {
    font-size: 1.2rem;
    color: var(--electric-cyan);
    margin-bottom: 15px;
    font-weight: 600;
}

.horoscope-content {
    font-size: 1.05rem;
}

/* Numerology */
.numerology-display {
    text-align: center;
    padding: 20px;
}

.life-path-number {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 6rem;
    color: var(--gold-glow);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
    margin-bottom: 20px;
}

.life-path-meaning {
    font-size: 1.1rem;
    color: var(--electric-cyan);
}

/* Biorhythm */
#biorhythmChart {
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
}

.biorhythm-legend {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.legend-color.physical {
    background: #ff6b6b;
}

.legend-color.emotional {
    background: #4ecdc4;
}

.legend-color.intellectual {
    background: #95e1d3;
}

/* Moon Phase */
.moon-phase-content {
    text-align: center;
    padding: 20px;
}

.moon-display {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px auto;
    display: block;
}

.moon-phase-name {
    font-size: 1.3rem;
    color: var(--gold-glow);
    margin-bottom: 10px;
}

.moon-description {
    color: var(--electric-cyan);
}

/* Chat */
.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 10px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 12px;
    animation: messageSlideIn 0.3s ease-out;
}

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

.chat-message.user {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    margin-left: 20%;
}

.chat-message.assistant {
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid rgba(6, 182, 212, 0.4);
    margin-right: 20%;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 15px;
    background: rgba(15, 23, 41, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 10px;
    color: var(--star-white);
    font-family: 'Philosopher', sans-serif;
    font-size: 1rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--gold-glow);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.send-button {
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--gold-glow), #ffd700);
    border: none;
    border-radius: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.questions-remaining {
    font-size: 0.9rem;
    color: var(--electric-cyan);
    opacity: 0.8;
}

/* Upgrade Banner */
.upgrade-banner {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
    backdrop-filter: blur(20px);
    border: 2px solid var(--gold-glow);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
}

.upgrade-content h3 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--gold-glow);
    margin-bottom: 15px;
}

.upgrade-content p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.9);
}

.premium-button {
    background: linear-gradient(135deg, var(--nebula-purple), var(--cosmic-purple));
    border-color: var(--nebula-pink);
    font-size: 1.2rem;
}

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

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(15, 23, 41, 0.4);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--gold-glow);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .app-title {
        font-size: 3rem;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .large-card {
        grid-column: span 1;
    }
    
    .onboarding-content {
        padding: 30px;
    }
    
    .chat-message.user,
    .chat-message.assistant {
        margin-left: 0;
        margin-right: 0;
    }
}

/* ========================================
   TAROT READING UI
   ======================================== */

.tarot-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tarot-select {
    flex: 1;
    min-width: 200px;
    background: rgba(26, 31, 58, 0.9);
    border: 1px solid var(--border-glow);
    color: var(--star-white);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'Philosopher', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.tarot-select:focus {
    border-color: var(--gold-glow);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.tarot-btn {
    white-space: nowrap;
    padding: 0.75rem 2rem;
}

/* Cards container */
.tarot-cards-container {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 220px;
}

/* Individual tarot card */
.tarot-card {
    width: 130px;
    flex-shrink: 0;
    perspective: 1000px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.tarot-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.tarot-card-inner {
    position: relative;
    width: 100%;
    height: 200px;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tarot-card.flipped .tarot-card-inner {
    transform: rotateY(180deg);
}

.tarot-card-front,
.tarot-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 1px solid var(--border-glow);
}

/* Card back — face down */
.tarot-card-back {
    background: linear-gradient(135deg, var(--nebula-purple) 0%, var(--midnight-blue) 100%);
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(212, 175, 55, 0.05) 0px,
            rgba(212, 175, 55, 0.05) 1px,
            transparent 1px,
            transparent 8px
        );
    border-color: var(--gold-glow);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2), inset 0 0 20px rgba(139, 92, 246, 0.1);
}

.tarot-card-back::before {
    content: '✦';
    font-size: 2.5rem;
    color: var(--gold-glow);
    opacity: 0.6;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.8));
}

/* Card front — revealed */
.tarot-card-front {
    transform: rotateY(180deg);
    background: linear-gradient(160deg, var(--midnight-blue) 0%, var(--nebula-purple) 100%);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
    gap: 0.4rem;
    text-align: center;
}

.tarot-card-number {
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    color: var(--gold-glow);
    opacity: 0.7;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tarot-card-symbol {
    font-size: 2rem;
    filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.6));
    line-height: 1;
}

.tarot-card-name {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: var(--star-white);
    font-weight: 600;
    line-height: 1.2;
}

.tarot-card-reversed {
    font-size: 0.6rem;
    color: var(--nebula-pink);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tarot-card-position {
    font-size: 0.65rem;
    color: var(--electric-cyan);
    opacity: 0.8;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.tarot-card-keywords {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.3;
    margin-top: 0.25rem;
}

/* Reading narrative */
.tarot-reading-text {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(26, 31, 58, 0.5);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    animation: fadeInUp 0.8s ease forwards;
}

.reading-divider {
    text-align: center;
    color: var(--gold-glow);
    font-size: 1rem;
    letter-spacing: 8px;
    margin-bottom: 1rem;
    opacity: 0.7;
}

#tarotReadingText {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.9);
    font-style: italic;
}

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

.premium-badge {
    background: linear-gradient(135deg, var(--gold-glow), #ffd700);
    color: var(--cosmic-black);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    letter-spacing: 1px;
    font-family: 'Cinzel', serif;
}
