:root {
  --bg-color: #050505;
  --surface-color: #111111;
  --accent-color: #ffffff;
  --text-main: #ffffff;
  --text-muted: #888888;
  --border-color: #222222;
  --hover-border: #444444;
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.solar-side {
  flex: 1.2;
  position: sticky;
  top: 0;
  height: 100vh;
  background-color: #000;
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.solar-header {
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.solar-header p {
  font-family: 'Outfit', sans-serif;
  font-weight: 100;
  font-size: 1.1rem;
  color: var(--text-muted);
  letter-spacing: 5px;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.8;
}

#solar-system-bg {
  flex: 1;
  width: 100%;
  display: block;
}

.calendar-side {
  flex: 1;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  overflow-y: auto;
}

#solar-system-bg {
  width: 100%;
  height: 100%;
  display: block;
}

.calendar-container {
  width: 100%;
  max-width: 800px;
  background: transparent;
  padding: 0;
}

.download-icon-btn {
  position: fixed;
  top: 15px;
  right: 15px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  border-radius: 14px;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
  z-index: 9999;
}

.walkthrough-help-btn {
  position: fixed;
  top: 15px;
  left: 15px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 18px;
  background: rgba(0, 229, 255, 0.18);
  color: #050505;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  z-index: 10001;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.walkthrough-help-btn:hover,
.walkthrough-help-btn:focus {
  transform: translateY(-2px);
  background: rgba(0, 229, 255, 0.28);
  outline: none;
}

.walkthrough-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  pointer-events: auto;
}

.walkthrough-overlay.hidden {
  display: none;
}

.walkthrough-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(3px);
  z-index: 20001;
}

.walkthrough-card {
  position: relative;
  width: min(100%, 540px);
  background: rgba(12, 12, 12, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.35);
  z-index: 20002;
  pointer-events: auto;
}

.walkthrough-card h2 {
  margin: 0 0 16px;
  font-size: 2rem;
  color: #ffffff;
}

.walkthrough-card p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.75;
}

.walkthrough-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.walkthrough-action,
.walkthrough-secondary {
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.walkthrough-action {
  background: #00e5ff;
  color: #050505;
}

.walkthrough-action:hover {
  background: #56f4ff;
}

.walkthrough-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.walkthrough-checkbox {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.walkthrough-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #00e5ff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
}

.walkthrough-step-indicator {
  margin-top: 14px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.66);
  text-align: right;
}

.walkthrough-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10003;
}

.walkthrough-target-highlight {
  position: relative;
  z-index: 20003 !important;
  box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.32), 0 0 40px rgba(0, 229, 255, 0.16);
  border-radius: 18px;
}

.walkthrough-arrow {
  position: fixed;
  width: 48px;
  height: 48px;
  z-index: 20004;
  pointer-events: none;
}

.walkthrough-arrow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 36px rgba(255, 255, 255, 0.35);
}

.walkthrough-arrow::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border: 14px solid transparent;
  transform: translate(-50%, -50%);
}

.walkthrough-arrow.down::after {
  border-top-color: #ffffff;
  top: 100%;
  transform: translate(-50%, -50%) rotate(180deg);
}

.walkthrough-arrow.up::after {
  border-bottom-color: #ffffff;
  top: 0;
}

.walkthrough-arrow.left::after {
  border-right-color: #ffffff;
  left: 0;
  transform: translate(-50%, -50%) rotate(90deg);
}

.walkthrough-arrow.right::after {
  border-left-color: #ffffff;
  left: 100%;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.walkthrough-earth-circle {
  position: fixed;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 229, 255, 0.85);
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.7), inset 0 0 15px rgba(0, 229, 255, 0.3);
  z-index: 20003;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: pulse-ring 2s infinite ease-in-out;
  background: rgba(0, 229, 255, 0.08);
}

@keyframes pulse-ring {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.5), inset 0 0 10px rgba(0, 229, 255, 0.2);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 35px rgba(0, 229, 255, 0.9), inset 0 0 20px rgba(0, 229, 255, 0.55);
  }
}

.walkthrough-earth-circle.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .walkthrough-overlay {
    z-index: 999999;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
  }

  .walkthrough-backdrop {
    background: rgba(0, 0, 0, 0.92);
  }

  .walkthrough-card {
    position: fixed;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(92%, 520px);
    padding: 24px;
    margin: 0;
    max-height: 76vh;
    overflow-y: auto;
  }

  .walkthrough-help-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .walkthrough-arrow {
    z-index: 999999;
  }
}

@media (max-width: 1024px) {
  .download-icon-btn {
    width: 38px !important;
    height: 38px !important;
  }
  .download-icon-btn svg {
    width: 18px !important;
    height: 18px !important;
  }
  .download-icon-btn {
    width: 38px !important;
    height: 38px !important;
  }
  .download-icon-btn svg {
    width: 18px !important;
    height: 18px !important;
  }
}

@media (max-width: 1024px) {
  .app-wrapper {
    flex-direction: column;
  }
  .solar-side {
    height: 50vh;
    min-height: 450px;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .solar-header {
    height: 100px; /* Shorter for mobile */
  }
  .calendar-side {
    padding: 20px;
  }
  .day-cell {
    min-height: 80px;
    padding: 12px 10px;
  }
  .day-num {
    font-size: 1.2rem;
  }
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 60px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.month-info {
  text-align: left;
}

#month-name {
  font-size: 3.5rem;
  font-weight: 200;
  letter-spacing: -2px;
  margin-bottom: 10px;
}

.clocks-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clock-display {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.slx-color {
  color: var(--text-main);
}

.nav-controls {
  display: flex;
  gap: 10px;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
}

.nav-btn:hover {
  border-color: var(--accent-color);
  background: var(--surface-color);
}

.nav-btn svg {
  width: 18px;
  height: 18px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--border-color);
  border: 1px solid var(--border-color);
}

.weekday-header {
  background-color: var(--bg-color);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-align: center;
  padding: 15px 0;
  font-weight: 400;
}

.weekday-header .short-name {
  display: none;
}
.weekday-header .full-name {
  display: inline;
}

.day-cell {
  background-color: var(--bg-color);
  padding: 20px 15px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.day-cell:hover {
  background-color: var(--surface-color);
  z-index: 10;
  border-color: rgba(0, 229, 255, 0.3);
  transform: translateY(-2px);
}

.day-cell.today {
  box-shadow: inset 0 0 0 1px var(--accent-color);
}

.day-cell.selected-day {
  box-shadow: inset 0 0 0 2px #00e5ff, 0 0 10px rgba(0, 229, 255, 0.2);
  z-index: 5;
}

.day-num {
  font-size: 1.5rem;
  font-weight: 300;
}

.year-day-num {
  font-size: 0.7rem;
  color: var(--text-muted);
  align-self: flex-end;
}

.calendar-grid.leap-layout {
  grid-template-columns: repeat(2, 1fr);
  max-width: 400px;
  margin: 0;
}

.day-num.leap-day-highlight {
  color: #FF2400; /* Intense Scarlet */
  font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 36, 0, 0.9);
}

.day-cell.leap-day-active {
  background-color: #000000 !important;
  border-color: #FF2400 !important;
  box-shadow: 0 0 20px rgba(255, 36, 0, 0.3);
}

.day-cell.non-leap-inactive {
  background-color: #000000 !important; /* Force black, no transparency to grid */
  border-color: #1a1a1a;
}

.day-cell.non-leap-inactive .day-num,
.day-cell.non-leap-inactive .year-day-num {
  opacity: 0.2; /* Only dim the text */
}

.leap-timeline {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px dotted var(--border-color);
  font-family: 'Courier New', monospace;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.timeline-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.year-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.timeline-item.active .year-text {
  color: var(--text-main);
  text-decoration: underline;
}

.timeline-item.active .label-text {
  color: var(--text-main);
}



@media (max-width: 600px) {
  .solar-side {
    height: 95vw; /* Square-ish for maximum system size */
  }
  .calendar-side {
    padding: 15px 10px;
  }
  #month-name {
    font-size: 2.2rem;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
  }
  .day-cell {
    min-height: 60px;
    padding: 8px 6px;
  }
  .day-num {
    font-size: 1rem;
  }
  .weekday-header {
    padding: 10px 0;
    font-size: 0.6rem;
    letter-spacing: 1px;
  }
  .weekday-header .full-name {
    display: none;
  }
  .weekday-header .short-name {
    display: inline;
  }
  .label-text {
    font-size: 0.9rem;
    letter-spacing: 1px;
  }
  .year-text {
    font-size: 0.6rem;
  }
  .leap-timeline {
    margin-top: 30px;
  }
}
