/* ===== Calendário de Sessões/Eventos ===== */

.calendar {
  --cal-accent: var(--primary, #3b82f6);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cal-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.cal-nav {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
  border: 1px solid var(--glass-border);
  background: var(--bg-panel);
  color: var(--text-main);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-nav:hover {
  border-color: var(--primary);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

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

.cal-day {
  position: relative;
  min-height: 2.75rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.2rem 0;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: default;
}

.cal-day.empty {
  background: transparent;
}

.cal-day.has-event {
  cursor: pointer;
  border-color: var(--glass-border);
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
}

.cal-day.has-event:hover {
  border-color: var(--primary);
}

.cal-num {
  line-height: 1.1;
}

.cal-dots {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.cal-dot.reg {
  background: #fbbf24; /* âmbar = período de inscrição */
}

.cal-dot.event {
  background: #22c55e; /* verde = acontecimento */
}

/* Visão de 3 meses lado a lado */
.cal-three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.cal-month {
  background: var(--bg-subtle, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.cal-three-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Mini calendário (sidebar) */
.calendar.mini {
  font-size: 0.8rem;
}

.calendar.mini .cal-day {
  min-height: 1.85rem;
  font-size: 0.72rem;
  padding: 0.1rem 0;
}

.calendar.mini .cal-dot {
  width: 5px;
  height: 5px;
}

.calendar.mini .cal-weekdays span {
  font-size: 0.55rem;
}

/* Modal de escolha (dia com múltiplos eventos) */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.cal-modal {
  background: var(--bg-main, #0d1117);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  padding: 1.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cal-modal h3 {
  margin: 0 0 1rem;
  color: var(--text-main);
  font-size: 1rem;
}

.cal-chooser {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cal-chooser-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.cal-chooser-item:hover {
  border-color: var(--primary);
}

.cal-chooser-item strong {
  font-size: 0.9rem;
}

.cal-chooser-item span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cal-tag {
  align-self: flex-start;
  margin-top: 0.15rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.cal-tag.reg {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.cal-tag.event {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

@media (max-width: 1024px) {
  .cal-three {
    grid-template-columns: 1fr; /* empilha os 3 meses no mobile */
  }
}
