/* PrimeHour — Dark "Water" Mode, v2 (Dynamic edition) */

:root {
    --bg-0: #05080f;
    --bg-1: #0b1220;
    --bg-2: #121b2e;
    --bg-3: #192642;
    --border: #1e2a44;
    --text: #e4ecf7;
    --muted: #8ea0bd;
    --accent: #4aa8ff;
    --accent-glow: rgba(74, 168, 255, 0.25);
    --gold: #e8c46a;
    --error: #ff6b6b;

    --wood:  #4ade80;
    --fire:  #ff6b4a;
    --earth: #e8c46a;
    --metal: #c5cbd6;
    --water: #4aa8ff;

    --prime:   #ffd166;
    --zodiac:  #b18cff;
    --element: #4aa8ff;
    --neutral: #5a6780;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: radial-gradient(ellipse at top, #0d1830 0%, var(--bg-0) 60%) fixed;
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    line-height: 1.55;
    min-height: 100vh;
}

.container {
    max-width: 1320px; margin: 0 auto; padding: 48px 24px 80px;
    position: relative;  /* anchor for .contact-links */
}

/* ---------- Contact (top-right of the container) ---------- */
.contact-links {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    gap: 6px;
    z-index: 10;
}
.contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    text-decoration: none;
    transition: color 160ms ease, border-color 160ms ease,
                background 160ms ease;
}
.contact-link:hover {
    color: var(--accent);
    border-color: var(--border);
    background: rgba(11, 18, 32, 0.6);
}
.contact-link:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}
.contact-link svg { width: 20px; height: 20px; display: block; }

.support-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    color: var(--gold);
    background: rgba(232, 196, 106, 0.08);
    border: 1px solid rgba(232, 196, 106, 0.45);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 160ms ease, border-color 160ms ease,
                background 160ms ease, box-shadow 160ms ease;
}
.support-link:hover {
    color: #ffe4a0;
    border-color: var(--gold);
    background: rgba(232, 196, 106, 0.18);
    box-shadow: 0 0 0 3px rgba(232, 196, 106, 0.15);
}
.support-link:focus-visible {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(232, 196, 106, 0.30);
}

@media (max-width: 820px) {
    .contact-links {
        position: static;
        justify-content: center;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }
}

header { text-align: center; margin-bottom: 32px; }
header h1 {
    font-size: 2.6rem; margin: 0; letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle {
    color: var(--muted); margin: 6px 0 0;
    font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase;
}

.card {
    background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 26px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* ---------- 2-column layout: main content + events sidebar ---------- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}
.main-col { min-width: 0; }  /* lets long tables shrink inside the grid */
.side-col {
    position: sticky;
    top: 24px;
    /* Fill the viewport vertically so the events widget has room to
       show many items without internal scrolling. */
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
}
.side-col .card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;  /* allow children to shrink inside the flex column */
}

.widget-card { display: flex; flex-direction: column; }
.tv-widget-wrap {
    flex: 1;
    min-height: 560px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-0);
    border: 1px solid var(--border);
}
.tv-widget-wrap .tradingview-widget-container,
.tv-widget-wrap .tradingview-widget-container__widget {
    height: 100%; width: 100%;
}
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; }
    .side-col { position: static; height: auto; }
    .tv-widget-wrap { min-height: 520px; height: 520px; }
}

.card h2 { margin: 0 0 6px; font-size: 1.25rem; }
.card .explain { color: var(--muted); margin: 0 0 16px; font-style: italic; }

/* ---------- Form ---------- */
.dob-form { display: flex; flex-direction: column; gap: 14px; }
.form-grid {
    display: grid; grid-template-columns: 0.8fr 1.4fr 1fr; gap: 14px;
}
@media (max-width: 820px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .form-field:nth-child(3) { grid-column: 1 / -1; }
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.dob-form label {
    font-size: 0.85rem; color: var(--muted);
    letter-spacing: 0.05em; text-transform: uppercase;
}
.dob-form input[type="number"],
.dob-form input[type="date"],
.dob-form select {
    background: var(--bg-0); border: 1px solid var(--border);
    border-radius: 8px; padding: 12px 14px; color: var(--text);
    font-size: 1rem; color-scheme: dark;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
.dob-form select { appearance: none; cursor: pointer; }
.dob-form select optgroup { background: var(--bg-1); color: var(--gold); }
.dob-form select option { background: var(--bg-1); color: var(--text); }
.dob-form input[type="number"]:focus,
.dob-form input[type="date"]:focus,
.dob-form select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.checkbox-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
}
.checkbox-row input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--accent);
    width: 16px; height: 16px;
    cursor: pointer;
}
@media (max-width: 560px) {
    .form-grid { grid-template-columns: 1fr; }
}
.dob-form button {
    margin-top: 8px;
    background: linear-gradient(135deg, var(--accent), #2e7fd1);
    color: #fff; border: none; border-radius: 8px;
    padding: 14px 18px; font-size: 1rem; font-weight: 600;
    letter-spacing: 0.04em; cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.dob-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px var(--accent-glow);
}
.error { margin-top: 14px; color: var(--error); font-size: 0.92rem; }

/* ---------- Banner ---------- */
.banner .banner-row {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px;
}
.banner .label {
    font-size: 0.75rem; color: var(--muted);
    letter-spacing: 0.08em; text-transform: uppercase;
}
.banner .value { font-size: 1.25rem; font-weight: 600; margin: 2px 0 4px; }
.banner .nap-am { color: var(--gold); font-style: italic; font-size: 0.88rem; }
.muted { color: var(--muted); }
.glyph { font-size: 1.15em; margin-right: 4px; vertical-align: -0.05em; }

.element-wood  { color: var(--wood); }
.element-fire  { color: var(--fire); }
.element-earth { color: var(--earth); }
.element-metal { color: var(--metal); }
.element-water { color: var(--water); }

/* ---------- Block cards ---------- */
.block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.block-card {
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-left: 4px solid var(--neutral);
    border-radius: 10px;
    padding: 14px 16px;
}
.block-card.tier-prime   { border-left-color: var(--prime);
    box-shadow: 0 0 0 1px rgba(255,209,102,0.15),
                0 8px 28px rgba(255,209,102,0.08); }
.block-card.tier-zodiac  { border-left-color: var(--zodiac); }
.block-card.tier-element { border-left-color: var(--element); }

.block-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.branch-name { font-weight: 600; font-size: 1.05rem; }
.block-times { font-size: 0.95rem; line-height: 1.5; margin-bottom: 10px; }
.tz-label {
    display: inline-block; width: 26px; font-size: 0.72rem;
    font-weight: 700; color: var(--muted); letter-spacing: 0.05em;
}
.tz-label.et { color: var(--gold); }
.block-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
    background: var(--bg-3); border: 1px solid var(--border);
}
.chip-zodiac  { color: var(--zodiac); border-color: rgba(177,140,255,0.3); }
.chip-nourish { color: var(--water);  border-color: rgba(74,168,255,0.3); }
.chip-same    { color: var(--gold);   border-color: rgba(232,196,106,0.3); }

.chip-session               { color: var(--muted); }
.chip-session.session-regular-rth { color: #4ade80; border-color: rgba(74,222,128,0.3); }
.chip-session.session-pre-market  { color: #8ea0bd; }
.chip-session.session-after-hours { color: #e8c46a; }
.chip-session.session-closed      { color: #5a6780; }
.chip-session.session-weekend     { color: #5a6780; }

/* ---------- Tier pill ---------- */
.tier-pill {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
}
.tier-pill-prime   { background: rgba(255,209,102,0.15); color: var(--prime); }
.tier-pill-zodiac  { background: rgba(177,140,255,0.15); color: var(--zodiac); }
.tier-pill-element { background: rgba(74,168,255,0.15);  color: var(--element); }
.tier-pill-neutral { background: rgba(90,103,128,0.15);  color: var(--neutral); }

/* ---------- Timeline table ---------- */
.timeline {
    width: 100%; border-collapse: collapse; font-size: 0.92rem;
}
.timeline th, .timeline td {
    text-align: left; padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.timeline th {
    font-size: 0.75rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    background: var(--bg-0);
}
.timeline tr.tier-prime   { background: rgba(255,209,102,0.06); }
.timeline tr.tier-zodiac  { background: rgba(177,140,255,0.04); }
.timeline tr.tier-element { background: rgba(74,168,255,0.04); }

/* ---------- Disclaimer ---------- */
.disclaimer {
    margin-top: 40px; padding: 18px 22px;
    border-left: 3px solid var(--gold);
    background: rgba(232, 196, 106, 0.06);
    color: var(--muted); font-size: 0.88rem; border-radius: 6px;
}
.disclaimer strong { color: var(--gold); }

@media (max-width: 720px) {
    .banner .banner-row { grid-template-columns: 1fr; }
    .timeline { font-size: 0.82rem; }
    .timeline th, .timeline td { padding: 8px 6px; }
    header h1 { font-size: 2rem; }
    .container { padding: 28px 16px 60px; }
    .card { padding: 20px; }
}
