/* Calendar styles */

.calendar-section {
  margin: var(--space-4, 2rem) 0;
}

.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2, 1rem);
}

#current-month {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0;
  color: var(--text-primary);
}

.calendar-nav-btn {
  background: none;
  border: 1px solid var(--border, #e2e8f0);
  color: var(--text-primary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.2s;
}

.calendar-nav-btn:hover {
  background-color: var(--bg-secondary, #f8fafc);
  transform: translateY(-1px);
}

.calendar {
  background-color: var(--bg-secondary, #ffffff);
  border-radius: 16px;
  box-shadow: var(--card-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1));
  position: relative;
  z-index: 1;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border, #e2e8f0);
  border-radius: 16px 16px 0 0;
}

.dark .calendar-header {
  background-color: rgba(255, 255, 255, 0.03);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.calendar-day-name {
  padding: 0.75rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #64748b);
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: var(--border, #e2e8f0);
}

.dark .calendar-grid {
  background-color: rgba(255, 255, 255, 0.05);
}

.calendar-day {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  background-color: #ffffff;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dark .calendar-day {
  background-color: #0f172a;
}

.calendar-day:hover {
  background-color: #f8fafc;
  z-index: 50;
}

.dark .calendar-day:hover {
  background-color: #1e293b;
}

.calendar-day.other-month {
  color: var(--text-secondary, #cbd5e1);
  background-color: #fcfdfe;
}

.dark .calendar-day.other-month {
  background-color: #0b1120;
  color: var(--text-secondary, #334155);
}

.calendar-day.today {
  background-color: #eff6ff;
}

.dark .calendar-day.today {
  background-color: rgba(59, 130, 246, 0.1);
}

.calendar-day.today .date-number {
  color: #3b82f6;
  font-weight: 800;
}

.date-number {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.date-events {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: auto;
}

.date-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: transform 0.2s;
}

.calendar-day:hover .date-event-dot {
  transform: scale(1.2);
}

/* ✅ NEW: Global Calendar Popover (Fixed positioning, Premium Card) */
#calendar-global-popover {
  position: fixed;
  z-index: 10000;
  min-width: 260px;
  max-width: 320px;
  background: white;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.05);
  pointer-events: none;
  border: 1px solid rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#calendar-global-popover.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  display: block;
}

.dark #calendar-global-popover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.calendar-popover-date {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: #64748b;
}

.dark .calendar-popover-date {
  color: #94a3b8;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.calendar-popover-events {
  max-height: 350px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 4px;
}

.calendar-popover-events::-webkit-scrollbar {
  width: 4px;
}

.calendar-popover-events::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.popover-event {
  padding: 0.5rem;
  border-radius: 6px;
  background-color: #f8fafc;
  border-left: 3px solid var(--accent-color, #3b82f6);
  transition: background-color 0.2s;
}

.dark .popover-event {
  background-color: #334155;
}

.popover-event-platform {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
  color: var(--accent-color, #3b82f6);
}

.popover-event-name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
  margin-bottom: 0.15rem;
  white-space: normal;
  word-break: break-word;
}

.dark .popover-event-name {
  color: #f1f5f9;
}

.popover-event-time {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.dark .popover-event-time {
  color: #94a3b8;
}

/* Responsive design */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 80px;
    padding: 0.5rem;
  }

  .calendar-day-name {
    padding: 0.75rem 0.25rem;
  }
}

@media (max-width: 480px) {
  .calendar-day {
    min-height: 60px;
    padding: 0.25rem;
  }

  .date-number {
    font-size: 0.75rem;
  }

  .date-event-dot {
    width: 6px;
    height: 6px;
  }
}