/* =============================================
   NIEBO.CSS - Co widać dziś na niebie
   ============================================= */

/* ---- Section variants ---- */
.niebo-section {
  padding: 5rem 0 6rem;
}

.niebo-dark {
  background: rgba(5, 6, 14, 0.99);
}

/* =============================================
   MOON SECTION
   ============================================= */
.moon-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 4rem;
  align-items: center;
}

.moon-canvas-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 340px;
  height: 340px;
  flex-shrink: 0;
}

.moon-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 180, 100, 0.18) 0%, transparent 70%);
  animation: moonGlow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes moonGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.08); }
}

#moon-canvas {
  position: relative;
  z-index: 2;
  border-radius: 50%;
  filter: drop-shadow(0 0 40px rgba(200, 180, 120, 0.4));
}

/* 3D moon - pozycjonowanie identyczne, nadpisanie 2D */
#moon-canvas-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  border-radius: 50%;
  filter: drop-shadow(0 0 40px rgba(200, 180, 120, 0.45));
  touch-action: none;
}
.moon-canvas-wrap.moon-3d-active #moon-canvas { display: none; }

/* Moon info panel */
.moon-phase-name {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 1.75rem;
  background: linear-gradient(90deg, #ffe8a0, #f0b400, #fff3cc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.moon-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.moon-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}

.moon-stat-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-muted);
  margin-bottom: 0.3rem;
}

.moon-stat-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-gold);
}

/* Cycle bar */
.moon-cycle-bar {
  margin-top: 0.5rem;
}

.moon-cycle-track {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50px;
  overflow: visible;
  margin-bottom: 0.5rem;
}

.moon-cycle-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(240,180,0, 0.4), rgba(240,180,0, 0.9));
  border-radius: 50px;
  transition: width 1s var(--ease-out-expo);
}

.moon-cycle-dot {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  background: var(--clr-gold);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(240,180,0, 0.7);
  transition: left 1s var(--ease-out-expo);
}

.moon-cycle-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--clr-muted);
}

/* =============================================
   PLANETS GRID
   ============================================= */
.planets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.planet-card {
  position: relative;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: transform 0.3s var(--ease-spring), border-color 0.3s, box-shadow 0.3s;
}

.planet-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.planet-card.visible-planet {
  border-color: rgba(0, 212, 255, 0.2);
}
.planet-card.visible-planet:hover {
  border-color: rgba(0, 212, 255, 0.45);
  box-shadow: 0 16px 40px rgba(0, 212, 255, 0.1);
}

.planet-card.planet-featured {
  border-color: rgba(255, 100, 50, 0.35);
  background: rgba(255, 80, 30, 0.04);
}
.planet-card.planet-featured:hover {
  border-color: rgba(255, 100, 50, 0.6);
  box-shadow: 0 16px 40px rgba(255, 80, 30, 0.15);
}

.planet-card.not-visible-planet {
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.04);
}

.planet-badge {
  position: absolute;
  top: -1px; right: 1rem;
  background: linear-gradient(135deg, #ff6432, #ff9a3c);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.25em 0.8em;
  border-radius: 0 0 8px 8px;
}

.planet-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.planet-venus  { background: radial-gradient(circle at 35% 30%, #fffde7, #ffe57f 50%, #f9a825); color: #5d4037; }
.planet-mars   { background: radial-gradient(circle at 35% 30%, #ff8a65, #d32f2f 50%, #5a0000); color: #fff; }
.planet-jupiter{ background: radial-gradient(circle at 35% 30%, #ffe0b2, #ff8f00 40%, #4e342e); color: #fff; }
.planet-saturn { background: radial-gradient(circle at 35% 30%, #fffde7, #f9a825 50%, #6d4c00); color: #fff; }
.planet-mercury{ background: radial-gradient(circle at 35% 30%, #bdbdbd, #757575 50%, #212121); color: #fff; }
.planet-uranus { background: radial-gradient(circle at 35% 30%, #b3e5fc, #039be5 50%, #01579b); color: #fff; }
.planet-neptune{ background: radial-gradient(circle at 35% 30%, #90caf9, #1565c0 50%, #0d1b6e); color: #fff; }

.planet-body,
.planet-info { flex: 1; min-width: 0; }

.planet-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.planet-info h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}

.planet-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.2em 0.75em;
  border-radius: 50px;
  margin-bottom: 0.9rem;
}

.status-visible   { background: rgba(0, 212, 255, 0.15); color: #00d4ff; }
.status-setting   { background: rgba(255, 200, 50, 0.15); color: #ffc032; }
.status-rising    { background: rgba(124, 92, 252, 0.15); color: #a07cff; }
.status-binoculars{ background: rgba(100, 220, 100, 0.15); color: #64dc64; }
.status-telescope { background: rgba(200, 200, 255, 0.12); color: #b0b8ff; }
.status-invisible { background: rgba(100, 100, 120, 0.15); color: #8892b0; }

.planet-details {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.planet-detail {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.pd-label { color: var(--clr-muted); flex-shrink: 0; }
.pd-val   { color: var(--clr-text); font-weight: 600; margin-left: auto; min-width: 0; text-align: right; }

.planet-tip {
  font-size: 0.8rem;
  color: var(--clr-muted);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.65rem;
  margin-top: 0.65rem;
}

/* Planets legend */
.planets-legend {
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
}

.planets-legend h4 {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--clr-muted);
  margin-bottom: 0.75rem;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--clr-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.status-visible    { background: #00d4ff; }
.legend-dot.status-setting    { background: #ffc032; }
.legend-dot.status-rising     { background: #a07cff; }
.legend-dot.status-binoculars { background: #64dc64; }
.legend-dot.status-telescope  { background: #b0b8ff; }
.legend-dot.status-invisible  { background: #8892b0; }

/* =============================================
   SUN CALCULATOR
   ============================================= */
.sun-calculator {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 2rem 2.5rem;
}

.sun-calc-controls {
  display: flex;
  gap: 1.25rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sun-calc-controls .form-group {
  flex: 1;
  min-width: 160px;
}

.sun-calc-controls .btn-primary {
  flex-shrink: 0;
  align-self: flex-end;
}

/* Sun time cards grid */
.sun-times-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.sun-time-card {
  border-radius: 14px;
  padding: 1.1rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.25s var(--ease-spring);
}
.sun-time-card:hover { transform: translateY(-3px); }

.sun-time-card.twilight-astro,
.sun-time-card.twilight-astro-eve  { background: rgba(10, 8, 30, 0.9); }
.sun-time-card.twilight-civil,
.sun-time-card.twilight-civil-eve  { background: rgba(20, 10, 60, 0.7); }
.sun-time-card.sunrise             { background: rgba(180, 80, 20, 0.15); border-color: rgba(255, 160, 60, 0.2); }
.sun-time-card.sunset              { background: rgba(180, 60, 10, 0.15); border-color: rgba(255, 120, 40, 0.2); }
.sun-time-card.noon                { background: rgba(255, 200, 50, 0.08); border-color: rgba(255, 200, 50, 0.2); }
.sun-time-card.daylight            { background: rgba(0, 180, 255, 0.06); border-color: rgba(0, 180, 255, 0.15); }

.sun-time-icon { font-size: 1.6rem; margin-bottom: 0.4rem; }
.sun-time-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--clr-muted); margin-bottom: 0.4rem; }
.sun-time-value { font-size: 1.3rem; font-weight: 800; color: var(--clr-text); margin-bottom: 0.25rem; font-variant-numeric: tabular-nums; }
.sun-time-sub   { font-size: 0.68rem; color: rgba(136,146,176,0.6); line-height: 1.4; }

/* Day/night bar */
.daybar-wrap {
  margin-top: 1.5rem;
}

.daybar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--clr-muted);
  margin-bottom: 0.4rem;
}

.daybar {
  position: relative;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: #030408;
  display: flex;
}

.daybar > div {
  height: 100%;
  transition: width 0.8s var(--ease-out-expo);
}

.daybar-night  { background: #030408; }
.daybar-astro  { background: linear-gradient(135deg, #0a0520, #1a0538); }
.daybar-civil  { background: linear-gradient(135deg, #1a0a40, #3a1560); }
.daybar-day    { background: linear-gradient(135deg, #ffb347, #ffd700, #87ceeb, #87ceeb, #ffd700, #ffb347); }

.daybar-now {
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  transition: left 0.5s;
}

.daybar-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.daybar-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--clr-muted);
}

.dl-swatch {
  width: 16px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.dl-night  { background: #030408; border: 1px solid rgba(255,255,255,0.15); }
.dl-astro  { background: linear-gradient(135deg, #0a0520, #1a0538); }
.dl-civil  { background: linear-gradient(135deg, #1a0a40, #3a1560); }
.dl-day    { background: linear-gradient(90deg, #ffb347, #87ceeb); }

/* =============================================
   BORTLE SCALE
   ============================================= */
.bortle-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: start;
}

.bortle-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bortle-btn {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--clr-text);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s, background 0.2s;
  line-height: 1;
}

.bortle-btn:hover {
  transform: scale(1.1);
}

/* Level colors - 1 darkest green → 9 bright red */
.bortle-btn[data-level="1"] { color: #00e676; }
.bortle-btn[data-level="2"] { color: #69f0ae; }
.bortle-btn[data-level="3"] { color: #b2ff59; }
.bortle-btn[data-level="4"] { color: #eeff41; }
.bortle-btn[data-level="5"] { color: #ffff00; }
.bortle-btn[data-level="6"] { color: #ffd740; }
.bortle-btn[data-level="7"] { color: #ff9100; }
.bortle-btn[data-level="8"] { color: #ff3d00; }
.bortle-btn[data-level="9"] { color: #d50000; }

.bortle-btn.active {
  border-color: currentColor;
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.12);
  box-shadow: 0 0 16px currentColor;
}

.bortle-info {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 2rem 2.25rem;
  min-height: 280px;
  transition: border-color 0.3s;
}

.bortle-level-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.bortle-level-num {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

.bortle-level-titles {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.bortle-level-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.bortle-level-sub {
  font-size: 0.8rem;
  color: var(--clr-muted);
  letter-spacing: 0.06em;
}

.bortle-description {
  color: var(--clr-muted);
  line-height: 1.75;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.bortle-what-you-see {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.bortle-see-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--clr-muted);
}

.bortle-see-item::before {
  content: '✦';
  font-size: 0.6rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.bortle-map-hint {
  margin-top: 2.5rem;
  text-align: center;
  color: var(--clr-muted);
  font-size: 0.9rem;
}

.bortle-map-hint a { color: var(--clr-accent-2); transition: opacity 0.2s; }
.bortle-map-hint a:hover { opacity: 0.75; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .moon-layout {
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
  }
  .moon-canvas-wrap { width: 280px; height: 280px; }
  #moon-canvas { width: 240px; height: 240px; }

  .sun-times-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .moon-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2rem;
  }
  .moon-info { width: 100%; }

  .planets-grid { grid-template-columns: 1fr; }

  .sun-calc-controls { flex-direction: column; }
  .sun-calc-controls .btn-primary { width: 100%; }

  .bortle-layout { grid-template-columns: 1fr; }
  .bortle-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .bortle-btn { width: 44px; height: 44px; font-size: 1rem; }

  .bortle-what-you-see { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .sun-times-grid { grid-template-columns: 1fr 1fr; }
  .moon-stats { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .sun-times-grid { grid-template-columns: 1fr; }
  .sun-calculator { padding: 1.25rem; }
  #moon-canvas { width: 200px; height: 200px; }
  .moon-canvas-wrap { width: 220px; height: 220px; }
}

/* Dynamic daily planet cards from Sky export */
.planet-loading {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--clr-muted);
  background: rgba(255, 255, 255, 0.025);
}

.planet-card.binoculars-planet {
  border-color: rgba(100, 220, 100, 0.18);
}

.planet-card.binoculars-planet:hover {
  border-color: rgba(100, 220, 100, 0.42);
  box-shadow: 0 16px 40px rgba(100, 220, 100, 0.1);
}

.planet-card.telescope-planet {
  border-color: rgba(176, 184, 255, 0.16);
}

.planet-card.telescope-planet:hover {
  border-color: rgba(176, 184, 255, 0.4);
  box-shadow: 0 16px 40px rgba(176, 184, 255, 0.1);
}

/* 26.10.2026: podpis mapy NASA pod modelem Ksiezyca */
.moon-credit {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 4;
  width: max-content;
  max-width: 100%;
  margin: 0.6rem 0 0;
  transform: translateX(-50%);
  color: rgba(232, 234, 246, 0.55);
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
}
.moon-canvas-wrap:not(.moon-3d-active) .moon-credit { display: none; }
.moon-layout .moon-canvas-wrap.moon-3d-active { margin-bottom: 2.8rem; }
