:root {
  --primary-color: #2c3e50;
  --highlight-bg: #fff9c4;
  --highlight-border: #f39c12;
  --card-bg: #ffffff;
  --holiday-bg: #ffebee; /* Delikatny czerwony dla świąt i niedziel. */
  --holiday-text: #c62828;
  --saturday-bg: #e3f2fd; /* Błękitny dla sobót. */
  --sun-text-color: #6c5ce7; /* Ciemny fiolet dla godzin wschodu i zachodu słońca. */
  --tekst: rgb(0 ,77 ,64); /* Ciemny zielony (#004d40) */
}

body {
  font-family: "Segoe UI", sans-serif;
  background-color: rgb(240, 243, 244); /* Bardzo jasny, chłodny szary z delikatnie niebieskim tonem (Anti-Flash White). Alternatywa dla czystej bieli, nadający nowoczesny, czysty wygląd. */
  margin: 0;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#powrot {
  position: fixed;
  top: 15px;
  left: 15px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%; /* Okrągły kształt */
  background: var(--tekst);
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
  color: white;
  cursor: pointer;
  font-size: 30px;
  text-decoration: none;
  text-align: center;
  line-height: 34px; /* O 4px mniej niż wysokość <div>, aby idealnie wypośrodkować strzałkę ← w pionie. */
  transition: transform 0.2s;
}

#powrot:hover {
  transform: rotate(45deg);
}

header {
  text-align: center;
  margin-bottom: 15px;
  width: 100%;
  max-width: 1300px;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  margin: 10px 0;
}

button {
  padding: 8px 18px;
  font-size: 1rem;
  cursor: pointer;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
}

#year-display {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color);
}

.calendar-grid {
  display: grid;
  grid-template-columns:
  repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 1300px;
}

.month-container {
  background: var(--card-bg);
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  padding: 8px;
  border: 1px solid #cfd8dc;
}

h2 {
  text-align: center;
  margin: 5px 0;
  font-size: 1.1rem;
  color: var(--primary-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th {
  font-size: 0.65rem;
  color: #90a4ae;
  padding-bottom: 4px;
}

td {
  height: 48px;
  border: 1px solid #f1f1f1;
  text-align: center;
  vertical-align: top;
  padding: 3px 1px;
  font-size: 0.7rem;
}

.day-num {
  font-weight: bold;
  font-size: 0.85rem;
  display: block;
}

.day-of-year {
  color: #b0bec5;
  font-size: 0.6rem;
}

.sun-times {
  font-size: 0.65rem;
  color: var(--sun-text-color);
  font-weight: 600;
  line-height: 1.1;
  margin-top: 2px;
}

.today {
  background-color: var(--highlight-bg) !important;
  outline: 2px solid var(--highlight-border);
  z-index: 1;
  position: relative;
}

.saturday {
  background-color: var(--saturday-bg);
}

.holiday {
  background-color: var(--holiday-bg);
  color: var(--holiday-text);
}

@media (max-width: 1000px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .calendar-grid {
    grid-template-columns: 1fr;
  }
}