/* ============================================ */
/* Destiny Vector - Chart Dashboard Styles      */
/* Three-Column Layout + Component Styling      */
/* ============================================ */

/* ============================================ */
/* CSS Variables                                */
/* ============================================ */

:root {
    --bg-deep: #0F172A;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-solid: #1E293B;
    --accent-gold: #F59E0B;
    --accent-purple: #8B5CF6;
    --vector-lu: #10B981;
    --vector-quan: #EF4444;
    --vector-ke: #3B82F6;
    --vector-ji: #F59E0B;
    --text-main: #E2E8F0;
    --text-dim: #94A3B8;
    --border-dim: rgba(148, 163, 184, 0.2);
}

/* ============================================ */
/* Full Report Button                           */
/* ============================================ */

.full-report-btn {
    overflow: hidden;
    animation: btn-glow 3s ease-in-out infinite;
}

@keyframes btn-glow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
    }

    50% {
        box-shadow: 0 4px 25px rgba(139, 92, 246, 0.45), 0 0 40px rgba(139, 92, 246, 0.15);
    }
}

.full-report-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
            transparent 30%,
            rgba(255, 255, 255, 0.12) 45%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.12) 55%,
            transparent 70%);
    background-size: 250% 100%;
    animation: shimmer-sweep 4s ease-in-out infinite;
    pointer-events: none;
    border-radius: inherit;
}

@keyframes shimmer-sweep {
    0% {
        background-position: 200% 0;
    }

    50% {
        background-position: -50% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ============================================ */
/* Three-Column Grid Layout                     */
/* ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 260px 1fr 380px;
    grid-template-rows: 1fr;
    height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-purple) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

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

/* Insight Panel */
.insight-panel {
    scrollbar-width: thin;
    scrollbar-color: var(--text-dim) transparent;
}

.insight-panel::-webkit-scrollbar {
    width: 4px;
}

.insight-panel::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border-radius: 2px;
}

/* ============================================ */
/* Glass Card Base                              */
/* ============================================ */

.glass-card {
    background: var(--bg-card);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-dim);
}

/* ============================================ */
/* Language Switcher                            */
/* ============================================ */

.lang-btn {
    color: var(--text-dim);
    background: transparent;
    transition: all 0.2s;
}

.lang-btn:hover {
    color: var(--text-main);
}

.lang-btn.active {
    background: var(--accent-purple);
    color: white;
    font-weight: 500;
}

/* ============================================ */
/* Natal Card                                   */
/* ============================================ */

.natal-card.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.05));
}

.natal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
}

/* Slow spin animation for Yin-Yang */
@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

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

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

/* ============================================ */
/* Decade Timeline                              */
/* ============================================ */

.decade-item {
    transition: all 0.2s ease;
}

.decade-item:hover {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-left: -8px;
    padding-left: 8px;
}

.decade-indicator {
    transition: all 0.3s ease;
}

/* ============================================ */
/* Tech Grid Background                         */
/* ============================================ */

.tech-grid {
    background-image:
        linear-gradient(to right, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}

/* ============================================ */
/* 12 Palace Grid                               */
/* ============================================ */

.palace-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 140px));
    grid-template-rows: repeat(4, minmax(100px, 140px));
    gap: 4px;
    max-width: 600px;
}

.palace-card {
    position: relative;
    aspect-ratio: 1;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --bracket-color: rgba(148, 163, 184, 0.4);
    --bracket-size: 8px;
}

/* Corner Brackets */
.palace-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    pointer-events: none;
    transition: all 0.3s ease;
    background:
        linear-gradient(to right, var(--bracket-color), var(--bracket-color)) top left / var(--bracket-size) 1px no-repeat,
        linear-gradient(to bottom, var(--bracket-color), var(--bracket-color)) top left / 1px var(--bracket-size) no-repeat,
        linear-gradient(to left, var(--bracket-color), var(--bracket-color)) bottom right / var(--bracket-size) 1px no-repeat,
        linear-gradient(to top, var(--bracket-color), var(--bracket-color)) bottom right / 1px var(--bracket-size) no-repeat;
}

.palace-card:hover {
    transform: scale(1.05);
    z-index: 100;
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15), inset 0 0 20px rgba(139, 92, 246, 0.05);
    --bracket-color: var(--accent-purple);
    --bracket-size: 14px;
}

.palace-card.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.2), inset 0 0 20px rgba(245, 158, 11, 0.1);
    --bracket-color: var(--accent-gold);
}

.palace-card.related {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    --bracket-color: rgba(255, 255, 255, 0.8);
}

.palace-card.dimmed {
    opacity: 0.3;
    pointer-events: none;
}

/* Palace Card Content */
.palace-name {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    color: var(--text-dim);
    font-family: 'Noto Serif SC', serif;
}

.palace-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-family: 'Noto Serif SC', serif;
    color: var(--text-main);
}

.palace-star {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Five Element Colors */
.star-metal {
    color: #E2E8F0;
}

/* White/Silver */
.star-wood {
    color: #10B981;
}

/* Green */
.star-water {
    color: #60A5FA;
}

/* Blue */
.star-fire {
    color: #F87171;
}

/* Red */
.star-earth {
    color: #FBBF24;
}

/* Yellow */

.palace-stem {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 10px;
    color: var(--accent-purple);
    font-family: 'JetBrains Mono', monospace;
}

/* Center Info Box */
.center-info-box {
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15), transparent 70%);
}

/* ============================================ */
/* SVG Vector Layer                             */
/* ============================================ */

.vector-layer {
    pointer-events: none;
}

.vector-line {
    fill: none;
    stroke-linecap: round;
    transition: opacity 0.3s ease, filter 0.3s ease;
    filter: url(#neon-glow);
}

.vector-line.lu {
    stroke: var(--vector-lu);
    stroke-width: 2.5px;
    stroke-dasharray: 10 5;
    animation: flow-lu 1.5s linear infinite;
}

.vector-line.quan {
    stroke: var(--vector-quan);
    stroke-width: 3px;
    stroke-dasharray: 16 4;
    animation: flow-quan 2s linear infinite;
}

.vector-line.ke {
    stroke: var(--vector-ke);
    stroke-width: 2px;
    stroke-dasharray: 6 6;
    animation: flow-ke 2.5s linear infinite;
}

.vector-line.ji {
    stroke: var(--vector-ji);
    stroke-width: 2px;
    stroke-dasharray: 3 3;
    animation: flow-ji 1.2s linear infinite;
}

.vector-line.dimmed {
    opacity: 0.1;
    filter: none;
}

.vector-line.highlighted {
    opacity: 1;
    stroke-width: 3px;
    filter: url(#neon-glow-strong);
}

/* Continuous flow animations per vector type */
@keyframes flow-lu {
    from {
        stroke-dashoffset: 30;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes flow-quan {
    from {
        stroke-dashoffset: 40;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes flow-ke {
    from {
        stroke-dashoffset: 24;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes flow-ji {
    from {
        stroke-dashoffset: 12;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================ */
/* Accordion Cards                              */
/* ============================================ */

.insight-card {
    transition: all 0.3s ease;
}

.insight-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.accordion-header {
    transition: background 0.2s ease;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.insight-card.expanded .accordion-content {
    max-height: 500px;
}

.insight-card.expanded .accordion-icon {
    transform: rotate(180deg);
}

/* Mini Chart Bars */
.mini-chart .bar {
    border-radius: 2px 2px 0 0;
    transition: height 0.3s ease;
}

/* Vector Reference Link */
.vector-ref:hover {
    text-decoration: underline;
}

/* ============================================ */
/* Risk Radar                                   */
/* ============================================ */

.risk-radar {
    position: sticky;
    bottom: 0;
}

/* ============================================ */
/* Mobile Drawer                                */
/* ============================================ */

.mobile-drawer {
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-drawer.open {
    transform: translateY(0);
}

.drawer-handle {
    cursor: grab;
}

/* ============================================ */
/* Responsive Breakpoints                       */
/* ============================================ */

/* Tablet: Hide sidebar, 2-column layout */
@media (max-width: 1279px) {
    .dashboard-grid {
        grid-template-columns: 1fr 340px;
    }

    .sidebar {
        display: none;
    }

    .palace-grid {
        grid-template-columns: repeat(4, minmax(80px, 120px));
        grid-template-rows: repeat(4, minmax(80px, 120px));
    }
}

/* Mobile: Single column stack */
@media (max-width: 767px) {

    /* ---- Header Space Optimization ---- */
    #user-name,
    #solar-time-badge {
        display: none;
    }

    .user-meta-capsule {
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }

    .dashboard-grid {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 60px);
    }

    .sidebar {
        display: none;
    }

    .center-stage {
        min-height: auto;
        order: 1;
        padding: 8px;
    }

    .insight-panel {
        order: 2;
        border-left: none;
        border-top: 1px solid var(--border-dim);
        padding: 12px;
    }

    .palace-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 2px;
        max-width: 100%;
        padding: 4px;
    }

    .palace-card {
        padding: 3px;
        min-width: auto;
        aspect-ratio: auto;
        min-height: 70px;
    }

    .palace-card:hover {
        transform: none;
    }

    .palace-title {
        font-size: 9px;
    }

    .palace-star {
        font-size: 10px;
    }

    .palace-stem {
        font-size: 8px;
    }

    /* Center info box scaling */
    .center-info-box {
        padding: 8px;
    }

    .center-info-box .reactor-ring {
        display: none;
    }

    .center-info-box .current-time {
        font-size: 1rem;
    }

    /* Chart header bar */
    .chart-header {
        padding: 8px 12px;
    }

    .chart-header h1 {
        font-size: 1rem;
    }

    /* Insight panel readability */
    .insight-panel h3 {
        font-size: 0.95rem;
    }

    .insight-panel p,
    .insight-panel .text-sm {
        font-size: 0.8rem;
        line-height: 1.6;
    }

    /* ---- Mobile Tab Bar ---- */
    .mobile-tab-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        display: flex;
        align-items: stretch;
        height: 56px;
        background: rgba(15, 23, 42, 0.92);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border-dim);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .mobile-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border: none;
        background: none;
        color: var(--text-dim);
        font-size: 10px;
        font-family: inherit;
        cursor: pointer;
        transition: color 0.2s, background 0.2s;
        position: relative;
        padding: 6px 0;
    }

    .mobile-tab.active {
        color: var(--accent-gold);
    }

    .mobile-tab.active::after {
        content: '';
        position: absolute;
        top: 0;
        left: 25%;
        right: 25%;
        height: 2px;
        background: var(--accent-gold);
        border-radius: 0 0 2px 2px;
    }

    .mobile-tab svg {
        width: 22px;
        height: 22px;
    }

    /* ---- Panel Switching ---- */
    #dashboard {
        padding-bottom: 56px;
    }

    .dashboard-grid {
        height: calc(100vh - 60px - 56px) !important;
        min-height: auto !important;
    }

    .mobile-panel-hidden {
        display: none !important;
    }

    /* Sidebar reveal on mobile */
    .sidebar {
        display: none;
    }

    .sidebar.mobile-panel-visible {
        display: block !important;
        order: 0;
        height: 100%;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-dim);
    }

    .center-stage {
        min-height: auto;
        height: 100%;
        order: 1;
    }

    .insight-panel {
        order: 2;
        height: 100%;
        overflow-y: auto;
        border-left: none;
        border-top: none;
    }
}

/* ============================================ */
/* Tooltip                                      */
/* ============================================ */

.tooltip {
    position: absolute;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-main);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.2s ease;
    z-index: 1000;
    white-space: nowrap;
}

.tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================ */
/* Focus Highlight Effect                       */
/* ============================================ */

.focus-mode .palace-card:not(.focused):not(.related) {
    opacity: 0.3;
}

.focus-mode .vector-line:not(.focused) {
    opacity: 0.1;
}

/* ============================================ */
/* Palace Hover Hint                            */
/* ============================================ */

.palace-card {
    position: relative;
}

.palace-card::after {
    content: attr(data-hint);
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) translateY(2px);
    font-size: 9px;
    color: var(--accent-purple);
    opacity: 0;
    transition: all 0.2s ease;
    white-space: nowrap;
    pointer-events: none;
}

.palace-card:hover::after {
    opacity: 0.8;
    transform: translateX(-50%) translateY(0);
}

/* ============================================ */
/* Palace Detail Overlay                        */
/* ============================================ */

.palace-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.palace-detail-overlay.hidden {
    display: none;
}

.palace-detail-card {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--border-dim);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

.palace-detail-card .detail-section {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-dim);
}

.palace-detail-card .detail-section:last-child {
    border-bottom: none;
}

.palace-detail-card .detail-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.palace-detail-card .detail-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-main);
}

.palace-detail-card .tag-positive {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--vector-lu);
    margin: 2px 4px 2px 0;
}

.palace-detail-card .tag-negative {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--vector-quan);
    margin: 2px 4px 2px 0;
}

/* ============================================ */
/* Full Report Modal                            */
/* ============================================ */

.full-report-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: var(--bg-deep);
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

.full-report-modal.hidden {
    display: none;
}

.full-report-container {
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-purple) transparent;
}

.full-report-container::-webkit-scrollbar {
    width: 6px;
}

.full-report-container::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 3px;
}

/* Markdown Prose Styling */
.prose-container {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.8;
}

.prose-container h1 {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent-gold);
    margin: 2em 0 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--border-dim);
}

.prose-container h1:first-child {
    margin-top: 0;
}

.prose-container h2 {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--accent-purple);
    margin: 1.6em 0 0.6em;
}

.prose-container h3 {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-main);
    margin: 1.2em 0 0.4em;
}

.prose-container h4 {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-main);
    margin: 1em 0 0.3em;
}

.prose-container h5 {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-dim);
    margin: 0.8em 0 0.3em;
}

.prose-container p {
    margin: 0.6em 0;
}

.prose-container ul,
.prose-container ol {
    margin: 0.6em 0;
    padding-left: 1.5em;
}

.prose-container ul {
    list-style-type: disc;
}

.prose-container ol {
    list-style-type: decimal;
}

.prose-container li {
    margin: 0.3em 0;
}

.prose-container strong {
    color: var(--accent-gold);
    font-weight: 600;
}

.prose-container blockquote {
    border-left: 3px solid var(--accent-purple);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-dim);
    font-style: italic;
}

.prose-container hr {
    border: none;
    border-top: 1px solid var(--border-dim);
    margin: 2em 0;
}

/* ============================================ */
/* AI Loading Skeleton                          */
/* ============================================ */

.ai-loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg,
            rgba(148, 163, 184, 0.08) 25%,
            rgba(148, 163, 184, 0.15) 50%,
            rgba(148, 163, 184, 0.08) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

/* AI Loading State for Insight Panel */
.insight-panel.ai-loading .energy-weather,
.insight-panel.ai-loading .insight-card,
.insight-panel.ai-loading .risk-radar {
    opacity: 0.5;
    pointer-events: none;
}

/* Score Ring Animation */
.score-ring svg circle:last-child {
    transition: stroke-dasharray 0.8s ease;
}

/* ============================================ */
/* Decade Insight View                          */
/* ============================================ */

/* Keyword Badge */
.decade-keyword-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(245, 158, 11, 0.2));
    color: var(--accent-gold);
    border: 1px solid rgba(139, 92, 246, 0.3);
    letter-spacing: 0.05em;
    animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.2);
    }

    50% {
        box-shadow: 0 0 8px 2px rgba(139, 92, 246, 0.15);
    }
}

/* Turning Points Timeline */
.turning-points-timeline {
    position: relative;
    padding-left: 24px;
}

.turning-points-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-purple), rgba(139, 92, 246, 0.2));
    border-radius: 1px;
}

.turning-point-item {
    position: relative;
    padding: 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeSlideIn 0.4s ease backwards;
}

.turning-point-item:nth-child(1) {
    animation-delay: 0.1s;
}

.turning-point-item:nth-child(2) {
    animation-delay: 0.2s;
}

.turning-point-item:nth-child(3) {
    animation-delay: 0.3s;
}

.turning-point-item:nth-child(4) {
    animation-delay: 0.4s;
}

.turning-point-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-purple);
    border: 2px solid var(--bg-deep);
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
    z-index: 1;
}

.turning-point-age {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-purple);
    min-width: 36px;
    flex-shrink: 0;
}

.turning-point-text {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.5;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

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

/* Annual Fortune Tag on Sidebar */
.fortune-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    animation: fadeIn 0.3s ease;
}

.fortune-tag.fortune-good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--vector-lu);
}

.fortune-tag.fortune-neutral {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
}

.fortune-tag.fortune-bad {
    background: rgba(239, 68, 68, 0.15);
    color: var(--vector-quan);
}

/* Decade Fortune Tag on Sidebar */
.decade-fortune-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
    animation: fadeIn 0.3s ease;
}

.decade-fortune-tag.fortune-good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--vector-lu);
}

.decade-fortune-tag.fortune-neutral {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
}

.decade-fortune-tag.fortune-bad {
    background: rgba(239, 68, 68, 0.15);
    color: var(--vector-quan);
}

/* Decade View Transition */
#decade-insight-view,
#year-insight-view,
#natal-insight-view {
    transition: opacity 0.25s ease;
}

#decade-insight-view.hidden,
#year-insight-view.hidden,
#natal-insight-view.hidden {
    display: none;
}

/* ============================================ */
/* Natal Insight View                           */
/* ============================================ */

/* Natal Keyword Badge */
.natal-keyword-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.15));
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
    letter-spacing: 0.05em;
    animation: natalBadgePulse 2.5s ease infinite;
}

@keyframes natalBadgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2);
    }

    50% {
        box-shadow: 0 0 10px 3px rgba(245, 158, 11, 0.15);
    }
}

/* Personality Trait Tags */
.natal-tag-positive {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--vector-lu);
    animation: fadeIn 0.3s ease backwards;
}

.natal-tag-negative {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--vector-quan);
    animation: fadeIn 0.3s ease backwards;
}

/* Life Stages Timeline */
.life-stages-timeline {
    position: relative;
    padding-left: 24px;
}

.life-stages-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-gold), rgba(245, 158, 11, 0.2));
    border-radius: 1px;
}

.life-stage-item {
    position: relative;
    padding: 8px 0;
    animation: fadeSlideIn 0.4s ease backwards;
}

.life-stage-item:nth-child(1) {
    animation-delay: 0.1s;
}

.life-stage-item:nth-child(2) {
    animation-delay: 0.2s;
}

.life-stage-item:nth-child(3) {
    animation-delay: 0.3s;
}

.life-stage-item:nth-child(4) {
    animation-delay: 0.4s;
}

.life-stage-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 2px solid var(--bg-deep);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
    z-index: 1;
}

.life-stage-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-gold);
}

.life-stage-text {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-top: 2px;
}


/* ============================================ */
/* Print Styles (Export PDF)                    */
/* ============================================ */

@media print {

    /* Reset body and html for printing */
    html,
    body {
        height: auto !important;
        min-height: 100% !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }

    /* Hide everything by default */
    body>*:not(#full-report-modal) {
        display: none !important;
    }

    /* Show only the full report modal content */
    #full-report-modal {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        background: white !important;
        color: black !important;
        z-index: 9999 !important;
        overflow: visible !important;
    }

    #full-report-modal .full-report-container {
        position: relative !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        overflow: visible !important;
    }

    #full-report-modal .full-report-header {
        position: static !important;
        background: white !important;
        border-bottom: 2px solid #ccc !important;
        color: black !important;
        padding: 20px !important;
    }

    #full-report-modal .full-report-header h2 {
        color: black !important;
        font-size: 24pt !important;
    }

    /* Hide buttons in modal header */
    #full-report-modal button {
        display: none !important;
    }

    #full-report-body {
        padding: 20px 40px !important;
        color: black !important;
        overflow: visible !important;
    }

    /* Typography adjustments for print */
    .prose-container {
        width: 100% !important;
        max-width: none !important;
        font-size: 12pt !important;
        line-height: 1.6 !important;
    }

    .prose-container h1,
    .prose-container h2,
    .prose-container h3 {
        color: black !important;
        page-break-after: avoid;
        break-after: avoid;
    }

    .prose-container p,
    .prose-container li {
        color: #000 !important;
    }

    .prose-container blockquote {
        border-left-color: #ccc !important;
        color: #444 !important;
    }

    /* Avoid breaking inside elements */
    p,
    blockquote,
    ul,
    ol {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* Hide browser headers/footers */
@page {
    margin: 0;
    size: auto;
}

/* ============================================ */
/* Energy Radar Chart                           */
/* ============================================ */

.energy-radar-svg {
    display: block;
    margin: 0 auto;
}

.energy-radar-polygon {
    transition: points 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.radar-dot {
    transition: opacity 0.4s ease, r 0.3s ease;
    filter: drop-shadow(0 0 4px currentColor);
}

.radar-dot:hover {
    r: 5;
    filter: drop-shadow(0 0 8px currentColor);
}

.radar-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
    margin-top: 8px;
}

.radar-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-dim);
}

.radar-legend-item b {
    color: var(--text-main);
    font-weight: 600;
}

.radar-legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .energy-radar-svg {
        width: 160px;
        height: 160px;
    }

    .radar-legend {
        gap: 4px 8px;
    }

    .radar-legend-item {
        font-size: 10px;
    }
}