/* ==========================================================================
   APM Seasonal Calendar – Frontend Styles
   Scope: .apm-calendar-wrapper
   Visual reference: apm-seasonal-calendar.html
   ========================================================================== */

/* ── Design tokens (scoped to wrapper) ── */
.apm-calendar-wrapper {
  --navy:       #1b3b6f;
  --blue:       #146097;
  --sky:        #a1d8ff;
  --lime:       #a9ec1d;
  --white:      #ffffff;
  --off-white:  #f0f6ff;
  --text-dark:  #0d1f3c;
  --text-mid:   #3a5a8c;
  --border:     rgba(27,59,111,0.12);
  --shadow:     0 4px 24px rgba(27,59,111,0.10);

  font-family: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  background: var(--off-white);
  color: var(--text-dark);
  line-height: 1.5;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

.apm-calendar-wrapper *,
.apm-calendar-wrapper *::before,
.apm-calendar-wrapper *::after {
  box-sizing: inherit;
}

/* ── Filter Bar ── */
.apm-filter-bar {
  background: var(--blue);
  padding: 10px 32px;
  margin-bottom: 28px;
  border-radius: 8px;
}

.apm-filter-bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.apm-filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sky);
  white-space: nowrap;
}

.apm-filter-select {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(161,216,255,0.35);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  min-width: 140px;
}
.apm-filter-select option { background: var(--navy); color: var(--white); }
.apm-filter-select:focus   { border-color: var(--lime); }

.apm-filter-reset {
  background: transparent;
  border: 1px solid rgba(161,216,255,0.4);
  color: var(--sky);
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  margin-left: auto;
}
.apm-filter-reset:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.apm-high-opp-toggle {
  background: var(--lime);
  color: var(--navy);
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-family: 'Barlow Condensed', 'Barlow', Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.apm-high-opp-toggle:hover  { background: #bef030; transform: translateY(-1px); }
.apm-high-opp-toggle.active { background: #ffd700; }

/* ── Month Nav ── */
.apm-month-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  margin-bottom: 28px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  background: var(--white);
  border: 1px solid var(--border);
  scrollbar-width: thin;
}

.apm-month-btn {
  flex: 1;
  min-width: 72px;
  padding: 12px 6px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  font-family: 'Barlow Condensed', 'Barlow', Arial, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mid);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.apm-month-btn:last-child { border-right: none; }
.apm-month-btn.active {
  background: var(--navy);
  color: var(--white);
}
.apm-month-btn:not(.active):hover {
  background: var(--sky);
  color: var(--navy);
}
.apm-month-btn.apm-btn-faded {
  opacity: 0.35;
  pointer-events: none;
}

.apm-q-badge {
  display: block;
  font-size: 9px;
  font-weight: 400;
  opacity: 0.6;
  margin-top: 2px;
  letter-spacing: 0.06em;
}

/* ── Month Panel ── */
.apm-month-panel         { display: none; }
.apm-month-panel.active  { display: block; }

/* Header bar */
.apm-month-header-bar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  border-radius: 12px 12px 0 0;
  padding: 22px 28px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.apm-month-title-block h2 {
  font-family: 'Barlow Condensed', 'Barlow', Arial, sans-serif;
  font-weight: 800;
  font-size: 42px;
  color: var(--white);
  letter-spacing: 0.03em;
  line-height: 1;
  margin: 0;
}

.apm-month-year {
  font-size: 14px;
  color: var(--sky);
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 3px;
}

/* Awareness tags */
.apm-awareness-tags {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  padding-top: 6px;
}

.apm-awareness-tag {
  background: rgba(161,216,255,0.18);
  border: 1px solid rgba(161,216,255,0.35);
  color: var(--sky);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Month body */
.apm-month-body {
  background: var(--white);
  border-radius: 0 0 12px 12px;
  border: 1px solid var(--border);
  border-top: none;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Two-column info grid */
.apm-month-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.apm-info-card {
  padding: 22px 24px;
  border-right: 1px solid var(--border);
}
.apm-info-card:last-child { border-right: none; }

.apm-info-card h3 {
  font-family: 'Barlow Condensed', 'Barlow', Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--sky);
  display: flex;
  align-items: center;
  gap: 7px;
}

.apm-icon { font-size: 14px; }

/* Industry tags */
.apm-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.apm-industry-tag {
  background: var(--off-white);
  border: 1px solid var(--border);
  color: var(--navy);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
}

/* Venue items */
.apm-venue-item {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.5;
  padding: 3px 0;
  border-bottom: 1px solid rgba(27,59,111,0.06);
}
.apm-venue-item:last-child { border-bottom: none; }

/* ── Calendar Grid ── */
.apm-cal-section {
  border-top: 1px solid var(--border);
  padding: 24px;
}

.apm-cal-section h3 {
  font-family: 'Barlow Condensed', 'Barlow', Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin: 0 0 14px;
}

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

.apm-cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  padding: 6px 2px;
  background: var(--off-white);
  border-radius: 4px;
}

.apm-cal-day {
  min-height: 68px;
  background: var(--off-white);
  border-radius: 5px;
  padding: 6px;
  position: relative;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}
.apm-cal-day:hover { border-color: var(--sky); }

.apm-cal-empty {
  background: transparent;
  border: none;
  pointer-events: none;
}

/* High-opportunity day */
.apm-cal-day.apm-high-opp {
  background: #f6fff0;
  border-color: var(--lime);
}
.apm-cal-day.apm-high-opp .apm-day-num { color: var(--navy); }
.apm-cal-day.apm-high-opp::after {
  content: '★';
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 11px;
  color: var(--lime);
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.1));
}

/* Fade non-high-opp days in highlight mode */
.apm-calendar-wrapper.apm-highlight-mode .apm-cal-day:not(.apm-high-opp):not(.apm-cal-empty) {
  opacity: 0.35;
}

.apm-day-num {
  font-family: 'Barlow Condensed', 'Barlow', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-mid);
  line-height: 1;
  margin-bottom: 3px;
}

.apm-day-event {
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-dark);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ── Sales / Pitch Section ── */
.apm-sales-section {
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  background: linear-gradient(135deg, #f4f9ff 0%, #f0fff0 100%);
}

.apm-sales-section h3 {
  font-family: 'Barlow Condensed', 'Barlow', Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin: 0 0 14px;
}

.apm-pitch-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.apm-pitch-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 15px;
  border-left: 4px solid var(--sky);
  transition: border-left-color 0.2s, box-shadow 0.2s;
}
.apm-pitch-card:hover { border-left-color: var(--lime); box-shadow: 0 2px 12px rgba(27,59,111,0.1); }

.apm-pitch-card.apm-pitch-high {
  border-left-color: var(--lime);
  background: #f9fff0;
}

/* Fade non-high pitches in highlight mode */
.apm-calendar-wrapper.apm-highlight-mode .apm-pitch-card:not(.apm-pitch-high) {
  opacity: 0.4;
}

.apm-pitch-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mid);
  margin-bottom: 5px;
}

.apm-pitch-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dark);
}

.apm-priority-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.apm-priority-high { background: var(--lime);      color: var(--navy); }
.apm-priority-mid  { background: var(--sky);       color: var(--navy); }
.apm-priority-norm { background: var(--off-white); color: var(--text-mid); border: 1px solid var(--border); }

/* ── Empty / helper states ── */
.apm-empty-note {
  font-size: 12px;
  color: var(--text-mid);
  font-style: italic;
  margin: 0;
}

.apm-no-results {
  text-align: center;
  padding: 40px;
  color: var(--text-mid);
  font-style: italic;
}

/* Screen reader only */
.apm-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .apm-filter-bar          { padding: 8px 16px; border-radius: 6px; }
  .apm-month-header-bar    { flex-direction: column; }
  .apm-month-grid          { grid-template-columns: 1fr; }
  .apm-info-card           { border-right: none; border-bottom: 1px solid var(--border); }
  .apm-pitch-items         { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .apm-month-title-block h2 { font-size: 32px; }
  .apm-cal-day              { min-height: 50px; padding: 4px; }
  .apm-day-num              { font-size: 13px; }
  .apm-day-event            { font-size: 9px; -webkit-line-clamp: 2; }
  .apm-filter-bar-inner     { flex-direction: column; align-items: stretch; }
  .apm-filter-reset,
  .apm-high-opp-toggle      { width: 100%; text-align: center; margin-left: 0; }
  .apm-filter-select        { width: 100%; }
}
