/* ============================================
   APP COMPONENTS
   Tabs, Calendar, Saved Panel, Toast, Modal
   ============================================ */

/* ---- HERO STATS ---- */
.hero-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 32px 0;
  flex-wrap: wrap;
}

.hero-stat-box {
  text-align: center;
  padding: 16px 24px;
  border: 1px solid var(--cream);
  border-radius: 6px;
  background: var(--white);
  min-width: 100px;
}

.hs-num {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--near-black);
}

.hs-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--taupe);
}

/* ---- TAB BAR ---- */
.tab-bar {
  position: sticky;
  top: 64px;
  z-index: 90;
  background: var(--ivory);
  border-bottom: 1px solid var(--cream);
}

.tab-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tab-row { display: flex; gap: 0; }

.tab {
  padding: 14px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: "Source Sans 3", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--taupe);
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover { color: var(--charcoal); }
.tab.active { color: var(--near-black); border-bottom-color: var(--near-black); }

.tab-actions { display: flex; gap: 8px; align-items: center; }

.saved-btn {
  padding: 8px 16px;
  background: none;
  border: 1px solid var(--sand);
  border-radius: 4px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--stone);
  cursor: pointer;
  transition: all 0.2s;
}

.saved-btn:hover { border-color: var(--charcoal); color: var(--charcoal); }

/* ---- TAB PANELS ---- */
.main-content { padding: 40px 0 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- EVENT CARD ENHANCEMENTS ---- */
.ec-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ec-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }

.ec-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--cream);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--taupe);
  transition: all 0.2s;
}

.ec-btn:hover { border-color: var(--charcoal); color: var(--charcoal); }
.ec-btn.saved { color: var(--error); border-color: var(--error); }

.ec-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--stone);
  padding: 4px 10px;
  border: 1px solid var(--cream);
  border-radius: 3px;
  white-space: nowrap;
}

.ec-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }

.ec-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid var(--cream);
  color: var(--stone);
}

.ec-badge--type { background: var(--near-black); color: var(--ivory); border-color: var(--near-black); }
.ec-badge--area { background: var(--ivory-warm); color: var(--stone); }

.event-site { font-size: 12px; margin-top: 2px; }
.event-site a { color: var(--gold-muted); }
.event-site a:hover { color: var(--charcoal); }

.past-tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--taupe);
  font-weight: 600;
  margin-left: 8px;
  font-family: "Source Sans 3", sans-serif;
}

/* ---- CALENDAR ---- */
.cal-legend { display: flex; gap: 20px; margin-bottom: 24px; font-size: 12px; color: var(--stone); }
.cal-legend-item { display: flex; align-items: center; gap: 6px; }
.cal-swatch { width: 16px; height: 16px; border-radius: 3px; border: 1px solid var(--cream); }
.cal-swatch--upcoming { background: var(--gold-faint); border-color: var(--gold-soft); }
.cal-swatch--past { background: var(--cream); }
.cal-swatch--today { outline: 2px solid var(--error); outline-offset: -2px; background: var(--white); }

.quarter { margin-bottom: 40px; }

.quarter-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--near-black);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sand);
  display: flex;
  align-items: center;
  gap: 12px;
}

.q-badge {
  background: var(--near-black);
  color: var(--ivory);
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 11px;
  font-family: "Source Sans 3", sans-serif;
  letter-spacing: 1px;
  font-weight: 600;
}

.months-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.month-card { background: var(--white); border-radius: 6px; border: 1px solid var(--cream); overflow: hidden; }

.mh {
  background: var(--near-black);
  color: var(--gold-soft);
  padding: 10px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.mh-past { background: var(--taupe); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 6px; }
.cd-h { text-align: center; font-size: 9px; font-weight: 600; color: var(--taupe); padding: 4px 0; text-transform: uppercase; letter-spacing: 0.5px; }
.cd { text-align: center; padding: 5px 2px; font-size: 12px; border-radius: 4px; position: relative; color: var(--charcoal); }
.cd-ev { background: var(--gold-faint); color: var(--near-black); font-weight: 700; cursor: pointer; }
.cd-ev:hover { background: var(--gold-soft); color: var(--white); }
.cd-past { background: var(--cream) !important; color: var(--taupe) !important; font-weight: 600; }
.cd-past:hover { background: var(--sand) !important; }
.cd-today { outline: 2px solid var(--error); outline-offset: -2px; }

.cd-dot { width: 4px; height: 4px; background: var(--gold-muted); border-radius: 50%; position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%); }
.cd-past .cd-dot { background: var(--taupe); }

.cd-count { position: absolute; top: 0; right: 1px; font-size: 7px; background: var(--error); color: white; width: 12px; height: 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.cd-past .cd-count { background: var(--taupe); }

/* Calendar tooltip */
.cal-tooltip {
  display: none; position: fixed;
  background: var(--near-black); color: var(--white);
  padding: 14px 18px; border-radius: 8px; font-size: 13px;
  max-width: 300px; z-index: 300;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2); pointer-events: none;
}
.cal-tooltip.visible { display: block; }
.tip-date { font-family: "Cormorant Garamond", Georgia, serif; font-size: 14px; color: var(--gold-soft); margin-bottom: 8px; }
.tip-ev { margin-bottom: 6px; line-height: 1.4; }
.tip-ev:last-child { margin-bottom: 0; }
.tip-org { font-size: 11px; color: rgba(255,255,255,0.5); }

/* ---- SAVED PANEL ---- */
.panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.25); z-index: 240; display: none; }
.panel-overlay.visible { display: block; }

.saved-panel {
  position: fixed; right: -400px; top: 0; width: 380px; height: 100vh;
  background: var(--white); box-shadow: -4px 0 30px rgba(0,0,0,0.1);
  z-index: 250; transition: right 0.3s ease; display: flex; flex-direction: column;
}
.saved-panel.open { right: 0; }

.sp-header { padding: 20px 24px; border-bottom: 1px solid var(--cream); display: flex; align-items: center; justify-content: space-between; }
.sp-header h3 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 20px; }
.sp-close { width: 32px; height: 32px; border-radius: 4px; border: 1px solid var(--cream); background: var(--white); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sp-close:hover { background: var(--ivory-warm); }

.sp-body { flex: 1; overflow-y: auto; padding: 16px 24px; }
.sp-footer { padding: 16px 24px; border-top: 1px solid var(--cream); }

.sp-item { padding: 14px 0; border-bottom: 1px solid var(--cream); }
.sp-item:last-child { border-bottom: none; }
.sp-name { font-weight: 600; font-size: 14px; color: var(--near-black); }
.sp-org { font-size: 12px; color: var(--gold-muted); margin-top: 2px; }
.sp-details { font-size: 12px; color: var(--stone); margin-top: 4px; }
.sp-actions { display: flex; gap: 6px; margin-top: 8px; }

.sp-btn {
  padding: 4px 10px; border-radius: 4px; border: 1px solid var(--cream);
  background: var(--white); font-size: 11px; font-family: "Source Sans 3", sans-serif;
  cursor: pointer; color: var(--stone); transition: all 0.2s;
}
.sp-btn:hover { border-color: var(--charcoal); color: var(--charcoal); }
.remove-dl:hover { border-color: var(--error) !important; color: var(--error) !important; }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--near-black); color: var(--ivory);
  padding: 12px 24px; border-radius: 6px;
  font-size: 14px; font-weight: 500; z-index: 400;
  transition: transform 0.3s ease;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  white-space: nowrap;
}
.toast.visible { transform: translateX(-50%) translateY(0); }

/* ---- ORG MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(28,27,25,0.4);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--white); padding: 32px; border-radius: 10px;
  width: 100%; max-width: 580px; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 16px 50px rgba(0,0,0,0.15); position: relative;
}

.modal-box h2 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 22px; padding-right: 36px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 4px;
  border: 1px solid var(--cream); background: var(--white);
  font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--ivory-warm); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .months-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .tab { padding: 12px 14px; font-size: 12px; }
  .hero-stats { gap: 10px; }
  .hero-stat-box { padding: 12px 16px; min-width: 70px; }
  .hs-num { font-size: 24px; }
  .saved-panel { width: 100%; right: -100%; }
  .ec-actions { flex-wrap: wrap; }
  .tab-bar { top: 0; }
}

/* ---- THIS WEEK SECTION ---- */
.this-week-section { margin-bottom: 20px; }

.this-week-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tw-card {
  background: var(--white);
  border: 1px solid var(--cream);
  border-radius: 6px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.tw-card:hover { box-shadow: 0 4px 16px rgba(28,27,25,0.06); }

.tw-date {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 6px;
}

.tw-card h4 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}

.tw-org { font-size: 13px; color: var(--gold-muted); font-weight: 500; }
.tw-venue { font-size: 12px; color: var(--stone); margin-top: 6px; }
.tw-price { font-size: 12px; font-weight: 600; color: var(--stone); margin-top: 4px; }

/* ---- EXCLUSIVE BADGE ---- */
.ec-badge--exclusive {
  background: var(--gold-muted);
  color: var(--white);
  border-color: var(--gold-muted);
  font-style: italic;
}

/* ---- INSIDER TIPS / BLOG ---- */
.insider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.insider-card {
  background: var(--white);
  border: 1px solid var(--cream);
  border-radius: 6px;
  padding: 24px;
  transition: box-shadow 0.2s;
}

.insider-card:hover { box-shadow: 0 4px 16px rgba(28,27,25,0.06); }

.insider-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold-muted);
  border: 1px solid var(--gold-soft);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.insider-card h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.insider-card p {
  font-size: 13px;
  color: var(--stone);
  line-height: 1.6;
  margin-bottom: 12px;
}

.insider-link {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--taupe);
  font-style: italic;
}

/* ---- NEWSLETTER POPUP ---- */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 27, 25, 0.45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 350;
  padding: 20px;
}

.popup-overlay.visible { display: flex; }

.popup-box {
  background: var(--white);
  border-radius: 10px;
  padding: 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--cream);
  background: var(--white);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-close:hover { background: var(--ivory-warm); }

.popup-box h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  margin-bottom: 10px;
}

.popup-box p {
  font-size: 14px;
  color: var(--stone);
  line-height: 1.6;
  margin-bottom: 20px;
}

.popup-form {
  display: flex;
  gap: 8px;
}

.popup-form input[type="email"] {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--sand);
  border-radius: 4px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 14px;
  outline: none;
}

.popup-form input[type="email"]:focus { border-color: var(--charcoal); }

.popup-form button {
  padding: 12px 20px;
  background: var(--near-black);
  color: var(--ivory);
  border: none;
  border-radius: 4px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.popup-form button:hover { background: var(--charcoal); }

.popup-note {
  display: block;
  font-size: 11px;
  color: var(--taupe);
  margin-top: 10px;
}

/* ---- RESPONSIVE ADDITIONS ---- */
@media (max-width: 768px) {
  .this-week-grid { grid-template-columns: 1fr; }
  .insider-grid { grid-template-columns: 1fr; }
  .popup-box { padding: 28px 20px; }
  .popup-form { flex-direction: column; }
}
