/* ============================================
   배켠의 버킷리스트 도전기 — Toss Style UI
   ============================================ */

/* ─── RESET & BASE ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Toss Light Theme Colors */
  --bg-deep: #f2f4f6; /* 바탕 회색 */
  --bg-card: #ffffff; /* 흰색 카드 */
  --bg-card-hover: #f9fafb;
  --border: #e5e8eb;
  
  /* Toss Brand Colors */
  --blue: #3182f6;
  --blue-hover: #1b64da;
  --blue-bg: rgba(49, 130, 246, 0.1);
  --red: #f04452;
  --red-bg: rgba(240, 68, 82, 0.1);
  --green: #258140;
  
  /* Text Colors */
  --text-primary: #333d4b;
  --text-secondary: #6b7684;
  --text-muted: #8b95a1;

  --gradient-main: linear-gradient(135deg, #3182f6, #1b64da);

  /* Structure */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  /* Shadows */
  --shadow-card: 0 4px 16px rgba(0,0,0,0.04);
  --shadow-float: 0 8px 30px rgba(0,0,0,0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── NAVBAR ─── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}

.nav-logo-icon {
  font-size: 20px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-progress-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-progress-bar-bg {
  width: 180px;
  height: 8px;
  background: #f2f4f6;
  border-radius: 99px;
  overflow: hidden;
}

.nav-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 55px;
}

.nav-bell-btn {
  position: relative;
  background: var(--blue-bg);
  border: none;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-bell-btn:hover {
  background: rgba(49, 130, 246, 0.15);
  transform: scale(1.05);
}

.nav-bell-btn.has-requests {
  animation: bellShake 2s ease-in-out infinite;
}

@keyframes bellShake {
  0%, 90%, 100% { transform: rotate(0); }
  92% { transform: rotate(-12deg); }
  96% { transform: rotate(12deg); }
}

.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 4px rgba(240, 68, 82, 0.3);
}

.nav-logout-btn {
  background: #f2f4f6;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-logout-btn:hover {
  background: #e5e8eb;
  color: var(--text-primary);
}

/* ─── HERO ─── */
#hero {
  position: relative;
  padding: 140px 40px 80px;
  text-align: center;
  overflow: hidden;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: var(--blue-bg);
  color: var(--blue);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(36px, 6vw, 54px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -1px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero-title-highlight {
  color: var(--blue);
}

.hero-desc {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 48px;
  font-weight: 500;
}

/* Progress Area */
.progress-showcase {
  display: flex;
  align-items: center;
  gap: 60px;
  margin-bottom: 48px;
}

.progress-circle-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
}

.progress-ring {
  width: 220px;
  height: 220px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: #f2f4f6;
  stroke-width: 14;
}

.ring-progress {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.progress-percent {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1px;
}

.progress-percent-sign {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-left: 2px;
}

.progress-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Stats */
.progress-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 200px;
  box-shadow: var(--shadow-card);
}

.stat-icon {
  font-size: 24px;
  background: #f2f4f6;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.stat-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-name {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.hero-cta {
  display: inline-block;
  background: var(--text-primary);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  padding: 16px 32px;
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ─── BUCKET LIST SECTION ─── */
#bucketlist {
  position: relative;
  z-index: 1;
  padding: 80px 40px;
}

.section-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 32px;
  text-align: left;
}

.section-label {
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
}

/* Add Item Bar */
.add-item-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.add-item-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 16px;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
}

.add-item-input::placeholder { color: var(--text-muted); }

.add-item-btn {
  background: var(--blue);
  border: none;
  border-radius: 12px;
  padding: 0 24px;
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.add-item-btn:hover { background: var(--blue-hover); }

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover { background: #f9fafb; color: var(--text-primary); }
.filter-tab.active { background: var(--text-primary); color: white; border-color: var(--text-primary); }

/* Grid & Cards */
.bucket-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bucket-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: slideIn 0.4s ease backwards;
}

.bucket-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float);
}

.bucket-item.completed {
  background: #f9fafb;
  box-shadow: none;
  border: 1px solid var(--border);
}

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

.item-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 24px;
}

.item-checkbox {
  width: 28px;
  height: 28px;
  border: 2px solid #d1d6db;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: #ffffff;
}

.item-checkbox:hover { border-color: var(--blue); }

.item-checkbox.checked {
  background: var(--blue);
  border-color: var(--blue);
}

.item-checkbox.checked::after {
  content: '✓';
  color: white;
  font-weight: 800;
  font-size: 16px;
}

.item-body {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
  gap: 16px;
}

.item-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  transition: color 0.2s;
}

.bucket-item.completed .item-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

.item-actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.bucket-item:hover .item-actions { opacity: 1; }

.item-action-btn {
  background: #f2f4f6;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.item-action-btn:hover { background: #e5e8eb; color: var(--text-primary); }
.item-action-btn.delete:hover { background: var(--red-bg); color: var(--red); }

/* ─── SUGGEST SECTION (Viewer) ─── */
.suggest-section {
  padding: 0 40px 80px;
}

.suggest-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.suggest-header { margin-bottom: 24px; }

.suggest-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.suggest-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.suggest-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.suggest-input-row { display: flex; gap: 10px; }

.suggest-input {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s;
  width: 100%;
  max-width: 180px;
}

.suggest-main-input { flex: 1; max-width: none; }
.suggest-input:focus { background: #ffffff; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }

.suggest-submit-btn {
  background: var(--blue);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.suggest-submit-btn:hover { background: var(--blue-hover); }

.suggest-success { text-align: center; padding: 20px 0; }
.suggest-success-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.suggest-success p { font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.suggest-success-sub { font-size: 14px; color: var(--text-secondary); font-weight: normal; margin-bottom: 16px; }

.suggest-again-btn {
  background: #f2f4f6;
  border: none;
  border-radius: 99px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

/* Viewer Requests List */
.viewer-requests-section { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 24px; }
.viewer-requests-divider { font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-bottom: 16px; }

.viewer-requests-list { display: flex; flex-direction: column; gap: 12px; }

.viewer-request-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
  border-radius: var(--radius-sm);
}

.viewer-req-num { font-weight: 700; color: var(--text-muted); font-size: 13px; }
.viewer-req-body { flex: 1; }
.viewer-req-text { font-size: 15px; color: var(--text-primary); margin-bottom: 4px; }
.viewer-req-meta { font-size: 12px; color: var(--text-secondary); display: flex; gap: 6px; }
.viewer-req-nick { font-weight: 600; color: var(--text-primary); }

/* ─── MODALS & LOGIN OVERLAY ─── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #f2f4f6;
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow-float);
}

.login-logo { font-size: 48px; margin-bottom: 16px; display: block; }

.login-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.3;
}

.login-title-hl { color: var(--blue); }

.login-subtitle { font-size: 15px; color: var(--text-secondary); margin-bottom: 32px; }

.login-modes { display: flex; flex-direction: column; gap: 12px; }

.login-btn-admin, .login-btn-viewer {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  background: #ffffff;
  transition: all 0.2s;
}

.login-btn-admin:hover, .login-btn-viewer:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(49, 130, 246, 0.1);
  transform: translateY(-2px);
}

.login-btn-icon { font-size: 24px; }
.login-btn-info { display: flex; flex-direction: column; gap: 4px; }
.login-btn-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.login-btn-sub { font-size: 13px; color: var(--text-secondary); }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  margin: 8px 0;
}

.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-password-form { text-align: left; }
.pw-back-btn { background: none; border: none; color: var(--text-secondary); font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 24px; }
.pw-back-btn:hover { color: var(--text-primary); }
.pw-label { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

.pw-input-wrap { display: flex; gap: 8px; }
.pw-input { flex: 1; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; outline: none; background: #f9fafb; transition: all 0.2s; }
.pw-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); background: #ffffff; }

.pw-submit-btn { background: var(--text-primary); color: white; border: none; padding: 0 24px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; }

/* General Modals */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-float);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.open .modal-box { transform: scale(1); }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 800; }
.modal-close-btn { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; }

.modal-input { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 16px; margin-bottom: 24px; outline: none; background: #f9fafb; transition: all 0.2s; }
.modal-input:focus { border-color: var(--blue); background: #ffffff; }

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal-btn-cancel { padding: 12px 20px; background: #f2f4f6; border: none; border-radius: var(--radius-sm); font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.modal-btn-save { padding: 12px 24px; background: var(--blue); border: none; border-radius: var(--radius-sm); font-weight: 700; color: white; cursor: pointer; }

/* Requests Modal List */
.requests-modal-box { max-width: 500px; }
.requests-modal-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.requests-list { display: flex; flex-direction: column; gap: 12px; max-height: 400px; overflow-y: auto; }
.request-card { background: #f9fafb; border-radius: var(--radius-sm); padding: 16px; border: 1px solid var(--border); }
.request-card-top { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.request-nickname { font-size: 12px; font-weight: 700; color: var(--blue); }
.request-text { font-size: 16px; font-weight: 500; color: var(--text-primary); }
.request-actions { display: flex; gap: 8px; justify-content: flex-end; }
.req-btn-approve { background: rgba(37, 129, 64, 0.1); color: var(--green); border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; }
.req-btn-reject { background: var(--red-bg); color: var(--red); border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; }

/* ─── OTHERS ─── */
.viewer-banner {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: white;
  padding: 12px 24px; border-radius: 99px;
  font-size: 14px; font-weight: 600; z-index: 200;
  box-shadow: var(--shadow-float);
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 16px; }
.empty-state p { font-size: 16px; font-weight: 500; }

.loading-state { text-align: center; padding: 80px 20px; color: var(--text-secondary); font-weight: 500; }

/* ─── FOOTER ─── */
#footer { text-align: center; padding: 40px; border-top: 1px solid var(--border); background: #f2f4f6; }
.footer-logo { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.footer-quote { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.footer-copy { font-size: 13px; color: var(--text-muted); }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d6db; border-radius: 99px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  #navbar { padding: 12px 20px; }
  .nav-progress-bar-bg { width: 100px; }
  #hero { padding: 100px 20px 40px; }
  .hero-title { font-size: 32px; }
  .progress-showcase { flex-direction: column; gap: 32px; }
  .progress-stats { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .stat-card { min-width: 140px; }
  #bucketlist { padding: 40px 20px; }
  .add-item-bar { flex-direction: column; }
  .add-item-btn { padding: 14px; }
  .item-actions { opacity: 1; }
  
  .suggest-section { padding: 0 20px 60px; }
  .suggest-input-row { flex-direction: column; }
  .suggest-input { max-width: none; }
  .suggest-submit-btn { padding: 16px; }
}

@media (max-width: 480px) {
  .nav-progress-mini { display: none; }
  .progress-circle-wrapper, .progress-ring { width: 180px; height: 180px; }
  .progress-percent { font-size: 40px; }
  .login-card { padding: 32px 24px; }
}
