/* agenda.css */

/* ============================================
   LAYOUT DA AGENDA
   ============================================ */
.agenda-panel {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
  gap: 16px;
}

.agenda-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.agenda-header h2 {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.agenda-subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.agenda-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-nav-btn {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 6px 11px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.agenda-nav-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary);
  color: var(--primary);
}

.agenda-month-label {
  min-width: 160px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-transform: capitalize;
}

/* ============================================
   CALENDÁRIO
   ============================================ */
.calendar-wrapper {
  background: var(--calendar-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--calendar-border);
  padding: 10px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.calendar-day {
  border-radius: 8px;
  padding: 5px 4px;
  background: var(--calendar-day-bg);
  border: 1px solid transparent;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition:
    background     0.15s ease,
    border-color   0.15s ease,
    box-shadow     0.15s ease;
}

.calendar-day:hover:not(.outside) {
  background: rgba(99, 102, 241, 0.06);
  border-color: var(--primary-light);
}

.calendar-day.outside {
  background: var(--calendar-day-bg-muted);
  color: var(--calendar-day-text-muted);
  cursor: default;
}

.calendar-day.outside:hover {
  background: var(--calendar-day-bg-muted);
  border-color: transparent;
}

.calendar-day.today .calendar-day-number {
  background: var(--primary);
  color: #ffffff;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day.today {
  border-color: var(--primary);
}

.calendar-day.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.07);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.calendar-day-number {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day-pins {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: auto;
}

.calendar-pin-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ============================================
   PAINEL DE DETALHES DO DIA
   ============================================ */
.day-details-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.day-details-header h3 {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  text-transform: capitalize;
}

/* ============================================
   FORMULÁRIO DE PIN
   ============================================ */
.pin-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

#pinTitleInput {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.3s ease;
  font-family: inherit;
}

#pinTitleInput:focus {
  outline: none;
  border-color: var(--primary-light);
}

#pinTitleInput::placeholder {
  color: var(--text-muted);
}

.pin-color-choices {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pin-colors {
  display: flex;
  gap: 7px;
}

.pin-color-option {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pin-color-option:hover {
  transform: scale(1.15);
}

.pin-color-option.selected {
  border-color: var(--surface);
  box-shadow: 0 0 0 2.5px var(--primary);
  transform: scale(1.15);
}

.pin-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================
   LISTA DE PINS
   ============================================ */
.pins-list {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 10px;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pins-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
}

.pin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pin-item:hover {
  background: var(--bg);
  border-color: var(--border);
}

.pin-item-main {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.pin-item-color {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  flex-shrink: 0;
}

.pin-item-title {
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.pin-action-btn {
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 0.73rem;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.pin-action-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

/* ============================================
   RESPONSIVO AGENDA
   ============================================ */
@media (max-width: 900px) {
  .agenda-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .calendar-day {
    min-height: 46px;
    padding: 3px;
  }

  .calendar-day-number {
    font-size: 0.72rem;
  }

  .agenda-month-label {
    min-width: 120px;
    font-size: 0.85rem;
  }

  .pin-form-actions .primary-btn,
  .pin-form-actions .secondary-btn {
    flex: 1;
    justify-content: center;
  }
}