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

:root {
    --bg:        #05050f;
    --bg2:       #0c0c1e;
    --bg3:       #131328;
    --border:    rgba(255,255,255,0.07);
    --gold:      #d4a843;
    --gold-soft: rgba(212,168,67,0.15);
    --silver:    #c8c8d8;
    --text:      #e0dff5;
    --text-dim:  #7a79a0;
    --radius:    16px;
    --glow:      0 0 40px rgba(212,168,67,0.12);
}

html, body { height: 100%; font-family: 'Inter', sans-serif; }
body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(30,30,80,0.6) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(15,15,50,0.5) 0%, transparent 60%);
}

/* ── Stars background ───────────────────────────────── */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 45%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,0.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 75%, rgba(255,255,255,0.55) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 80%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 60%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 20%, rgba(255,255,255,0.45) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 5% 90%, rgba(255,255,255,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 45% 55%, rgba(255,255,255,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 88%, rgba(255,255,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 65%, rgba(255,255,255,0.35) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; }

/* ── Header ─────────────────────────────────────────── */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 0 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.logo { font-size: 40px; filter: drop-shadow(0 0 12px rgba(212,168,67,0.6)); animation: moonGlow 3s ease-in-out infinite; }
@keyframes moonGlow {
    0%,100% { filter: drop-shadow(0 0 12px rgba(212,168,67,0.6)); }
    50% { filter: drop-shadow(0 0 22px rgba(212,168,67,0.9)); }
}
h1 { font-size: 26px; font-weight: 700; background: linear-gradient(135deg, #e8d88a, #c49a30); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.subtitle { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 10px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #c49a30, #8a6a18);
    color: #fff;
    border: none; border-radius: 10px; padding: 10px 20px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    transition: all .2s; box-shadow: 0 4px 16px rgba(196,154,48,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(196,154,48,0.45); }
.btn-outline {
    background: transparent;
    color: var(--gold); border: 1px solid rgba(212,168,67,0.4);
    border-radius: 10px; padding: 9px 16px;
    font-size: 14px; cursor: pointer; transition: all .2s;
}
.btn-outline:hover { background: var(--gold-soft); border-color: var(--gold); }
.btn-icon {
    background: rgba(255,255,255,0.06); border: 1px solid var(--border);
    color: var(--text); border-radius: 8px; padding: 8px 12px;
    font-size: 18px; cursor: pointer; transition: all .2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); }

/* ── Date input ──────────────────────────────────────── */
.date-input {
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text); border-radius: 10px;
    padding: 9px 14px; font-family: 'Inter', sans-serif;
    font-size: 14px; cursor: pointer;
}
.date-input::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.5); cursor: pointer; }

/* ── Main layout ─────────────────────────────────────── */
.main { display: grid; grid-template-columns: 420px 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .main { grid-template-columns: 1fr; } }

/* ── Moon display ────────────────────────────────────── */
.panel-left { display: flex; flex-direction: column; gap: 20px; }
.moon-wrap {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, #0e0e22 0%, var(--bg) 75%);
    border-radius: 24px; border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,0.04);
}
#moonCanvas { display: block; border-radius: 50%; }

/* ── Info cards ──────────────────────────────────────── */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-card {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 18px;
    transition: border-color .2s;
}
.info-card:hover { border-color: rgba(212,168,67,0.3); }
.info-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.info-val { font-size: 18px; font-weight: 600; color: var(--gold); }

/* ── Sliders ─────────────────────────────────────────── */
.slider-section {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px;
}
.slider-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.slider {
    -webkit-appearance: none; width: 100%; height: 4px;
    background: rgba(255,255,255,0.1); border-radius: 2px; outline: none;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px;
    border-radius: 50%; background: var(--gold);
    cursor: pointer; box-shadow: 0 0 8px rgba(212,168,67,0.6);
    transition: transform .15s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.slider-ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-dim); margin-top: 8px; }

/* ── Controls ────────────────────────────────────────── */
.controls {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
}
.speed-wrap { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 1; }
.speed-label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.speed-slider { flex: 1; }
#speedVal { font-size: 13px; color: var(--gold); min-width: 28px; }

/* ── Right panel ─────────────────────────────────────── */
.panel-right { display: flex; flex-direction: column; gap: 24px; }
.card {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 20px; padding: 22px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 16px; }
#orbitCanvas { display: block; width: 100%; border-radius: 12px; }

/* ── Calendar ────────────────────────────────────────── */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-header .card-title { margin-bottom: 0; flex: 1; text-align: center; }
.cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cal-day-name {
    font-size: 10px; color: var(--text-dim); text-align: center;
    text-transform: uppercase; letter-spacing: .5px; padding-bottom: 6px;
}
.cal-day {
    display: flex; flex-direction: column; align-items: center;
    gap: 4px; padding: 6px 2px; border-radius: 10px;
    cursor: pointer; transition: background .15s;
    border: 1px solid transparent;
}
.cal-day:hover { background: rgba(255,255,255,0.06); }
.cal-day.active { background: var(--gold-soft); border-color: rgba(212,168,67,0.4); }
.cal-day.today { border-color: rgba(212,168,67,0.6); }
.cal-day canvas { border-radius: 50%; }
.cal-day .cal-num { font-size: 10px; color: var(--text-dim); }
.cal-day.active .cal-num { color: var(--gold); }
.cal-day.empty { cursor: default; }

/* ── Fullscreen button ───────────────────────────────── */
.btn-fullscreen {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 9999;
    background: rgba(13,13,30,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(212,168,67,0.35);
    color: var(--gold);
    border-radius: 10px;
    width: 40px; height: 40px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.btn-fullscreen:hover {
    background: rgba(212,168,67,0.18);
    border-color: var(--gold);
    transform: scale(1.08);
}
