/* ==========================================================================
   2. TAKVİM (CALENDAR) MODÜLÜ — Fixture Paneli İçindeki Takvim Alt Sekmesi
   Calendar is now a sub-tab inside the Fixture panel (green pitch background).
   The old standalone #hubViewCalendar and .calendar-mode classes are removed.
   ========================================================================== */

.calendar-page-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 2;
}

/* Top Card (Header & Month Navigator) */
.cal-top-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 249, 255, 0.93) 100%);
  border: 1.5px solid rgba(186, 230, 253, 0.95);
  border-radius: 16px;
  padding: 18px 24px;
  box-shadow: 0 10px 30px -5px rgba(2, 132, 199, 0.14), 0 4px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.cal-top-card::after {
  content: "";
  position: absolute;
  top: -45px;
  right: -45px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cal-badge-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border: 1.5px solid #7dd3fc;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
}

.cal-main-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0369a1;
  letter-spacing: -0.3px;
}

.cal-sub-title {
  margin: 2px 0 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.cal-month-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-nav-btn {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  color: #0284c7;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cal-nav-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.cal-current-month-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 130px;
}

.cal-current-month {
  font-size: 17px;
  font-weight: 800;
  color: #0c4a6e;
}

.cal-season-tag {
  font-size: 11px;
  font-weight: 600;
  color: #0284c7;
}

.cal-today-btn {
  background: #0284c7;
  border: 1.5px solid #0369a1;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}
.cal-today-btn:hover {
  background: #0369a1;
}

/* Toolbar: Filters & Legend */
.cal-toolbar-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 249, 255, 0.9) 100%);
  border: 1.5px solid rgba(186, 230, 253, 0.9);
  border-radius: 14px;
  padding: 14px 22px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cal-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.cal-filter-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}

.cal-filter-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cal-filter-pill:hover {
  background: #e2e8f0;
}

.cal-filter-pill.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.cal-filter-pill.pill-league.active { background: #2563eb !important; border-color: #2563eb !important; }
.cal-filter-pill.pill-cup.active { background: #d97706 !important; border-color: #d97706 !important; }
.cal-filter-pill.pill-ucl.active { background: #7c3aed !important; border-color: #7c3aed !important; }
.cal-filter-pill.pill-fed.active { background: #059669 !important; border-color: #059669 !important; }

.cal-legend-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.cal-leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}

.cal-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.cal-leg-dot.dot-win { background: #10b981; }
.cal-leg-dot.dot-draw { background: #94a3b8; }
.cal-leg-dot.dot-loss { background: #ef4444; }
.cal-leg-dot.dot-upcoming { background: #38bdf8; }

/* Calendar Board & 7-Column Grid */
.cal-board-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 2px solid #bae6fd;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 16px 40px -8px rgba(2, 132, 199, 0.18), 0 4px 16px rgba(15, 23, 42, 0.04);
  overflow-x: auto;
  position: relative;
}

.cal-weekdays-header {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.cal-weekday-cell {
  background: #f0f9ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-weekday-cell.cal-weekend {
  background: #e0f2fe;
  color: #0284c7;
}

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

/* Day Tile */
.cal-day-cell {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  min-height: 125px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.cal-day-cell:hover {
  border-color: #38bdf8;
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.25);
  transform: translateY(-2px);
  background: #f8fafc;
}


.cal-day-cell.is-past {
  background: #cbd5e1 !important;
  border-color: #94a3b8 !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
}

.cal-day-cell.is-past:hover {
  background: #94a3b8 !important;
  border-color: #64748b !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.cal-day-cell.is-past .cal-day-num {
  color: #334155 !important;
  font-weight: 900;
}

.cal-day-cell.is-past .cal-match-chip {
  filter: grayscale(0.2) contrast(0.95);
}

.cal-day-cell.is-today {
  border-color: #0284c7;
  background: #f0f9ff;
  box-shadow: 0 0 0 2px #38bdf8;
}

.cal-day-cell.other-month {
  opacity: 0.35;
  background: #f1f5f9;
  border-color: #e2e8f0;
  cursor: default;
  pointer-events: none;
}

.cal-day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-day-num {
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
}

.cal-day-cell.is-today .cal-day-num {
  color: #0284c7;
  font-size: 15px;
}

.cal-today-badge {
  background: #0284c7;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cal-day-matches {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

/* Match Chip inside day tile */
.cal-match-chip {
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: transform 0.15s ease;
  overflow: hidden;
  white-space: nowrap;
}

.cal-match-chip:hover {
  transform: scale(1.02);
}

/* Competition Color Themes for Chips */
.cal-match-chip.chip-league {
  background: #e0f2fe;
  color: #0369a1;
  border-left: 3.5px solid #0284c7;
}

.cal-match-chip.chip-cup {
  background: #fef3c7;
  color: #92400e;
  border-left: 3.5px solid #f59e0b;
}

.cal-match-chip.chip-ucl {
  background: #ede9fe;
  color: #5b21b6;
  border-left: 3.5px solid #7c3aed;
}

.cal-match-chip.chip-fed {
  background: #d1fae5;
  color: #065f46;
  border-left: 3.5px solid #10b981;
}

.cmc-left {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmc-time {
  font-size: 10px;
  opacity: 0.85;
}

.cmc-opp {
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmc-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
}

.cmc-badge.score-win { background: #10b981; color: #ffffff; }
.cmc-badge.score-draw { background: #94a3b8; color: #ffffff; }
.cmc-badge.score-loss { background: #ef4444; color: #ffffff; }
.cmc-badge.score-upcoming { background: rgba(0, 0, 0, 0.08); color: #475569; }

/* Calendar Helper Banner */
.cal-footer-banner {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(224, 242, 254, 0.9) 100%);
  border: 1.5px solid #bae6fd;
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #0369a1;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
}

.cal-foot-icon {
  font-size: 20px;
}

/* ==========================================================================
   3. CALENDAR DAY DETAIL MODAL (LIGHT BLUE & CLEAN WHITE)
   ========================================================================== */
.cal-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cal-modal-dialog {
  background: #ffffff;
  border: 1.5px solid #bfdbfe;
  border-radius: 16px;
  width: 620px;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.4);
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.cal-modal-header {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-bottom: 1px solid #bfdbfe;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-modal-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-modal-icon {
  font-size: 26px;
}

.cal-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0369a1;
}

.cal-modal-sub {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.cal-modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.cal-modal-close:hover {
  background: #bae6fd;
  color: #0f172a;
}

.cal-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* AGENTS.md §4.3: pencere içi ölçü — vh/vw DEĞİL (onlar tarayıcıyı ölçer), yüzde. */
  flex: 1;
  min-height: 0;
}

.cal-modal-card {
  background: #f8fafc;
  border: 1.5px solid #dbeafe;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(186, 230, 253, 0.25);
}

.cmc-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 8px;
}

.cmc-comp-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.cmc-time-loc {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.cmc-matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cmc-team-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmc-team-box.away {
  flex-direction: row-reverse;
  text-align: right;
}

.cmc-team-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.cmc-team-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.cmc-team-ovr {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.cmc-vs-score {
  padding: 6px 14px;
  background: #ffffff;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 800;
  color: #0284c7;
  text-align: center;
}

.cmc-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  color: #475569;
}

.cal-modal-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
}

.cal-modal-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.cal-modal-btn.secondary {
  background: #e2e8f0;
  color: #334155;
}
.cal-modal-btn.secondary:hover {
  background: #cbd5e1;
}
