/* ===== Local Fonts ===== */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/static/fonts/outfit-300.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/outfit-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/static/fonts/outfit-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/static/fonts/outfit-700.woff2') format('woff2');
}

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #15151f;
    --bg-card: rgba(25, 25, 40, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --accent-purple: #8b5cf6;
    --accent-gold: #fbbf24;
    --accent-blue: #3b82f6;
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --gradient-accent: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* ===== Animated Background Glow ===== */
.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* ===== Header & Navigation ===== */
header {
    padding: 2rem 0;
    backdrop-filter: blur(10px);
    background: rgba(10, 10, 15, 0.5);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

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

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* ===== Hero Section ===== */
.hero {
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -1px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
    font-weight: 300;
}

/* ===== Bazi Form Card ===== */
.bazi-form-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-glow);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.bazi-form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0.8;
}

.bazi-form-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.4);
}

.bazi-form-card h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 15, 25, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    transition: var(--transition-smooth);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-group input:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

/* ===== Button Styles ===== */
.btn-primary {
    width: 100%;
    padding: 1.25rem 2rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
}

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

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ===== Footer ===== */
footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    margin-top: 4rem;
    position: relative;
    z-index: 1;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .bazi-form-card {
        padding: 2rem 1.5rem;
    }

    .bazi-form-card h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .bazi-form-card {
        padding: 1.5rem;
    }
}

/* ===== Results Section ===== */
.results-section {
    margin-top: 3rem;
    width: 100%;
    max-width: 800px;
}

.result-card,
.error-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-glow);
    animation: slideIn 0.5s ease-out;
}

.error-card {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card h3,
.error-card h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-card h3 {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pillar {
    background: rgba(15, 15, 25, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: var(--transition-smooth);
}

.pillar:hover {
    border-color: var(--accent-purple);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
}

.pillar-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.pillar-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

.full-chart {
    padding: 1.5rem;
    background: rgba(15, 15, 25, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    font-size: 1.1rem;
    line-height: 1.8;
}

.full-chart strong {
    color: var(--accent-gold);
    margin-right: 0.5rem;
}

/* Responsive adjustments for results */
@media (max-width: 768px) {
    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .result-card,
    .error-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .pillars-grid {
        grid-template-columns: 1fr;
    }

    .pillar-value {
        font-size: 1.25rem;
    }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}