/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Nunito", sans-serif;
  background: linear-gradient(160deg, #f7d6dc 0%, #e8a0b0 40%, #c9728a 100%);
  min-height: 100vh;
  color: #2d1a22;
  overflow-x: hidden;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 660px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

/* ===== HEADER ===== */
header {
  text-align: center;
  padding: 30px 0 10px;
  animation: fadeDown 0.6s ease both;
}

h1 {
  font-family: "Pacifico", cursive;
  font-size: 2.8rem;
  margin: 0;
  color: #fff;
  text-shadow: 0 4px 16px rgba(180,60,90,0.3);
  letter-spacing: 2px;
}

h1 .heart {
  display: inline-block;
  animation: heartbeat 1.4s ease-in-out infinite;
}

.subtitle {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin: 4px 0 0;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  display: block;
}

/* ===== CARDS ===== */
.card {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 6px 24px rgba(180,60,90,0.13);
  animation: fadeUp 0.5s ease both;
}

.card:nth-child(2) { animation-delay: 0.07s; }
.card:nth-child(3) { animation-delay: 0.14s; }
.card:nth-child(4) { animation-delay: 0.21s; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

.card-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #2d1a22;
  flex: 1;
}

/* ===== TOGGLE / CHEVRON ===== */
.toggle {
  cursor: pointer;
  user-select: none;
}

.chevron {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 0.85rem;
  color: #c9728a;
}

.chevron.open {
  transform: rotate(180deg);
}

/* ===== COLLAPSIBLE ===== */
.collapsible {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
}

.collapsible.open {
  max-height: 2400px;
  overflow: visible; /* allow dropdowns to escape the box */
  opacity: 1;
}

/* ===== FORM ===== */
.form-inner {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

input, select {
  width: 100%;
  padding: 13px 16px;
  margin: 7px 0;
  border-radius: 16px;
  border: 1.5px solid rgba(200,80,120,0.2);
  background: rgba(255,255,255,0.75);
  color: #2d1a22;
  font-size: 15px;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 2px 8px rgba(180,60,90,0.06);
}

input:focus, select:focus {
  border: 1.5px solid rgba(200,80,120,0.6);
  box-shadow: 0 0 0 4px rgba(200,80,120,0.12);
  background: rgba(255,255,255,0.65);
}

input::placeholder {
  color: rgba(45,26,34,0.45);
  font-weight: 500;
}

.row-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.row-inputs select {
  margin: 7px 0;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.form-actions .primaryBtn,
.form-actions .secondaryBtn {
  flex: 1;
  width: auto;
}

/* ===== BUTTONS ===== */
.primaryBtn {
  flex: 1;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #e8809a, #c9567a);
  color: #fff !important;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(180,60,90,0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  display: block;
  text-align: center;
}

.primaryBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(180,60,90,0.35);
  filter: brightness(1.05);
}

.primaryBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(180,60,90,0.2);
}

.primaryBtn.danger {
  background: linear-gradient(135deg, #e07070, #c03030);
  box-shadow: 0 4px 14px rgba(180,40,40,0.25);
}

.secondaryBtn {
  flex: 1;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(200,80,120,0.35);
  background: rgba(255,255,255,0.4);
  color: #c9567a;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.secondaryBtn:hover {
  background: rgba(255,255,255,0.6);
  transform: translateY(-1px);
}

/* shake animation for random button */
.shake-btn {
  margin-top: 14px;
}

.shake-btn:hover .btn-icon {
  display: inline-block;
  animation: shake 0.5s ease;
}

/* ===== MULTI-SELECT DROPDOWNS ===== */
.random-filters {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.random-filters .multi-select-wrap {
  flex: 1;
  min-width: 140px;
}

.multi-select-wrap {
  position: relative;
}

.multi-select-btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(200,80,120,0.2);
  background: rgba(255,255,255,0.75);
  color: #2d1a22;
  font-size: 14px;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(180,60,90,0.06);
  transition: border 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
}

.multi-select-btn:hover {
  border-color: rgba(200,80,120,0.5);
  box-shadow: 0 0 0 3px rgba(200,80,120,0.1);
}

.drop-arrow {
  font-size: 12px;
  color: #c9728a;
  flex-shrink: 0;
}

.multi-select-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  background: rgba(255,255,255,0.98);
  border: 1.5px solid rgba(200,80,120,0.2);
  border-radius: 16px;
  padding: 8px 6px;
  z-index: 200;
  box-shadow: 0 8px 28px rgba(180,60,90,0.18);
  animation: fadeUp 0.15s ease both;
  min-width: 180px;
  width: max-content;
  max-width: 260px;
}

.drop-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #2d1a22;
  transition: background 0.15s ease;
  user-select: none;
}

.drop-option:hover {
  background: rgba(200,80,120,0.08);
}

.drop-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #c9567a;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  border: none;
}

/* ===== ACTIVE FILTER CHIPS ===== */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(200,80,120,0.12);
  border: 1px solid rgba(200,80,120,0.25);
  color: #a0405a;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.filter-chip:hover {
  background: rgba(200,80,120,0.22);
}

/* ===== RANDOM OPTIONS ===== */
.random-options {
  margin-top: 14px;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.6);
  border: 1.5px solid rgba(200,80,120,0.2);
  border-radius: 50px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: #2d1a22;
  transition: background 0.2s ease, border 0.2s ease;
  user-select: none;
  line-height: 1;
}

.toggle-pill:hover {
  background: rgba(255,255,255,0.85);
}

.toggle-pill input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #c9567a;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}

/* ===== RESULT CARD ===== */
.resultCard {
  margin-top: 14px;
  border-radius: 18px;
  overflow: hidden;
  animation: flipIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.result-inner {
  padding: 16px 18px;
  background: rgba(255,245,248,0.95);
  border: 1px solid rgba(200,80,120,0.15);
  border-radius: 18px;
}

.resultTitle {
  font-size: 1.2rem;
  font-weight: 800;
  color: #2d1a22;
  margin-bottom: 5px;
}

.resultDesc {
  font-size: 0.9rem;
  color: rgba(45,26,34,0.7);
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 10px;
}

.result-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== BADGES ===== */
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 50px;
  display: inline-block;
}

.badge:empty {
  display: none;
}

.badge-cat {
  background: rgba(200,80,120,0.15);
  color: #a0405a;
}

.badge-budget {
  background: rgba(100,180,100,0.15);
  color: #3a7a3a;
}

.badge-loc {
  background: rgba(80,140,220,0.15);
  color: #2a5a9a;
}

.badge-dur {
  background: rgba(160,100,220,0.13);
  color: #6a30a0;
}

/* ===== COUNT BADGE ===== */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8809a, #c9567a);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  border-radius: 50px;
  padding: 0 6px;
  vertical-align: middle;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  padding: 14px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-input {
  width: 100%;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (min-width: 520px) {
  .filter-row {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

/* ===== LIST ===== */
#dateList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.date-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 13px 14px;
  margin-top: 10px;
  border-radius: 16px;
  background: rgba(255,245,248,0.9);
  border: 1px solid rgba(200,80,120,0.12);
  animation: fadeUp 0.3s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.date-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(180,60,90,0.1);
}

.date-item.removing {
  animation: fadeOut 0.3s ease forwards;
}

.item-content strong {
  font-size: 15px;
  font-weight: 800;
  display: block;
  margin-bottom: 3px;
}

.item-content small {
  font-size: 13px;
  color: rgba(45,26,34,0.65);
  font-weight: 600;
  line-height: 1.4;
  display: block;
  margin-bottom: 7px;
}

.item-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 10px;
}

.iconBtn {
  border: none;
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.iconBtn:hover {
  background: rgba(255,255,255,0.85);
  transform: scale(1.1);
}

.iconBtn:active {
  transform: scale(0.95);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 30px 0 10px;
  color: rgba(45,26,34,0.55);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
  animation: heartbeat 1.8s ease-in-out infinite;
}

.empty-state p {
  font-weight: 700;
  font-size: 14px;
  margin: 0;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(200,100,130,0.15);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255,255,255,0.4);
  border-top-color: #c9567a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45,26,34,0.35);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: rgba(255,255,255,0.92);
  border-radius: 24px;
  padding: 32px 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(45,26,34,0.2);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.modal-box p {
  font-weight: 700;
  font-size: 15px;
  color: #2d1a22;
  margin: 0 0 20px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

/* ===== TOAST ===== */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: linear-gradient(135deg, #2d1a22, #4a2535);
  color: white;
  padding: 11px 22px;
  border-radius: 50px;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 300;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(45,26,34,0.3);
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== HIDDEN ===== */
.hidden {
  display: none !important;
}

/* ===== TAB BAR ===== */
.tab-bar {
  display: flex;
  gap: 8px;
  margin: 14px 0 0;
}

.tab-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(200,80,120,0.2);
  background: rgba(255,255,255,0.4);
  color: rgba(45,26,34,0.55);
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.65);
  color: #2d1a22;
}

.tab-btn.active {
  background: linear-gradient(135deg, #e8809a, #c9567a);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(180,60,90,0.3);
}

/* ===== DONE TAB ===== */
.done-header {
  padding: 10px 0 4px;
}

.done-subtitle {
  font-weight: 700;
  font-size: 13px;
  color: rgba(45,26,34,0.55);
  margin: 0;
  text-align: center;
}

.done-item {
  opacity: 0.75;
}

.done-item .item-content strong {
  text-decoration: line-through;
  color: rgba(45,26,34,0.5);
}

.done-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(60,180,100,0.15);
  color: #2a7a50;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 50px;
}

/* ===== VISUAL FEEDBACK: CHECKED DROPDOWN OPTIONS ===== */
.drop-option:has(input:checked) {
  background: rgba(200,80,120,0.1);
  color: #a0405a;
}

.drop-option input[type="checkbox"]:checked + * {
  color: #a0405a;
}

.drop-option {
  position: relative;
}

.drop-option::after {
  content: '';
  display: none;
}

/* Checked checkmark indicator */
.drop-option:has(input:checked)::before {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 900;
  color: #c9567a;
}

/* ===== MULTI-SELECT BUTTON ACTIVE STATE ===== */
.multi-select-btn.has-selection {
  border-color: rgba(200,80,120,0.55);
  background: rgba(200,80,120,0.08);
  color: #a0405a;
  box-shadow: 0 0 0 3px rgba(200,80,120,0.12);
}

/* ===== HIDE DONE PILL ===== */
.hide-done-pill {
  align-self: flex-start;
}

/* ===== Z-INDEX FIX ===== */
.card {
  position: relative;
}

/* Cards must NOT clip their dropdowns */
.card,
.collapsible,
.filter-bar,
.filter-row,
.random-filters {
  overflow: visible;
}

.multi-select-wrap {
  position: relative;
  z-index: 1;
}

/* Boost stacking context of the wrap that has an open dropdown */
.multi-select-wrap:focus-within {
  z-index: 100;
}

.multi-select-drop {
  z-index: 200;
}

/* ===== FAVORITE TOGGLE FEEDBACK ===== */
.iconBtn.is-fav {
  background: rgba(255, 220, 230, 0.8);
}

.iconBtn.is-fav:hover {
  background: rgba(255, 200, 215, 0.95);
}

/* ===== DONE BUTTON — SVG icon states ===== */
.done-btn {
  position: relative;
}

.done-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.done-btn:hover .done-icon-wrap {
  transform: scale(1.15);
}

.done-btn:hover:not(.is-done) .done-icon-wrap svg circle {
  stroke: #c9567a;
}

.done-btn:hover:not(.is-done) .done-icon-wrap svg path {
  stroke: #c9567a;
}

/* Active / checked state */
.done-btn.is-done {
  background: rgba(60, 180, 100, 0.15);
}

.done-btn.is-done:hover {
  background: rgba(60, 180, 100, 0.25);
}

/* Pulse animation when toggled on */
@keyframes donePopin {
  0%   { transform: scale(0.7); opacity: 0.3; }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1);    opacity: 1; }
}

.done-btn.is-done .done-icon-wrap {
  animation: donePopin 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

@keyframes flipIn {
  from { opacity: 0; transform: rotateX(-20deg) scale(0.96); }
  to   { opacity: 1; transform: rotateX(0deg) scale(1); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  30%       { transform: scale(1.2); }
  60%       { transform: scale(1.05); }
}

@keyframes shake {
  0%, 100% { transform: rotate(0); }
  20%       { transform: rotate(-12deg); }
  40%       { transform: rotate(10deg); }
  60%       { transform: rotate(-8deg); }
  80%       { transform: rotate(6deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
