/* BaZi Reading - Bát Tự Tử Bình */
/* QuizzMan Tools - Traditional Chinese Fortune Telling */

:root {
    /* Core Colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    --secondary: #8b5cf6;
    --secondary-light: rgba(139, 92, 246, 0.1);
    
    /* Five Elements Colors */
    --wood: #22c55e;
    --wood-light: rgba(34, 197, 94, 0.15);
    --fire: #ef4444;
    --fire-light: rgba(239, 68, 68, 0.15);
    --earth: #f59e0b;
    --earth-light: rgba(245, 158, 11, 0.15);
    --metal: #a1a1aa;
    --metal-light: rgba(161, 161, 170, 0.15);
    --water: #3b82f6;
    --water-light: rgba(59, 130, 246, 0.15);
    
    /* Traditional Colors */
    --gold: #d4af37;
    --crimson: #dc143c;
    --jade: #00a86b;
    --ink: #2c3e50;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Neutrals */
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    
    /* Effects */
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --ink: #e2e8f0;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.dark-mode header {
    background: rgba(30, 41, 59, 0.95);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo {
    height: 40px;
    width: auto;
    transition: transform var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link,
#theme-btn,
#lang-btn {
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.nav-link,
#theme-btn {
    width: 40px;
}

#lang-btn {
    padding: 0 0.75rem;
    gap: 0.25rem;
}

#lang-text {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-link:hover,
#theme-btn:hover,
#lang-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Page Title */
.page-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.page-title.compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--crimson), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-title h1 i {
    color: var(--gold);
    -webkit-text-fill-color: var(--gold);
}

.page-title .subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.about-link-container {
    margin-top: 10px;
    text-align: center;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.about-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.about-link i {
    font-size: 16px;
}

/* Feature Tabs */
.feature-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.feature-tab {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    transition: all var(--transition);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.feature-tab i {
    font-size: 1.25rem;
}

.feature-tab:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.feature-tab.active {
    background: linear-gradient(135deg, var(--crimson), var(--gold));
    color: white;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
}

/* Feature Panels */
.feature-panel {
    display: none;
}

.feature-panel.active {
    display: block;
}

/* BaZi Cards */
.bazi-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.05), rgba(212, 175, 55, 0.05));
    border-bottom: 1px solid var(--border);
}

.dark-mode .card-header {
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1), rgba(212, 175, 55, 0.1));
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--crimson), var(--gold));
    color: white;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.25);
}

.card-title h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

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

/* Form Styles */
.bazi-form {
    padding: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr;
    gap: 0.5rem;
}

.date-inputs input {
    text-align: center;
}

/* Gender Select */
.gender-select {
    display: flex;
    gap: 0.5rem;
}

.gender-select input {
    display: none;
}

.gender-option {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gender-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.gender-select input:checked + .gender-option {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Timezone Section */
.timezone-section {
    margin-bottom: 1rem;
}

.timezone-section > label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.timezone-toggle {
    display: flex;
    gap: 0.5rem;
}

.tz-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tz-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.tz-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Advanced Options */
.advanced-toggle {
    margin: 1rem 0;
}

.toggle-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.toggle-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.toggle-btn .icon-right {
    margin-left: auto;
    transition: transform var(--transition);
}

.toggle-btn.active .icon-right {
    transform: rotate(180deg);
}

.advanced-options {
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

/* Historical Notice */
.historical-notice {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius);
    border-left: 4px solid var(--warning);
    margin-top: 1rem;
}

.notice-icon {
    color: var(--warning);
    font-size: 1.25rem;
}

.notice-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.region-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.region-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.region-btn:hover {
    border-color: var(--warning);
}

.region-btn.active {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--crimson), var(--gold));
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(220, 20, 60, 0.3);
    margin-top: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(220, 20, 60, 0.4);
}

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

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.loading-state p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================================ */
/* PILLARS CHART - Tứ Trụ Display */
/* ============================================================ */

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

.pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1rem;
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.pillar:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.pillar-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.pillar-stem {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pillar-stem.wood { background: linear-gradient(135deg, #22c55e, #16a34a); }
.pillar-stem.fire { background: linear-gradient(135deg, #ef4444, #dc2626); }
.pillar-stem.earth { background: linear-gradient(135deg, #f59e0b, #d97706); }
.pillar-stem.metal { background: linear-gradient(135deg, #a1a1aa, #71717a); }
.pillar-stem.water { background: linear-gradient(135deg, #3b82f6, #2563eb); }

.pillar-stem-name {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.pillar-branch {
    width: 70px;
    height: 70px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 3px solid;
    margin-bottom: 0.5rem;
}

.pillar-branch.wood { 
    border-color: var(--wood); 
    background: var(--wood-light);
    color: var(--wood);
}
.pillar-branch.fire { 
    border-color: var(--fire); 
    background: var(--fire-light);
    color: var(--fire);
}
.pillar-branch.earth { 
    border-color: var(--earth); 
    background: var(--earth-light);
    color: var(--earth);
}
.pillar-branch.metal { 
    border-color: var(--metal); 
    background: var(--metal-light);
    color: #52525b;
}
.pillar-branch.water { 
    border-color: var(--water); 
    background: var(--water-light);
    color: var(--water);
}

.pillar-branch-zodiac {
    font-size: 0.7rem;
    opacity: 0.8;
}

.pillar-branch-name {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
}

.pillar-hidden {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

.pillar-ten-god {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Lunar Info */
.lunar-info {
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.lunar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.lunar-item i {
    color: var(--gold);
}

.lunar-item strong {
    color: var(--text);
}

/* ============================================================ */
/* PROFILE CARD - Day Master */
/* ============================================================ */

.profile-content {
    padding: 1.5rem;
}

.day-master-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.day-master-symbol {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.day-master-info {
    flex: 1;
}

.day-master-info h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.day-master-info .element-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.element-tag.wood { background: var(--wood-light); color: var(--wood); }
.element-tag.fire { background: var(--fire-light); color: var(--fire); }
.element-tag.earth { background: var(--earth-light); color: var(--earth); }
.element-tag.metal { background: var(--metal-light); color: #52525b; }
.element-tag.water { background: var(--water-light); color: var(--water); }

.day-master-image {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.profile-traits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.trait-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}

.trait-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--primary-light);
    color: var(--primary);
}

.trait-content {
    flex: 1;
}

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

.trait-value {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
}

/* ============================================================ */
/* ELEMENTS CHART - Ngũ Hành */
/* ============================================================ */

.elements-chart {
    padding: 1.5rem;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.element-item {
    text-align: center;
}

.element-bar-container {
    height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.element-bar {
    width: 40px;
    border-radius: 4px 4px 0 0;
    transition: height var(--transition-slow);
    position: relative;
}

.element-bar.wood { background: linear-gradient(180deg, #22c55e, #16a34a); }
.element-bar.fire { background: linear-gradient(180deg, #ef4444, #dc2626); }
.element-bar.earth { background: linear-gradient(180deg, #f59e0b, #d97706); }
.element-bar.metal { background: linear-gradient(180deg, #a1a1aa, #71717a); }
.element-bar.water { background: linear-gradient(180deg, #3b82f6, #2563eb); }

.element-bar::after {
    content: attr(data-count);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.element-name {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 600;
}

.element-zh {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

/* Useful God */
.useful-god {
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.useful-god-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.useful-god-header h4 {
    font-size: 1rem;
    color: var(--text);
}

.god-tag {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.god-tag.useful { background: var(--success); color: white; }
.god-tag.taboo { background: var(--danger); color: white; }

.useful-god-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.favorable-elements {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

/* ============================================================ */
/* TEN GODS GRID - Thập Thần */
/* ============================================================ */

.ten-gods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 1.5rem;
}

.ten-god-item {
    padding: 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
    text-align: center;
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.ten-god-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.ten-god-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.ten-god-zh {
    font-size: 1.1rem;
    color: var(--gold);
}

.ten-god-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.ten-god-count {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ============================================================ */
/* SHEN SHA - Thần Sát */
/* ============================================================ */

.shensha-content {
    padding: 1.5rem;
}

.shensha-section {
    margin-bottom: 1.5rem;
}

.shensha-section:last-child {
    margin-bottom: 0;
}

.shensha-section h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shensha-section h4.auspicious {
    color: var(--success);
}

.shensha-section h4.inauspicious {
    color: var(--danger);
}

.shensha-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.shensha-tag {
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: help;
    transition: all var(--transition);
}

.shensha-tag.auspicious {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.shensha-tag.inauspicious {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.shensha-tag:hover {
    transform: scale(1.05);
}

/* ============================================================ */
/* LUCK PILLARS - Đại Vận */
/* ============================================================ */

.luck-pillars {
    padding: 1.5rem;
    overflow-x: auto;
}

.luck-pillars-container {
    display: flex;
    gap: 0.75rem;
    min-width: max-content;
}

.luck-pillar {
    min-width: 90px;
    padding: 1rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
    text-align: center;
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.luck-pillar:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.luck-pillar.current {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(220, 20, 60, 0.05));
}

.luck-age {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.luck-years {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.luck-stem {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin: 0 auto 0.5rem;
}

.luck-branch {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.luck-text {
    font-size: 0.8rem;
    color: var(--text);
}

.luck-rating {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.luck-rating.good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.luck-rating.neutral {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.luck-rating.bad {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* ============================================================ */
/* RELATIONSHIPS - Quan Hệ Chi */
/* ============================================================ */

.relationships-content {
    padding: 1.5rem;
}

.relationship-section {
    margin-bottom: 1.25rem;
}

.relationship-section:last-child {
    margin-bottom: 0;
}

.relationship-section h4 {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.relationship-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.relationship-tag {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.relationship-tag.positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.relationship-tag.negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.relationship-tag.neutral {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* ============================================================ */
/* READING CONTENT - Luận Giải */
/* ============================================================ */

.reading-content {
    padding: 1.5rem;
}

/* Solar Time Note */
.solar-time-note {
    background: linear-gradient(135deg, var(--primary-light), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.solar-time-note h4 {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.solar-time-note .reading-text p {
    margin-bottom: 0.75rem;
}

.solar-time-note .reading-list {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.solar-time-note .reading-list li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.reading-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.reading-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.reading-section h4 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reading-section h4 i {
    color: var(--gold);
}

.reading-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.reading-list {
    list-style: none;
    margin-top: 0.5rem;
}

.reading-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.reading-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--gold);
    font-weight: bold;
}

/* ============================================================ */
/* COMPATIBILITY PANEL */
/* ============================================================ */

.person-section {
    margin-bottom: 1.5rem;
}

.person-section h3 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.person-divider {
    text-align: center;
    padding: 1rem 0;
    color: var(--crimson);
    font-size: 1.5rem;
}

.compatibility-results {
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

.compat-score {
    text-align: center;
    margin-bottom: 1.5rem;
}

.compat-score-value {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--crimson), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.compat-score-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.compat-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.compat-item {
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    text-align: center;
}

.compat-item-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.compat-item-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.compat-item-score {
    font-size: 1.5rem;
    font-weight: 700;
}

.compat-item-score.good { color: var(--success); }
.compat-item-score.neutral { color: var(--warning); }
.compat-item-score.bad { color: var(--danger); }

/* ============================================================ */
/* ANNUAL FORTUNE PANEL */
/* ============================================================ */

.target-year-group {
    max-width: 200px;
}

.annual-results {
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

.annual-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.annual-year {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
}

.annual-pillars {
    font-size: 1rem;
    color: var(--text-secondary);
}

.annual-areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.annual-area {
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    text-align: center;
    border-left: 4px solid var(--border);
}

.annual-area.career { border-left-color: var(--primary); }
.annual-area.wealth { border-left-color: var(--gold); }
.annual-area.relationship { border-left-color: var(--crimson); }
.annual-area.health { border-left-color: var(--success); }

.annual-area-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.annual-area.career .annual-area-icon { color: var(--primary); }
.annual-area.wealth .annual-area-icon { color: var(--gold); }
.annual-area.relationship .annual-area-icon { color: var(--crimson); }
.annual-area.health .annual-area-icon { color: var(--success); }

.annual-area-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.annual-area-score {
    font-size: 1.5rem;
    font-weight: 700;
}

.annual-area-score.good { color: var(--success); }
.annual-area-score.neutral { color: var(--warning); }
.annual-area-score.bad { color: var(--danger); }

.annual-area-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* ============================================================ */
/* NAME ANALYSIS PANEL */
/* ============================================================ */

.name-results {
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

.name-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.name-display {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.name-score {
    font-size: 3rem;
    font-weight: 700;
}

.name-score.good { color: var(--success); }
.name-score.neutral { color: var(--warning); }
.name-score.bad { color: var(--danger); }

.name-elements {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.name-analysis-details {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================================ */
/* FOOTER */
/* ============================================================ */

footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
}

footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

footer .disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================================ */
/* RESPONSIVE */
/* ============================================================ */

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .feature-tabs {
        padding: 0.25rem;
    }

    .feature-tab {
        min-width: 80px;
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .feature-tab i {
        font-size: 1rem;
    }

    .feature-tab span {
        display: none;
    }

    .pillars-chart {
        grid-template-columns: repeat(2, 1fr);
    }

    .elements-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .day-master-header {
        flex-direction: column;
        text-align: center;
    }

    .luck-pillar {
        min-width: 75px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.5rem 1rem;
    }

    .logo {
        height: 32px;
    }

    .site-title {
        display: none;
    }

    .pillars-chart {
        gap: 0.5rem;
        padding: 1rem;
    }

    .pillar-stem {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .pillar-branch {
        width: 55px;
        height: 55px;
        font-size: 1.1rem;
    }
}

/* Print Styles */
@media print {
    header, footer, .feature-tabs, .submit-btn, .toggle-btn {
        display: none;
    }

    .bazi-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* ============================================================================
   NAME ANALYSIS STYLES
   ============================================================================ */

.name-chars-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.name-char-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 2px solid var(--border);
    min-width: 80px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.name-char-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.name-char-item.wood {
    border-color: var(--wood);
    background: var(--wood-light);
}

.name-char-item.fire {
    border-color: var(--fire);
    background: var(--fire-light);
}

.name-char-item.earth {
    border-color: var(--earth);
    background: var(--earth-light);
}

.name-char-item.metal {
    border-color: var(--metal);
    background: var(--metal-light);
}

.name-char-item.water {
    border-color: var(--water);
    background: var(--water-light);
}

.name-char-item.unknown {
    border-color: var(--border);
    background: rgba(148, 163, 184, 0.1);
}

.name-char-item .char-display {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.name-char-item .char-element {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.name-char-item .char-radical {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Analysis List */
.name-analysis-list {
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.analysis-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border-left: 3px solid var(--border);
}

.analysis-item.excellent {
    border-left-color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.analysis-item.good {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.analysis-item.neutral {
    border-left-color: var(--text-muted);
    background: rgba(148, 163, 184, 0.1);
}

.analysis-item.bad {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.analysis-item.unknown {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.analysis-item .status-icon {
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

.analysis-item .analysis-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Summary Tags */
.name-summary {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.summary-tag {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.summary-tag.excellent {
    background: rgba(212, 175, 55, 0.2);
    color: #b8860b;
}

.summary-tag.good {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.summary-tag.neutral {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.summary-tag.bad {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.summary-tag.unknown {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* Name Header */
.name-header {
    text-align: center;
    margin-bottom: 1rem;
}

.name-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.name-score {
    display: inline-block;
    font-size: 2.5rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius);
    margin: 0.5rem 0;
}

.name-score.good {
    background: var(--success);
    color: white;
}

.name-score.neutral {
    background: var(--warning);
    color: white;
}

.name-score.bad {
    background: var(--danger);
    color: white;
}

.name-rating {
    font-size: 1rem;
    font-weight: 500;
}

.name-recommendation {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.name-recommendation i {
    margin-top: 2px;
}

/* ============================================================================
   COMPATIBILITY RESULTS STYLES
   ============================================================================ */

.compat-score {
    text-align: center;
    margin-bottom: 1.5rem;
}

.compat-score-value {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.compat-score-value.good {
    color: var(--success);
}

.compat-score-value.neutral {
    color: var(--warning);
}

.compat-score-value.bad {
    color: var(--danger);
}

.compat-score-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.compat-persons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.compat-person {
    text-align: center;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.person-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.person-info {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.compat-heart {
    font-size: 1.5rem;
    color: var(--crimson);
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

.compat-daymasters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.dm-person {
    text-align: center;
}

.dm-stem {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 0.5rem;
}

.dm-stem.wood { background: var(--wood-light); color: var(--wood); border: 2px solid var(--wood); }
.dm-stem.fire { background: var(--fire-light); color: var(--fire); border: 2px solid var(--fire); }
.dm-stem.earth { background: var(--earth-light); color: var(--earth); border: 2px solid var(--earth); }
.dm-stem.metal { background: var(--metal-light); color: var(--text); border: 2px solid var(--metal); }
.dm-stem.water { background: var(--water-light); color: var(--water); border: 2px solid var(--water); }

.dm-name {
    font-weight: 600;
    color: var(--text);
}

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

.dm-vs {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
}

.compat-description {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--primary-light);
    border-radius: var(--radius);
}

.compat-factors {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compat-factor {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border-left: 3px solid var(--border);
}

.compat-factor.good {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.compat-factor.bad {
    border-left-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.compat-factor.neutral {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.factor-icon {
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

.compat-factor.good .factor-icon { color: var(--success); }
.compat-factor.bad .factor-icon { color: var(--danger); }
.compat-factor.neutral .factor-icon { color: var(--warning); }

.factor-content {
    flex: 1;
}

.factor-aspect {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.factor-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.compat-advice {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.compat-advice h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--warning);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.compat-advice ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.compat-advice li {
    margin-bottom: 0.5rem;
}
