.calendar-year {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.year-month {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.year-month:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.year-month-header {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.year-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.year-month-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  position: relative;
}

.year-month-day.today {
  color: var(--text-primary);
  font-weight: 700;
  background: var(--bg-active);
}

.year-month-day.has-event::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cat-technology);
}

.calendar-month {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.month-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.month-header-cell {
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.month-body {
  display: flex;
  flex-direction: column;
}

.month-week-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border-subtle);
}

.month-event-track {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  padding: 2px 2px 0;
  min-height: 0;
}

.event-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: opacity var(--transition-fast);
  height: 24px;
}

.event-bar:hover {
  opacity: 0.85;
}

.event-bar-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.event-bar-status.confirmed { background: var(--status-confirmed); }
.event-bar-status.potential { background: var(--status-potential); }
.event-bar-status.disputed { background: var(--status-disputed); }

.event-bar-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-bar.cat-sports { background: rgba(255, 107, 53, 0.2); color: var(--cat-sports); }
.event-bar.cat-space { background: rgba(123, 104, 238, 0.2); color: var(--cat-space); }
.event-bar.cat-politics { background: rgba(46, 204, 113, 0.2); color: var(--cat-politics); }
.event-bar.cat-technology { background: rgba(0, 212, 255, 0.2); color: var(--cat-technology); }
.event-bar.cat-culture { background: rgba(255, 105, 180, 0.2); color: var(--cat-culture); }
.event-bar.cat-economics { background: rgba(255, 215, 0, 0.2); color: var(--cat-economics); }
.event-bar.cat-humanitarian { background: rgba(255, 68, 68, 0.2); color: var(--cat-humanitarian); }
.event-bar.cat-astronomy { background: rgba(147, 112, 219, 0.2); color: var(--cat-astronomy); }
.event-bar.cat-entertainment { background: rgba(224, 64, 251, 0.2); color: #E040FB; }

.event-bar.multi-day {
  border-radius: 3px;
  border-left: 3px solid;
}

.event-bar.multi-day.cat-sports { border-left-color: var(--cat-sports); }
.event-bar.multi-day.cat-space { border-left-color: var(--cat-space); }
.event-bar.multi-day.cat-politics { border-left-color: var(--cat-politics); }
.event-bar.multi-day.cat-technology { border-left-color: var(--cat-technology); }
.event-bar.multi-day.cat-culture { border-left-color: var(--cat-culture); }
.event-bar.multi-day.cat-economics { border-left-color: var(--cat-economics); }
.event-bar.multi-day.cat-humanitarian { border-left-color: var(--cat-humanitarian); }
.event-bar.multi-day.cat-astronomy { border-left-color: var(--cat-astronomy); }
.event-bar.multi-day.cat-entertainment { border-left-color: #E040FB; }

.month-days-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.month-day-cell {
  min-height: 100px;
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-sm);
  transition: background var(--transition-fast);
}

.month-day-cell:nth-child(7n) {
  border-right: none;
}

.month-day-cell:hover {
  background: var(--bg-hover);
}

.month-day-cell.other-month {
  opacity: 0.3;
}

.month-day-cell.today {
  background: rgba(0, 212, 255, 0.05);
}

.month-day-cell .month-cell-date {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  padding: 2px 6px;
}

.month-day-cell.today .month-cell-date {
  color: var(--cat-technology);
  font-weight: 700;
}

.month-day-cell .month-cell-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-week {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.week-header {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.week-header-cell {
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid var(--border-subtle);
}

.week-header-cell:last-child {
  border-right: none;
}

.week-header-cell.today {
  color: var(--cat-technology);
  background: rgba(0, 212, 255, 0.05);
}

.week-day {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  min-height: 400px;
}

.week-day-label {
  padding: var(--space-sm);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  border-right: 1px solid var(--border-subtle);
}

.week-day-cell {
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-xs);
  min-height: 80px;
}

.week-day-cell:last-child {
  border-right: none;
}

.week-day-cell.today {
  background: rgba(0, 212, 255, 0.03);
}

.calendar-list {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.list-header {
  display: grid;
  grid-template-columns: 120px 1fr 100px 80px 80px;
  background: var(--bg-tertiary);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.list-row {
  display: grid;
  grid-template-columns: 120px 1fr 100px 80px 80px;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 1rem;
  align-items: center;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.list-row:hover {
  background: var(--bg-hover);
}

.list-row:last-child {
  border-bottom: none;
}

.list-date {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.list-title {
  font-weight: 500;
}

.list-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
}

.list-category .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.list-country {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.list-status {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-align: center;
}

@media (max-width: 768px) {
  .calendar-year {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-sm);
  }

  .year-month {
    padding: var(--space-sm);
  }

  .year-month-header {
    font-size: 0.75rem;
  }

  .year-month-day {
    font-size: 0.5625rem;
  }

  .month-header-cell {
    font-size: 0.625rem;
    padding: var(--space-xs);
  }

  .event-bar {
    font-size: 0.5625rem;
    height: 18px;
    padding: 1px 4px;
  }

  .event-bar-title {
    display: none;
  }

  .event-bar-status {
    width: 4px;
    height: 4px;
  }

  .month-day-cell {
    min-height: 60px;
    padding: 2px;
  }

  .month-day-cell .month-cell-date {
    font-size: 0.6875rem;
    padding: 1px 3px;
  }

  .week-header {
    grid-template-columns: 40px repeat(7, 1fr);
  }

  .week-day {
    grid-template-columns: 40px repeat(7, 1fr);
    min-height: 200px;
  }

  .week-header-cell {
    font-size: 0.5625rem;
    padding: var(--space-xs);
  }

  .week-day-label {
    font-size: 0.5625rem;
  }

  .calendar-list {
    overflow-x: auto;
  }

  .list-header,
  .list-row {
    grid-template-columns: 80px 1fr 80px;
    min-width: 300px;
  }

  .list-header > :nth-child(4),
  .list-header > :nth-child(5),
  .list-row > :nth-child(4),
  .list-row > :nth-child(5) {
    display: none;
  }

  .list-header {
    font-size: 0.625rem;
  }

  .list-row {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
  }

  .list-date {
    font-size: 0.6875rem;
  }

  .list-category {
    font-size: 0.625rem;
  }

  .list-status {
    font-size: 0.5625rem;
    padding: 2px 6px;
  }
}

@media (max-width: 480px) {
  .calendar-year {
    grid-template-columns: repeat(2, 1fr);
  }

  .month-day-cell {
    min-height: 48px;
  }

  .event-bar {
    display: none;
  }

  .month-cell-events {
    display: none;
  }

  .week-header,
  .week-day {
    grid-template-columns: 30px repeat(7, 1fr);
  }

  .list-header,
  .list-row {
    grid-template-columns: 70px 1fr;
  }

  .list-header > :nth-child(3),
  .list-row > :nth-child(3) {
    display: none;
  }
}
