/* ==============================
   TRAVEL BY MK — Packing Checklist
   Teal / White theme matching TravelByMK.com
   ============================== */

:root {
  --teal:         #2abfab;
  --teal-dark:    #1a9e8c;
  --teal-deeper:  #167a6c;
  --teal-light:   #e8faf7;
  --white:        #ffffff;
  --bg:           #f4f6f5;
  --text:         #1a2e2b;
  --text-muted:   #5a7a74;
  --danger:       #c0392b;
  --border:       rgba(42,191,171,0.25);
  --border-light: #ddecea;
  --radius:       8px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Sans 3', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- HEADER ---- */
header {
  background: var(--teal);
  border-bottom: 1px solid var(--teal-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--white);
  letter-spacing: 0.02em;
}
.tagline {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- BUTTONS ---- */
button {
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}
.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: var(--white);
  padding: 7px 14px;
}
.btn-outline:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.15);
}
.btn-primary {
  background: var(--teal);
  color: var(--white);
  padding: 8px 20px;
  font-weight: 600;
}
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost {
  background: transparent;
  color: var(--teal-dark);
  border: 1px dashed var(--border);
  padding: 10px 20px;
  width: 100%;
  letter-spacing: 0.04em;
}
.btn-ghost:hover {
  border-color: var(--teal);
  background: var(--teal-light);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  padding: 8px 20px;
  font-weight: 600;
}
.btn-danger:hover { background: #a93226; }

/* ---- PROGRESS ---- */
.progress-bar-wrap {
  max-width: 640px;
  margin: 20px auto 0;
  padding: 0 20px;
}
.progress-bar-track {
  background: var(--border-light);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-dark), var(--teal));
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s ease;
}
.progress-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* ---- MAIN ---- */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

/* ---- CATEGORY CARD ---- */
.category-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--teal-light);
}
.category-header:hover { background: #d4f3ee; }

.category-chevron {
  font-size: 0.7rem;
  color: var(--teal-dark);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.category-card.collapsed .category-chevron { transform: rotate(-90deg); }

.category-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--teal-deeper);
  flex: 1;
  letter-spacing: 0.02em;
}
.category-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 4px;
}
.category-edit-btn, .category-delete-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
}
.category-edit-btn:hover { color: var(--teal-dark); }
.category-delete-btn:hover { color: var(--danger); }

/* ---- ITEMS ---- */
.category-body {
  border-top: 1px solid var(--border-light);
  padding: 8px 0;
}
.category-card.collapsed .category-body { display: none; }

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  transition: background 0.15s;
}
.item-row:hover { background: var(--teal-light); }

.item-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--border-light);
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.15s;
}
.item-checkbox:checked {
  background: var(--teal);
  border-color: var(--teal);
}
.item-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 3px;
  font-size: 13px;
  color: var(--white);
  font-weight: 700;
}

.item-label {
  flex: 1;
  font-size: 0.92rem;
  color: var(--text);
  transition: color 0.2s, text-decoration 0.2s;
}
.item-row.packed .item-label {
  color: var(--text-muted);
  text-decoration: line-through;
}

.item-edit-btn, .item-delete-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 4px;
  border: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.item-row:hover .item-edit-btn,
.item-row:hover .item-delete-btn { opacity: 1; }
.item-edit-btn:hover { color: var(--teal-dark); }
.item-delete-btn:hover { color: var(--danger); }

/* Add item row */
.add-item-row {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
}
.add-item-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 7px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.add-item-input::placeholder { color: var(--text-muted); }
.add-item-input:focus { border-color: var(--teal); }
.add-item-btn {
  background: var(--teal);
  color: var(--white);
  padding: 7px 14px;
  font-weight: 700;
  border-radius: var(--radius);
  font-size: 1rem;
}
.add-item-btn:hover { background: var(--teal-dark); }

/* ---- ADD CATEGORY ---- */
.add-category-wrap {
  margin-top: 8px;
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--teal-deeper);
  margin-bottom: 14px;
}
.modal-msg {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.modal-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 9px 14px;
  margin-bottom: 16px;
  outline: none;
}
.modal-input:focus { border-color: var(--teal); }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---- FOOTER ---- */
footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 20px 30px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}
footer a { color: var(--teal-dark); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.install-hint {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
  .brand { font-size: 1rem; }
  .item-edit-btn, .item-delete-btn { opacity: 1; }
}
