/* ========================================
   BaziFortune - Premium Design
   ======================================== */

:root {
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --secondary: #f59e0b;
    --accent: #06b6d4;
    --bg-dark: #0f0f1a;
    --bg-card: rgba(30, 30, 50, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --border: rgba(139, 92, 246, 0.3);
    --gradient-1: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --gradient-2: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

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

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

nav {
    display: flex;
    gap: 32px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    position: relative;
}

nav a:hover {
    color: var(--primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

.language-selector select {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

/* Hero Section */
.hero {
    padding: 160px 0 80px;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #a0a0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Ad Container */
.ad-container {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.ad-placeholder {
    background: var(--bg-glass);
    border: 1px dashed var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    max-width: 100%;
}

.ad-placeholder:not(.ad-300x250) {
    width: 728px;
    height: 90px;
}

.ad-300x250 {
    width: 300px;
    height: 250px;
}

/* Main Content */
main.container {
    padding: 40px 24px;
}

/* Section */
.section {
    margin-bottom: 80px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1rem;
}

/* Calculator Card */
.calculator-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    max-width: 560px;
    margin: 0 auto;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Form Elements */
.form-group {
    margin-bottom: 28px;
}

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

.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
}

.form-group input[type="date"]:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.radio-group {
    display: flex;
    gap: 24px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
    flex: 1;
    justify-content: center;
}

.radio-label:has(input:checked) {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.15);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-label span {
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 18px 32px;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

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

.btn-large {
    padding: 24px 48px;
    font-size: 1.25rem;
    border-radius: 16px;
}

/* Result Card */
.result-card {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.result-card h3 {
    color: var(--secondary);
    font-size: 1.25rem;
    margin-bottom: 20px;
}

.result-item {
    background: var(--bg-glass);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.result-item .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-item .value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--bg-glass);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.progress-bar .fill.high { background: linear-gradient(90deg, #22c55e, #4ade80); }
.progress-bar .fill.medium { background: linear-gradient(90deg, #eab308, #facc15); }
.progress-bar .fill.low { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Name Display */
.name-display {
    text-align: center;
    padding: 32px;
}

.name-display .name {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.name-display .pinyin {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.name-display .meaning {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Fortune Card */
.fortune-card {
    text-align: center;
    padding: 40px;
}

.fortune-card .fortune-rank {
    font-size: 4rem;
    margin-bottom: 16px;
}

.fortune-card .fortune-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 20px;
}

.fortune-card .fortune-text {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.fortune-info {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.fortune-cooldown {
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-glass);
    border-radius: 12px;
    text-align: center;
    color: var(--text-secondary);
}

/* Zodiac Grid */
.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.zodiac-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
}

.zodiac-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.2);
}

.zodiac-emoji {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
}

.zodiac-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 8px;
}

.zodiac-years {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Sidebar Ads */
.sidebar-ads {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 48px 0;
    flex-wrap: wrap;
}

/* Footer */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 48px 0;
    margin-top: 80px;
}

.footer-content {
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Content Grid for Zodiac */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
}

.content-card h2 {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.content-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    nav {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .calculator-card {
        padding: 28px;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .ad-placeholder {
        width: 100% !important;
        max-width: 300px;
    }
    
    .sidebar-ads {
        flex-direction: column;
        align-items: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card {
    animation: fadeIn 0.5s ease;
}

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

.fortune-rank {
    animation: pulse 2s ease infinite;
}

/* Zodiac internal links */
.zodiac-internal-link {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed #e74c3c;
    transition: color 0.2s;
}
.zodiac-internal-link:hover {
    color: #c0392b;
    border-bottom: 1px solid #c0392b;
}
