/* =====================================================
   AstroOracle Matrix — Chart Specific Styles
   BaZi, ZiWei, I Ching display styles
   ===================================================== */

/* =========================
   八字 BaZi Styles
   ========================= */
.bazi-chart {
    max-width: 700px;
    margin: 0 auto 1.5rem;
}

.bazi-pillars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    text-align: center;
}

.bazi-pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem 0.5rem;
    border-radius: var(--radius-md);
    background: rgba(13, 5, 32, 0.5);
    border: 1px solid rgba(167, 139, 250, 0.12);
    transition: all 0.3s var(--ease);
}

.bazi-pillar:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.1);
}

.pillar-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.pillar-god {
    font-size: 0.7rem;
    color: var(--crystal-purple);
    font-weight: 500;
    padding: 1px 8px;
    background: rgba(167, 139, 250, 0.08);
    border-radius: 4px;
}

.pillar-stem,
.pillar-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.pillar-stem .char,
.pillar-branch .char {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 900;
    text-shadow: 0 0 12px currentColor;
}

.element-tag {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
}

/* Five elements analysis */
.bazi-analysis {
    max-width: 700px;
    margin: 0 auto;
}

.radar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.radar-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.bar-label {
    width: 24px;
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
}

.bar-track {
    flex: 1;
    height: 20px;
    background: rgba(13, 5, 32, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(167, 139, 250, 0.08);
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.bar-fill.favorable {
    box-shadow: 0 0 12px currentColor;
}

.bar-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
}

.analysis-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem;
    background: rgba(13, 5, 32, 0.4);
    border-radius: var(--radius-sm);
}

.summary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.summary-value {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.summary-value.favorable {
    text-shadow: 0 0 8px currentColor;
}

/* =========================
   易經 I Ching Styles
   ========================= */
.hex-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.hex-main,
.hex-changed {
    text-align: center;
}

.hex-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.hex-pinyin {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.hex-arrow {
    font-size: 2rem;
    color: var(--crystal-purple);
    animation: float 2s ease-in-out infinite;
}

.hex-lines {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.8rem;
}

.yao-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 120px;
    justify-content: center;
}

.line-solid {
    width: 80px;
    height: 8px;
    background: var(--gold);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.line-broken {
    width: 80px;
    height: 8px;
    display: flex;
    gap: 8px;
}

.line-broken span {
    display: none;
}

.line-broken::before,
.line-broken::after {
    content: '';
    flex: 1;
    height: 8px;
    background: var(--star-blue);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.yao-line.changing .line-solid {
    background: var(--cosmic-pink);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.yao-line.changing .line-broken::before,
.yao-line.changing .line-broken::after {
    background: var(--cosmic-pink);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.change-dot {
    font-size: 0.6rem;
    color: var(--cosmic-pink);
}

.yao-num {
    font-size: 0.6rem;
    color: var(--text-muted);
    width: 12px;
}

.hex-trigrams {
    display: flex;
    gap: 1rem;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.hex-reading {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hex-section {
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(13, 5, 32, 0.4);
}

.hex-section h4 {
    color: var(--gold);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.hex-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* =========================
   紫微斗數 Zi Wei Styles
   ========================= */
.ziwei-chart-area {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

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

    .analysis-summary {
        grid-template-columns: 1fr;
    }

    .hex-display {
        flex-direction: column;
    }
}
