@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

:root {
  --bg: #f9fafb;
  --text: #222;
  --card-bg: white;
  --border: #e0e0e0;
  --highlight: #ff4081;
  --muted: #ccc;
  --header-bg: #f0f0f0;
  --shadow: rgba(0, 0, 0, 0.05);
  --range: rgba(0, 123, 255, 0.15);
  --range-strong: rgba(0, 123, 255, 0.4);
}

[data-theme="dark"] {
  --bg: #1e1e1e;
  --text: #f2f2f2;
  --card-bg: #2a2a2a;
  --border: #444;
  --highlight: #ff4081;
  --muted: #777;
  --header-bg: #333;
  --shadow: rgba(255, 255, 255, 0.05);
  --range: rgba(0, 123, 255, 0.2);
  --range-strong: rgba(0, 123, 255, 0.5);
}

body {
  font-family: 'Inter', sans-serif;
  margin: 20px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  transition: background 0.3s, color 0.3s;
}

h1 {
  font-size: 2em;
  margin-bottom: 5px;
  color: var(--text);
}

.current-info {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: var(--text);
}

.toggle-theme {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.4em;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  justify-content: center;
  align-items: start;
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 10px;
}

.month {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 5px var(--shadow);
}

.month h3 {
  text-align: center;
  margin: 8px 0 12px;
  font-size: 1em;
  font-weight: 600;
  color: var(--text);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

th, td {
  width: 14%;
  text-align: center;
  padding: 4px;
  transition: background-color 0.2s ease;
}

thead tr {
  border-bottom: 1px solid var(--border);
}

th:first-child, td:first-child {
  font-weight: 600;
  color: var(--text);
  background: var(--header-bg);
  width: 12%;
}

td.today {
  background: var(--highlight);
  cursor: pointer;
  color: white;
  font-weight: bold;
  border-radius: 6px;
}

td.other-month {
  color: var(--muted);
}

/* Range highlight styles */
td.range-start, 
td.range-end {
  background-color: var(--range-strong);
  cursor: pointer;
  color: white;
  font-weight: bold;
  border-radius: 4px;
}

td:hover:not(.today):not(.other-month):not(.range-start):not(.range-end) {
  background-color: rgba(0, 123, 255, 0.1);
  cursor: pointer;
  border-radius: 4px;
}

td.in-range {
  background-color: var(--range);
  border-radius: 4px;
}



td {
  position: relative;
}

.week-banner {
  margin-bottom: 30px;
}

.week-number {
  font-size: 2.5em;
  font-weight: 600;
  color: var(--highlight);
  margin-bottom: 5px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.current-info {
  font-size: 1.1em;
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.year-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 20px 0;
}

.year-nav a {
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  transition: 0.2s;
}

.year-nav a:hover {
  background: var(--highlight);
  color: white;
}

.year-nav .active {
  background: var(--highlight);
  color: white;
  font-weight: bold;
}

/* Responsive */
@media (max-width: 900px) {
  .calendar {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .calendar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .month {
    width: 100%;
  }
}
