/* NewZET — Vaporwave Aesthetic */

:root {
    --bg-primary: #0d0221;
    --bg-secondary: #1a1a3e;
    --bg-card: #1e1e4a;
    --text-primary: #e0d6ff;
    --text-secondary: #8b7fc7;
    --accent-pink: #ff6b9d;
    --accent-cyan: #4ecdc4;
    --accent-purple: #c39bd3;
    --glow: #ff6b9d;
    --border: #2d2b55;
    --input-bg: #12122a;
}

/* Day mode — warm cacao/milk tones */
[data-theme="day"] {
    --bg-primary: #f5ebe0;
    --bg-secondary: #ede0d4;
    --bg-card: #e6ccb2;
    --text-primary: #3c2415;
    --text-secondary: #7f5539;
    --accent-pink: #b5446e;
    --accent-cyan: #2a7a6f;
    --accent-purple: #7b4f8a;
    --glow: #b5446e;
    --border: #c9a98c;
    --input-bg: #faf3ed;
}

/* Day mode — element row colors */
[data-theme="day"] .element-fire td:first-child { color: #b5446e; }
[data-theme="day"] .element-earth td:first-child { color: #2a7a6f; }
[data-theme="day"] .element-air td:first-child { color: #7b4f8a; }
[data-theme="day"] .element-water td:first-child { color: #3a5ba0; }

[data-theme="day"] .element-fire { border-left-color: rgba(181, 68, 110, 0.5); }
[data-theme="day"] .element-earth { border-left-color: rgba(42, 122, 111, 0.5); }
[data-theme="day"] .element-air { border-left-color: rgba(123, 79, 138, 0.5); }
[data-theme="day"] .element-water { border-left-color: rgba(58, 91, 160, 0.5); }

/* Day mode — dignity badges */
[data-theme="day"] .dignity-domicile {
    background: rgba(42, 122, 111, 0.15);
    color: #1e6358;
    border-color: rgba(42, 122, 111, 0.4);
}
[data-theme="day"] .dignity-exaltation {
    background: rgba(180, 130, 20, 0.12);
    color: #8a6d10;
    border-color: rgba(180, 130, 20, 0.4);
}
[data-theme="day"] .dignity-detriment {
    background: rgba(181, 68, 110, 0.12);
    color: #8a2e50;
    border-color: rgba(181, 68, 110, 0.3);
}
[data-theme="day"] .dignity-fall {
    background: rgba(180, 50, 50, 0.12);
    color: #8a2020;
    border-color: rgba(180, 50, 50, 0.3);
}

/* Day mode — aspect colors */
[data-theme="day"] .aspect-conjunction { color: #8a6d10; }
[data-theme="day"] .aspect-opposition { color: #b5446e; }
[data-theme="day"] .aspect-trine { color: #1e6358; }
[data-theme="day"] .aspect-square { color: #a03030; }
[data-theme="day"] .aspect-sextile { color: #3a7a3a; }
[data-theme="day"] .aspect-quincunx { color: #5a4a8a; }

/* Day mode — tooltip */
[data-theme="day"] #chart-tooltip {
    background: #faf3edee;
    border-color: var(--border);
    box-shadow: 0 4px 20px rgba(60, 36, 21, 0.15);
}

/* Day mode — theme toggle icon */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.theme-toggle:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--accent-pink);
    text-decoration: none;
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.5);
}

.site-header nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.site-header nav a:hover,
.site-header nav a.active {
    color: var(--accent-cyan);
    background: rgba(78, 205, 196, 0.1);
}

/* ===== Burger menu (EVO-5a) ===== */
.burger-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    margin-left: 1rem;
}

.burger-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.burger-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 3000;
    padding: 1.2rem;
    transition: right 0.25s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

.burger-panel.open {
    right: 0;
}

.burger-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.burger-close:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.burger-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 2, 33, 0.6);
    z-index: 2999;
}

.burger-backdrop.open {
    display: block;
}

/* Profile card inside burger */
.bp-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-pink);
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
}

.bp-line {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.bp-item {
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
}

/* ===== Print settings bar (EVO-7) ===== */
.print-settings {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.print-settings-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.print-check {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
}

.print-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-cyan);
    cursor: pointer;
}

/* Main content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Form */
.form-container {
    max-width: 560px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--accent-pink);
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
}

.chart-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

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

.form-row {
    display: flex;
    gap: 1rem;
}

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input, select {
    padding: 0.7rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(78, 205, 196, 0.2);
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Advanced options */
.advanced-options {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem 1rem;
}

.advanced-options summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-cyan);
}

/* Submit button */
.submit-btn {
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin-top: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
}

/* Error message */
.error-message {
    background: rgba(255, 107, 157, 0.15);
    border: 1px solid var(--accent-pink);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    color: var(--accent-pink);
    font-size: 0.9rem;
}

/* Chart display */
.chart-container {
    max-width: 1200px;
    margin: 0 auto;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-title {
    font-size: 1.5rem;
    color: var(--accent-pink);
}

.chart-actions {
    display: flex;
    gap: 0.8rem;
}

.print-btn, .back-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.print-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.print-btn:hover {
    border-color: var(--accent-cyan);
}

.back-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.back-btn:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* ===== Two-column layout ===== */
.chart-layout {
    display: grid;
    grid-template-columns: minmax(400px, 1fr) minmax(280px, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: start;
}

.chart-bottom {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: start;
}

.chart-bottom-right {
    min-width: 0;
}

/* Chart sections */
.chart-wheel {
    text-align: center;
    position: relative;
}

.chart-wheel svg {
    max-width: 100%;
    height: auto;
    cursor: pointer;
}

.zoom-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.zoom-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

section h2 {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* Planet table */
.planet-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.planet-table th {
    text-align: left;
    padding: 0.5rem 0.8rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.planet-table td {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(45, 43, 85, 0.5);
}

.planet-table tr:hover {
    background: rgba(78, 205, 196, 0.05);
}

/* Element-colored planet rows */
.element-fire td:first-child { color: #ff6b9d; }
.element-earth td:first-child { color: #4ecdc4; }
.element-air td:first-child { color: #c39bd3; }
.element-water td:first-child { color: #6c5ce7; }

.element-fire { border-left: 3px solid rgba(255, 107, 157, 0.4); }
.element-earth { border-left: 3px solid rgba(78, 205, 196, 0.4); }
.element-air { border-left: 3px solid rgba(195, 155, 211, 0.4); }
.element-water { border-left: 3px solid rgba(108, 92, 231, 0.4); }

/* Dignity badges */
.dignity-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.3rem;
}

.dignity-domicile {
    background: rgba(78, 205, 196, 0.2);
    color: #4ecdc4;
    border: 1px solid rgba(78, 205, 196, 0.4);
}

.dignity-exaltation {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.4);
}

.dignity-detriment {
    background: rgba(255, 107, 157, 0.15);
    color: #ff6b9d;
    border: 1px solid rgba(255, 107, 157, 0.3);
}

.dignity-fall {
    background: rgba(255, 71, 87, 0.15);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

/* Retrograde badge */
.retro-badge {
    color: #a29bfe;
    font-size: 0.8rem;
    margin-left: 0.2rem;
}

/* Aspect list (readable) */
.aspect-list {
    margin-bottom: 2rem;
}

.aspect-list-major,
.aspect-list-minor {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.aspect-list-minor {
    opacity: 0.7;
}

.aspect-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(45, 43, 85, 0.3);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.aspect-item:hover {
    background: rgba(78, 205, 196, 0.05);
}

.aspect-planets {
    min-width: 180px;
    color: var(--text-primary);
}

.aspect-type {
    font-weight: 600;
    min-width: 120px;
}

.aspect-conjunction { color: #ffd700; }
.aspect-opposition { color: #ff6b9d; }
.aspect-trine { color: #00f5d4; }
.aspect-square { color: #ff4757; }
.aspect-sextile { color: #7bed9f; }
.aspect-quincunx { color: #a29bfe; }
.aspect-semisextile { color: #636e72; }
.aspect-semisquare { color: #e17055; }
.aspect-sesquiquadrate { color: #e17055; }

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

.strength-exact { opacity: 1; }
.strength-tight { opacity: 0.85; }
.strength-wide { opacity: 0.6; }

/* Aspect grid */
.aspect-grid {
    margin-bottom: 2rem;
    overflow-x: auto;
}

.aspect-grid svg {
    max-width: 100%;
    height: auto;
}

/* Patterns */
.pattern-list {
    list-style: none;
    padding: 0;
}

.pattern-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(45, 43, 85, 0.3);
}

.no-patterns {
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== Element/Modality Balance (EVO-5) ===== */
.balance-section {
    display: flex;
    gap: 1.5rem;
}

.balance-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.balance-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.balance-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 5.5rem;
    text-align: right;
}

.balance-bar {
    flex: 1;
    height: 14px;
    background: var(--input-bg);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.balance-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.balance-count {
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 1.2rem;
    text-align: center;
    font-weight: 600;
}

/* House table */
.house-table {
    width: 100%;
    border-collapse: collapse;
}

.house-table td {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(45, 43, 85, 0.5);
}

.house-table td:first-child {
    color: var(--accent-cyan);
    font-weight: 600;
    width: 2.5rem;
}

/* ===== Zoom overlay (EVO-4) ===== */
.zoom-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 2, 33, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.zoom-overlay.active {
    display: flex;
}

.zoom-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 2001;
    transition: all 0.2s;
}

.zoom-close:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

.zoom-content {
    max-width: 95vmin;
    max-height: 95vmin;
}

.zoom-content svg {
    width: 100%;
    height: 100%;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* ===== Tooltip (EVO-3) ===== */
#chart-tooltip {
    position: fixed;
    display: none;
    background: #1a1a3eee;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    max-width: 300px;
    z-index: 1000;
    pointer-events: none;
    font-size: 0.85rem;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#chart-tooltip > * {
    display: block;
}

.tt-name {
    font-weight: bold;
    font-size: 1rem;
    color: var(--accent-pink);
    margin-bottom: 0.3rem;
}

.tt-dim { color: var(--text-secondary); }

.tt-dignity-domicile  { color: #4ecdc4; }
.tt-dignity-exaltation { color: #ffd700; }
.tt-dignity-detriment  { color: #ff6b9d; }
.tt-dignity-fall       { color: #ff4757; }

.tt-retro { color: #a29bfe; }

.tt-sep {
    display: block;
    height: 1px;
    background: var(--border);
    margin: 0.35rem 0;
}

.tt-aspect {
    display: block;
    font-size: 0.8rem;
}

.tt-asp-conjunction    { color: #ffd700; }
.tt-asp-opposition     { color: #ff6b9d; }
.tt-asp-trine          { color: #00f5d4; }
.tt-asp-square         { color: #ff4757; }
.tt-asp-sextile        { color: #7bed9f; }
.tt-asp-quincunx       { color: #a29bfe; }
.tt-asp-semisextile    { color: #636e72; }
.tt-asp-semisquare     { color: #e17055; }
.tt-asp-sesquiquadrate { color: #e17055; }

/* Planet + aspect line transitions for smooth highlight */
.planet-group {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.aspect-line {
    transition: opacity 0.2s ease, stroke-width 0.15s ease;
}

/* Tooltip fade */
#chart-tooltip {
    transition: opacity 0.15s ease;
}

/* Responsive */
@media (max-width: 900px) {
    .chart-layout {
        grid-template-columns: 1fr;
    }

    .chart-bottom {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    main {
        padding: 1rem 0.5rem;
    }
}
