/* Event cards grid and mini-calendar styles */
.cards-grid {
  display: grid;
  /* make cards a bit wider so event cards have room */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

/* Alternative row layout: cards size to their content (used on Members) */
.cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}
.event-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
/* Make all event-cards visually consistent size */
.event-card {
  min-height: 360px; /* slightly smaller for a more normal look */
  box-sizing: border-box;
}
.event-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px }
.event-title { font-size:16px; margin:0; font-weight:700 }
.event-price { font-size:13px; color:#666 }
.event-title .vote-total { font-size:13px; color:#0a7a57; margin-left:8px; font-weight:700 }
.mini-calendar { border-radius:8px; padding:8px; background:#fbfbfb; margin-bottom:12px }
/* Reserve space for the mini-calendar so cards line up */
.mini-calendar { height: 220px; overflow: visible; }
.mc-header { font-size:13px; color:#333; text-align:center; margin-bottom:6px }
.mc-table { width:100%; border-collapse:collapse; font-size:12px; }
.mc-table th { color:#8a8a8a; font-weight:600; padding:2px 0; }
.mc-table td { width:14%; text-align:center; padding:4px 0; color:#333 }
.mc-day { cursor:pointer }
.mc-day-number { display:inline-flex; width:34px; height:34px; align-items:center; justify-content:center; border-radius:50%; }
.mc-day-number.chosen { background:#0a7a57; color:#fff; font-weight:700; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

.mc-nav { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px }
.mc-nav-btn { background:transparent; border:1px solid #e0e0e0; padding:4px 8px; border-radius:6px; cursor:pointer }
.mc-nav-label { flex:1; text-align:center; font-size:13px; color:#333 }
.book-btn { background:#0a7a57; color:#fff; border:0; padding:10px 12px; border-radius:20px; cursor:pointer; font-weight:600 }
.book-btn:hover { background:#046642 }

/* Reusable form select styling used on BookEvent and SendInvite pages */
.form-select {
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  display: block;
  width: 100%;
  max-width: 300px; /* slightly narrower */
  background: #fff;
  box-sizing: border-box;
}

/* Standard input styling to match select/button visuals */
.form-input {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  display: block;
  width: 100%;
  max-width: 300px;
  background: #fff;
  box-sizing: border-box;
  font-size: 14px;
}

.form-textarea {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  display: block;
  width: 100%;
  max-width: 480px;
  min-height: 120px;
  background: #fff;
  box-sizing: border-box;
  font-size: 14px;
  resize: vertical;
}

@media (max-width:480px) {
  .cards-grid { grid-template-columns: 1fr }
  .event-card { min-height: 380px }
  .mini-calendar { height: 200px }
}

/* Page-specific compacting for BookEvent page (moved from inline) */
.book-event-page .cards-grid {
  max-width: 1100px;
  margin: 0.5rem auto 1.5rem auto;
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
  justify-content: center;
}
.book-event-page .event-card { min-height: 420px; width: 320px; }
.book-event-page .mini-calendar { height: 220px }
.book-event-page .mc-day-number { width:34px; height:34px }
.book-event-page .book-btn { padding:10px 12px }

/* Planner table: make tables look like event-cards */
.planner-table {
  width: auto; /* let table size naturally */
  max-width: 1100px; /* cap width so it doesn't grow too large */
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  overflow: hidden;
  font-family: inherit;
  margin: 14px 0; /* keep natural width and align left */
}
.planner-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  color: #6b6b6b;
  background: #fafafa;
  font-weight: 700;
}
.planner-table tbody tr {
  border-top: 1px solid #f4f4f4;
}
.planner-table tbody tr:first-of-type {
  border-top: none;
}
.planner-table td {
  padding: 12px 16px;
  vertical-align: middle;
  font-size: 14px;
  color: #333;
}
/* Make select inputs and buttons visually consistent with cards */
.planner-table select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  background: #fff;
}
.planner-table input[type="date"] {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
}
.planner-table td .book-btn, .planner-table td button {
  background: #0a7a57;
  color: #fff;
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.planner-table td .book-btn:hover, .planner-table td button:hover { background: #046642 }

@media (max-width:600px) {
  .planner-table thead { display: none; }
  .planner-table, .planner-table tbody, .planner-table tr, .planner-table td { display: block; width: 100%; }
  .planner-table tr { margin-bottom: 12px; border-radius: 10px; border: 1px solid #e6e6e6; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
  .planner-table td { padding: 12px; }
}

/* Make the page-level action buttons match event-card green style */
#pushActivitiesBtn, #saveDatesBtn, #clearCalendarsBtn {
  background: #0a7a57;
  color: #fff;
  border: 0;
  padding: 10px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 700;
}
#pushActivitiesBtn:hover, #saveDatesBtn:hover, #clearCalendarsBtn:hover {
  background: #046642;
}

/* Small fallback for anchor buttons if any are used */
.green-btn, a.green-btn {
  display: inline-block;
  background: #0a7a57;
  color: #fff;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
}

/* Center action rows and nav links */
.actions-row {
  text-align: left;
  margin: 14px 0 14px 0;
}
.actions-row #pushActivitiesBtn,
.actions-row #saveDatesBtn,
.actions-row #clearCalendarsBtn {
  display: inline-block;
  margin: 0 8px;
}
.nav-links {
  text-align: left;
  margin-top: 12px;
}
.nav-links a { margin: 0 8px; display: inline-block }

/* Member table inside event-card */
.event-card .member-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background: transparent;
}
.event-card .member-table thead th {
  text-align: left;
  font-size: 14px;
  color: #7a7a7a;
  padding: 10px 12px;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid #f0f0f0;
}
.event-card .member-table {
  /* allow table to size naturally and wrap long content */
  table-layout: auto;
  width: auto; /* let table determine its own width */
  max-width: 460px; /* keep table from growing too wide inside a card */
}
.event-card .member-table thead th:first-child { width: 30%; }
.event-card .member-table thead th:nth-child(2) { width: 50%; }
.event-card .member-table thead th:nth-child(3) { width: 20%; }
.event-card .member-table td {
  padding: 10px 12px;
  font-size: 14px;
  color: #222;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  white-space: normal; /* default: allow wrapping for name column */
  word-break: break-word;
}
.event-card .member-table tr:last-child td { border-bottom: none }

/* Activity tables used on SendInvite right panel: narrower and single-column */
.event-card .activity-table {
  table-layout: auto;
  width: auto;
  max-width: 520px; /* increased width to be wider inside the card */
  border-collapse: collapse;
  margin-top: 8px;
  background: transparent;
}
.event-card .activity-table thead th {
  text-align: left;
  font-size: 14px;
  color: #7a7a7a;
  padding: 10px 12px;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid #f0f0f0;
}
.event-card .activity-table td {
  padding: 10px 12px;
  font-size: 14px;
  color: #222;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.event-card .activity-table tr:last-child td { border-bottom: none }

/* Keep email and phone in single line with ellipsis if too long */
.event-card .member-table td:nth-child(2),
.event-card .member-table td:nth-child(3) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keep name (first column) on a single line as well with ellipsis and tooltip support */
.event-card .member-table td:nth-child(1) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px; /* tune as needed */
}

/* Allow email/long text to wrap if you prefer wrapping instead of truncation,
   uncomment below and comment out the white-space/ellipsis rules above. */
/* .event-card .member-table td { white-space: normal; word-break: break-word; } */

/* Make cards more compact for members view */
.event-card { min-height: auto; padding: 18px; }
.event-card .event-title { font-size: 18px; margin-bottom: 6px }
.event-card .event-body { padding-top: 6px }

/* Variant for member cards: size to content (no forced min-height or flex spacing) */
.compact-card {
  min-height: 0 !important;
  height: auto !important;
  display: block !important;
  padding: 14px !important;
}
.compact-card .event-head { margin-bottom: 8px }
.compact-card .event-title { font-size: 18px; margin: 0 0 6px 0 }
.compact-card .event-body { padding-top: 0 }

/* Simple vote bar chart used under each event card */
.vote-chart {
  margin-top: 12px;
  width: 100%;
  max-width: 100%;
}
.vote-chart .chart {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding: 8px;
  border-radius: 6px;
  background: #fbfbfb;
}

.vote-chart .yaxis {
  width: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding-right: 8px;
  font-size: 12px;
  color: #666;
}

.vote-chart .yaxis {
  border-right: 1px solid rgba(0,0,0,0.08);
}

/* Remove the entire y-axis visual (numbers and dividing line) so the
   bars area can use the full width. Keep rule scoped to .vote-chart
   so other charts are unaffected. */
.vote-chart .yaxis { display: none !important; width: 0 !important; padding: 0 !important; margin: 0 !important; }

/* Remove left padding on the bars container so bars use the freed space */
.vote-chart .bars { padding-left: 0 !important; }

.vote-chart .bars {
  display: flex;
  gap: 8px;
  align-items: end;
  flex: 1 1 auto;
  height: 120px;
  align-self: stretch;
}

/* draw x-axis baseline above the labels */
.vote-chart .bars {
  position: relative;
  padding-bottom: 26px; /* reserve space for labels */
}
.vote-chart .bars::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px; /* line sits just above labels */
  height: 1px;
  background: rgba(0,0,0,0.06);
}

.vote-chart .bar {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

.vote-chart .bar-inner {
  flex: 1 1 auto; /* take remaining vertical space inside .bar */
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* anchor fill to bottom */
  align-items: center;
}

.vote-chart .bar .count {
  font-size: 12px;
  color: #0a7a57;
  margin-bottom: 6px;
  font-weight: 700;
}

.vote-chart .bar .fill {
  width: 60%;
  background: #0a7a57;
  border-radius: 6px 6px 0 0;
  transition: height 300ms ease;
  margin: 0 auto;
  min-height: 6px; /* show a thin bar even for zero values */
}

.vote-chart .bar .label {
  margin-top: 8px;
  font-size: 12px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.vote-chart .no-data { font-size: 13px; color: #666; margin-top:8px }
