/* Custom styles supplementing Tailwind */

:root {
  --green: #d4edda;
  --green-border: #28a745;
  --purple: #e8d5f5;
  --purple-border: #7b2d8e;
  --blue: #d1ecf1;
  --blue-border: #17a2b8;
  --grey: #e9ecef;
  --grey-border: #adb5bd;
}

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8f9fa;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  padding-top: env(safe-area-inset-top);
}

/* Day tabs horizontal scroll */
.day-tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 4px;
  padding: 8px;
}
.day-tabs::-webkit-scrollbar { display: none; }

.day-tab {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  background: white;
  border: 2px solid #dee2e6;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  min-width: 56px;
  transition: all 0.15s;
}
.day-tab.active {
  background: #0d6efd;
  color: white;
  border-color: #0d6efd;
}
.day-tab .badge {
  display: inline-block;
  background: #0d6efd;
  color: white;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  margin-left: 4px;
}
.day-tab.active .badge {
  background: white;
  color: #0d6efd;
}

/* Points budget bar */
.budget-bar {
  height: 8px;
  border-radius: 4px;
  background: #e9ecef;
  overflow: hidden;
}
.budget-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s, background-color 0.3s;
}

/* Activity list — compact rows */
.activity-list {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Activity card (wrapper) */
.act-card {
  border-bottom: 1px solid #f1f3f5;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}
.act-card:last-child { border-bottom: none; }
.act-card.booked     { border-left-color: var(--green-border); background: var(--green); }
.act-card.waiting    { border-left-color: var(--purple-border); background: var(--purple); }
.act-card.highlighted{ border-left-color: var(--blue-border); background: var(--blue); }
.act-card.greyed-out { border-left-color: var(--grey-border); background: var(--grey); opacity: 0.55; }

/* Line 1: compact row */
.act-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  min-height: 44px;
  cursor: pointer;
  user-select: none;
}
.act-row:active { background: rgba(0,0,0,0.03); }

.act-time {
  font-size: 10px;
  font-weight: 600;
  color: #6c757d;
  white-space: nowrap;
  min-width: 38px;
  font-variant-numeric: tabular-nums;
}
.act-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: #212529;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.act-status {
  border-radius: 6px;
  border: 1.5px solid #dee2e6;
  background: white;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  padding: 6px 10px;
  min-height: 28px;
  transition: all 0.12s;
  user-select: none;
  white-space: nowrap;
  -webkit-touch-callout: none;
}
.act-status:active { transform: scale(0.93); }
.act-status.sc-green  { background: var(--green);  border-color: var(--green-border); color: #155724; }
.act-status.sc-purple { background: var(--purple); border-color: var(--purple-border); color: #4a1259; }
.act-status.sc-blue   { background: var(--blue);   border-color: var(--blue-border); color: #0c5460; }
.act-status.sc-grey   { background: var(--grey);   border-color: var(--grey-border); color: #495057; }

/* Points tap-to-cycle badge */
.act-pts {
  border-radius: 6px;
  border: 1.5px solid #dee2e6;
  background: white;
  font-size: 10px;
  font-weight: 700;
  color: #adb5bd;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px 8px;
  min-height: 28px;
  transition: all 0.12s;
  user-select: none;
  white-space: nowrap;
  -webkit-touch-callout: none;
}
.act-pts:active { transform: scale(0.93); }
.act-pts.has-pts { background: #fff3cd; border-color: #ffc107; color: #856404; }

/* Fullness badge */
.act-full {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  min-width: 28px;
  min-height: 22px;
  text-align: center;
  line-height: 18px;
}
.act-full.full-empty { background: #f1f3f5; color: #adb5bd; }
.act-full.full-ok    { background: #d4edda; color: #155724; }
.act-full.full-amber { background: #fff3cd; color: #856404; }
.act-full.full-red   { background: #f8d7da; color: #721c24; }

/* Line 2: expanded detail */
.act-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 6px;
  border-top: 1px dashed #e9ecef;
  flex-wrap: wrap;
}
.act-loc {
  font-size: 10px;
  color: #6c757d;
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
/* ==================== Fullness edit sheet ==================== */
.fe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 999;
}
.fe-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 16px 16px;
  padding: calc(12px + env(safe-area-inset-top)) 20px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform .25s ease-out;
}
.fe-sheet-open {
  transform: translateY(0);
}
.fe-sheet-title {
  font-size: 14px;
  font-weight: 600;
  color: #212529;
  margin-bottom: 16px;
  text-align: center;
}
.fe-sheet-fields {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}
.fe-sheet-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.fe-sheet-label span {
  font-size: 11px;
  color: #868e96;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fe-sheet-label input {
  width: 72px;
  height: 48px;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  background: #f8f9fa;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: #212529;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
.fe-sheet-label input:focus {
  outline: none;
  border-color: #0d6efd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}
.fe-sheet-slash {
  font-size: 28px;
  color: #adb5bd;
  font-weight: 300;
  padding-bottom: 6px;
}
.fe-sheet-save {
  width: 100%;
  padding: 14px;
  background: #0d6efd;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fe-sheet-save:active {
  background: #0b5ed7;
}
.act-notes {
  flex: 1;
  min-width: 60px;
  border: none;
  border-bottom: 1px dashed #ccc;
  background: transparent;
  font-size: 10px;
  color: #495057;
  padding: 2px 0;
  border-radius: 0;
}
.act-notes:focus { outline: none; border-bottom-color: #0d6efd; background: #f0f4ff; }
.act-notes::placeholder { color: #ccc; }
.act-del {
  background: none;
  border: none;
  font-size: 16px;
  color: #ccc;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  -webkit-touch-callout: none;
}
.act-del:hover, .act-del:active { color: #dc3545; }

/* Padel camp block (used by manual add) */
.padel-block {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Inline editable field */
.inline-edit {
  border: none;
  border-bottom: 1px dashed #adb5bd;
  background: transparent;
  font-size: 13px;
  padding: 2px 4px;
  width: 48px;
  text-align: center;
  border-radius: 0;
}
.inline-edit:focus {
  outline: none;
  border-bottom-color: #0d6efd;
  background: #f0f4ff;
}

.notes-input {
  border: 1px dashed #ced4da;
  background: transparent;
  font-size: 13px;
  padding: 4px 8px;
  width: 100%;
  border-radius: 6px;
  resize: none;
}
.notes-input:focus {
  outline: none;
  border-color: #0d6efd;
  background: #f8f9ff;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #dee2e6;
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.bottom-nav button {
  flex: 1;
  padding: 10px 0 8px;
  text-align: center;
  font-size: 11px;
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
}
.bottom-nav button.active {
  color: #0d6efd;
  font-weight: 600;
}
.bottom-nav .nav-icon {
  font-size: 20px;
  display: block;
  margin-bottom: 2px;
}

/* Filters bar */
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  border: 1px solid #dee2e6;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip.active {
  background: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

/* Import */
.import-textarea {
  width: 100%;
  min-height: 150px;
  border: 2px dashed #ced4da;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  font-family: monospace;
  resize: vertical;
}
.import-textarea:focus {
  outline: none;
  border-color: #0d6efd;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-content {
  background: white;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

/* Summary table */
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f1f3f5;
  align-items: center;
}
