/* TripReadyPack Modern Responsive Stylesheet */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  
  --coupang-orange: #cb1400;
  --coupang-bg: #fff1f0;
  --coupang-border: #ffccc7;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Pretendard Variable", "Pretendard", "Segoe UI", Roboto, "Helvetica Neue", "Apple SD Gothic Neo", sans-serif;
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e293b;
  --primary-border: #1e3a8a;
  
  --success: #34d399;
  --success-light: #064e3b;
  --warning: #fbbf24;
  --warning-light: #78350f;
  
  --bg-main: #0b1120;
  --bg-card: #151e32;
  --bg-card-subtle: #1e293b;
  --bg-input: #0f172a;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --border: #24324f;
  --border-focus: #60a5fa;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  
  --coupang-orange: #ff4d4f;
  --coupang-bg: #2a1215;
  --coupang-border: #5c181f;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Container */
.container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 14px 16px;
}

@media (min-width: 640px) {
  .container {
    padding: 20px 24px;
  }
}

/* Header */
header {
  margin-bottom: 18px;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.hero-section {
  text-align: left;
  padding: 16px 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .hero-section {
    padding: 20px 22px;
  }
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--bg-card);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.35;
  margin-bottom: 6px;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 1.45rem;
  }
}

.hero-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Destination Selector Grid (No horizontal scroll, fully responsive) */
.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.destinations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}

@media (min-width: 640px) {
  .destinations-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
  }
}

.dest-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 4px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  user-select: none;
}

.dest-btn:hover {
  border-color: var(--primary-border);
  background: var(--bg-card-subtle);
}

.dest-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

.dest-btn .flag {
  font-size: 1.05rem;
}

.dest-btn .dest-label {
  font-size: 0.82rem;
}

/* Progress Section */
.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .progress-card {
    padding: 16px 20px;
  }
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.progress-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-count {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  border-radius: var(--radius-full);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-status-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: right;
}

/* Toolbar: Search & Action Buttons */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.search-box {
  width: 100%;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--border-focus);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.9rem;
}

.toolbar-buttons {
  display: flex;
  gap: 6px;
  width: 100%;
}

.toolbar-buttons .btn {
  flex: 1;
  justify-content: center;
}

@media (min-width: 640px) {
  .toolbar {
    flex-direction: row;
    align-items: center;
  }
  .search-box {
    flex: 1;
  }
  .toolbar-buttons {
    width: auto;
  }
  .toolbar-buttons .btn {
    flex: initial;
  }
}

.btn {
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
}

.btn:hover {
  background: var(--bg-card-subtle);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

/* Category Block */
.category-group {
  margin-bottom: 22px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.category-name {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.category-badge {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Checklist Items */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  width: 100%;
}

@media (min-width: 640px) {
  .item-card {
    padding: 12px 14px;
    gap: 12px;
  }
}

.item-card:hover {
  border-color: var(--primary-border);
}

.item-card.checked {
  background: var(--bg-card-subtle);
  border-color: transparent;
  opacity: 0.85;
}

.item-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--text-light);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s ease;
}

.item-card.checked .item-checkbox {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.item-checkbox svg {
  width: 14px;
  height: 14px;
  display: none;
}

.item-card.checked .item-checkbox svg {
  display: block;
}

.item-content {
  flex: 1;
  min-width: 0;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.item-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  transition: color 0.15s ease;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.item-card.checked .item-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.item-badge-essential {
  font-size: 0.7rem;
  font-weight: 700;
  color: #e11d48;
  background: #ffe4e6;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

[data-theme="dark"] .item-badge-essential {
  background: #4c0519;
  color: #fda4af;
}

.item-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Coupang Action */
.item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.coupang-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--coupang-bg);
  border: 1px solid var(--coupang-border);
  color: var(--coupang-orange);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  max-width: 100%;
}

.coupang-link:hover {
  background: var(--coupang-orange);
  color: #ffffff;
  border-color: var(--coupang-orange);
}

.item-del-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.85rem;
  border-radius: 4px;
  margin-left: auto;
}

.item-del-btn:hover {
  color: #ef4444;
}

/* Add Custom Item Box (Fully Responsive) */
.add-custom-box {
  background: var(--bg-card);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.custom-input:focus {
  border-color: var(--border-focus);
}

.custom-controls {
  display: flex;
  gap: 6px;
  width: 100%;
}

.custom-category-select {
  flex: 1;
  min-width: 0;
  padding: 8px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
}

.add-custom-box .btn {
  padding: 8px 16px;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .add-custom-box {
    flex-direction: row;
    align-items: center;
  }
  .custom-input {
    flex: 1;
  }
  .custom-controls {
    width: auto;
  }
}

/* Bottom Notice Banner */
.notice-box {
  margin-top: 36px;
  padding: 14px 16px;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.notice-box strong {
  color: var(--text-main);
}

/* Floating Bottom Summary Bar */
.mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-info {
  display: flex;
  flex-direction: column;
}

.mobile-percent {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.mobile-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.mobile-actions {
  display: flex;
  gap: 6px;
}

.mobile-actions .btn {
  padding: 7px 11px;
  font-size: 0.8rem;
}

@media (min-width: 780px) {
  .mobile-bar {
    left: 50%;
    transform: translateX(-50%);
    max-width: 780px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #0f172a;
  color: #ffffff;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90%;
  text-align: center;
}

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

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding-bottom: 0;
  }
  .top-nav, .destinations-grid, .toolbar, .add-custom-box, .mobile-bar, .item-actions, .btn-icon {
    display: none !important;
  }
  .container {
    max-width: 100%;
    padding: 0;
  }
  .item-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    page-break-inside: avoid;
  }
}
