/* 🌿 sero up beat — Hand-drawn Mint Theme
 * Fonts:   Caveat Brush (accent), Fredoka (body/ui), Patrick Hand (handwritten)
 * Primary: #2D6A54 (deep forest) / #245A47 (darker)
 * Accent:  #4FA687 / #3E8F73 (mint)
 * Deep:    #1B4737 (text)
 * Bg:      #C8E8D3 → #E8F5EC (light sage)
 * Paper:   subtle noise texture
 */

/* ── Google Fonts ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Caveat+Brush&family=Fredoka:wght@400;500;600;700&family=Patrick+Hand&display=swap');

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

html, body {
  min-height: 100vh;
  font-family: 'Fredoka', -apple-system, 'Noto Sans KR', sans-serif;
  font-weight: 400;
}

body {
  background:
    radial-gradient(ellipse at top, #D4F0DC 0%, #E8F5EC 40%, #F0F9F4 100%);
  color: #1B4737;
  min-height: 100vh;
  position: relative;
}

/* 종이 텍스처 노이즈 */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.18) 1px, transparent 1px),
    radial-gradient(rgba(27,71,55,0.025) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 1px;
  pointer-events: none;
  z-index: 0;
}

/* 모든 컨텐츠는 z-index 위로 */
#app, .header, .tab-content, .modal { position: relative; z-index: 1; }

a { color: #2D6A54; text-decoration: none; font-weight: 500; }
a:hover { color: #1B4737; text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 4px; }

/* ── Header ──────────────────────────────────────────── */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 30px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid rgba(168,220,200,0.4);
  box-shadow: 0 4px 20px rgba(27,71,55,0.06);
  position: sticky; top: 0; z-index: 50;
  flex-wrap: wrap; gap: 12px;
}

.logo {
  font-family: 'Caveat Brush', cursive;
  font-size: 32px;
  color: #1B4737;
  letter-spacing: -1px;
  transform: rotate(-1deg);
  display: inline-block;
}
.logo::after {
  content: " UP BEAT";
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #2D6A54;
  letter-spacing: 1.5px;
  margin-left: 6px;
  transform: rotate(1deg);
  display: inline-block;
}

/* ── Tabs (pill shape, hand-drawn feel) ──────────────── */
.nav-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: #4A6B5E;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 14px;
  transition: all .2s ease;
}
.tab-btn:hover {
  background: #E8F5EC;
  color: #1B4737;
}
.tab-btn.active {
  background: #2D6A54;
  color: #fff;
  font-weight: 600;
  box-shadow:
    0 3px 0 rgba(27,71,55,0.25),
    0 6px 14px rgba(45,106,84,0.2);
}

.tab-content { display: none; padding: 32px; max-width: 1200px; margin: 0 auto; }
.tab-content.active { display: block; animation: fadeIn .4s ease; }

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

/* ── Drop Zone ───────────────────────────────────────── */
.drop-zone {
  border: 3px dashed #4FA687;
  border-radius: 20px;
  padding: 50px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 22px;
  background: rgba(232,245,236,0.5);
  color: #1B4737;
  font-family: 'Patrick Hand', cursive;
  font-size: 18px;
  transition: all .25s ease;
  transform: rotate(-0.2deg);
}
.drop-zone:hover {
  background: #E8F5EC;
  border-color: #2D6A54;
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 0 10px 30px rgba(45,106,84,0.15);
}

/* ── Inputs ──────────────────────────────────────────── */
.input, .textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #D8EADD;
  background: #F6FBF8;
  color: #1B4737;
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 15px;
  font-family: 'Fredoka', sans-serif;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: #4FA687;
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(79,166,135,0.12);
}
.textarea { height: 110px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #A8C4B7; }

/* ── Platform tabs / cards ───────────────────────────── */
.platform-tabs { display: flex; gap: 8px; margin: 18px 0; flex-wrap: wrap; }
.ptab {
  padding: 8px 18px;
  border: 2px solid #D8EADD;
  background: #FFFFFF;
  color: #4A6B5E;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
}
.ptab:hover {
  border-color: #4FA687;
  color: #1B4737;
  transform: translateY(-1px);
}
.ptab.active {
  background: #2D6A54;
  color: #fff;
  border-color: #2D6A54;
  font-weight: 600;
  box-shadow:
    0 3px 0 rgba(27,71,55,0.25),
    0 6px 12px rgba(45,106,84,0.2);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.platform-card {
  display: flex; align-items: center; gap: 10px;
  padding: 14px;
  background: #FFFFFF;
  border: 2px solid #E8F2EC;
  border-radius: 14px;
  cursor: pointer;
  font-size: 14px;
  color: #1B4737;
  transition: all .2s ease;
  font-family: 'Fredoka', sans-serif;
}
.platform-card:hover {
  border-color: #4FA687;
  background: #F6FBF8;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(79,166,135,0.15);
}

/* ── Buttons (3D pill style) ─────────────────────────── */
.btn-primary {
  padding: 14px 28px;
  background: #2D6A54;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  letter-spacing: 0.5px;
  box-shadow:
    0 4px 0 rgba(27,71,55,0.25),
    0 8px 18px rgba(45,106,84,0.2);
  transition: all .2s ease;
  position: relative;
  top: 0;
}
.btn-primary:hover {
  background: #245A47;
  top: -2px;
  box-shadow:
    0 6px 0 rgba(27,71,55,0.25),
    0 12px 24px rgba(45,106,84,0.25);
}
.btn-primary:active {
  top: 2px;
  box-shadow:
    0 2px 0 rgba(27,71,55,0.25),
    0 4px 10px rgba(45,106,84,0.15);
}

.btn-secondary {
  padding: 12px 24px;
  background: #FFFFFF;
  color: #2D6A54;
  border: 2px solid #D8EADD;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  transition: all .2s ease;
}
.btn-secondary:hover {
  border-color: #2D6A54;
  color: #1B4737;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45,106,84,0.12);
}

/* ── User info / avatar / menu ───────────────────────── */
.user-info { display: flex; gap: 10px; align-items: center; }
.btn-subscribe {
  padding: 9px 18px;
  background: transparent;
  color: #2D6A54;
  border: 2px solid #2D6A54;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .2s;
}
.btn-subscribe:hover {
  background: #2D6A54;
  color: #fff;
  box-shadow: 0 4px 12px rgba(45,106,84,0.25);
}

.user-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4FA687, #2D6A54);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  color: #fff;
  font-family: 'Caveat Brush', cursive;
  font-size: 20px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 3px 8px rgba(45,106,84,0.25);
  transition: all .2s;
}
.user-avatar:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(45,106,84,0.3);
}
.user-avatar .plan-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 14px; height: 14px;
  background: #f59e0b; border: 2px solid #fff;
  border-radius: 50%; font-size: 0;
}
.user-avatar .plan-dot.pro { background: linear-gradient(135deg,#f59e0b,#ef4444); }
.user-avatar .plan-dot.free { background: #9AB2A6; }

.user-menu {
  position: absolute; top: 52px; right: 0;
  background: #FFFFFF;
  border: 2px solid #E8F2EC;
  border-radius: 18px;
  min-width: 230px;
  box-shadow: 0 16px 40px rgba(27,71,55,0.15);
  padding: 8px;
  display: none; z-index: 100;
  font-family: 'Fredoka', sans-serif;
}
.user-menu.open { display: block; animation: fadeIn .2s ease; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  color: #1B4737;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s;
}
.user-menu-item:hover { background: #F0F9F4; }
.user-menu-item.danger { color: #ef4444; }
.user-menu-divider { height: 1px; background: #E8F2EC; margin: 4px 0; }
.user-menu-header { padding: 14px; border-bottom: 1px solid #E8F2EC; margin-bottom: 4px; }
.user-menu-email { font-size: 12px; color: #7A9A8E; }
.user-menu-plan { font-size: 11px; margin-top: 2px; font-weight: 600; }
.user-menu-plan.pro { color: #f59e0b; }
.user-menu-plan.free { color: #7A9A8E; }

/* ── Login CTA ───────────────────────────────────────── */
.btn-login-cta {
  padding: 9px 18px;
  background: #2D6A54;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 3px 0 rgba(27,71,55,0.25), 0 6px 12px rgba(45,106,84,0.2);
}
.btn-login-cta:hover { background: #245A47; transform: translateY(-1px); }

/* backwards compat */
.btn-upgrade {
  padding: 9px 18px;
  background: transparent;
  color: #2D6A54;
  border: 2px solid #2D6A54;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
}
.btn-logout {
  padding: 7px 16px;
  background: transparent;
  color: #ef4444;
  border: 2px solid #ef4444;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Fredoka', sans-serif;
}

.badge {
  padding: 4px 14px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-family: 'Fredoka', sans-serif;
}

/* ── Status grid / cards ─────────────────────────────── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.status-card {
  padding: 20px;
  background: #FFFFFF;
  border: 2px solid #E8F2EC;
  border-radius: 18px;
  border-left: 5px solid #D8EADD;
  box-shadow: 0 4px 14px rgba(27,71,55,0.05);
  font-family: 'Fredoka', sans-serif;
  transform: rotate(-0.3deg);
  transition: transform .2s;
}
.status-card:nth-child(even) { transform: rotate(0.3deg); }
.status-card:hover { transform: rotate(0deg) translateY(-2px); }
.status-card.success { border-left-color: #22c55e; }
.status-card.error { border-left-color: #ef4444; }
.status-card.uploading { border-left-color: #f59e0b; }
.status-card h3 {
  font-size: 16px; color: #1B4737;
  margin-bottom: 8px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
}

.log-area {
  background: #FAFCFB;
  border: 2px solid #E8F2EC;
  border-radius: 14px;
  padding: 20px;
  height: 320px;
  overflow-y: auto;
  font-family: 'Consolas', 'Menlo', monospace;
  font-size: 13px;
  color: #4A6B5E;
}

/* ── Country ranking ─────────────────────────────────── */
.country-ranking { margin: 18px 0; }
.country-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: #FFFFFF;
  border: 2px solid #E8F2EC;
  border-radius: 16px;
  margin-bottom: 10px;
  transition: all .2s;
}
.country-row:hover { border-color: #A8DCBE; transform: translateX(4px); }
.rank-num {
  font-size: 26px;
  font-weight: 700;
  color: #2D6A54;
  width: 36px;
  font-family: 'Caveat Brush', cursive;
}
.country-bar {
  height: 10px;
  background: linear-gradient(90deg, #2D6A54 0%, #4FA687 50%, #A8DCBE 100%);
  border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* ── Modals ──────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(27,71,55,0.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 34px;
  width: 90%; max-width: 900px; max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(27,71,55,0.25);
  border: 2px solid rgba(255,255,255,0.7);
  font-family: 'Fredoka', sans-serif;
}

.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.plan-card {
  padding: 24px;
  background: #F6FBF8;
  border-radius: 20px;
  text-align: center;
  border: 2px solid #E8F2EC;
  transition: all .25s ease;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(45,106,84,0.1); }
.plan-card.featured {
  border-color: #2D6A54;
  background: linear-gradient(180deg, #E8F5EC 0%, #D4F0DC 100%);
  box-shadow: 0 10px 30px rgba(45,106,84,0.18);
  transform: scale(1.03);
}
.plan-card .price {
  font-family: 'Caveat Brush', cursive;
  font-size: 38px;
  color: #1B4737;
  margin: 14px 0;
}
.plan-card ul { list-style: none; margin: 14px 0; }
.plan-card li { padding: 6px 0; font-size: 14px; color: #4A6B5E; }
.plan-card button {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  border: 2px solid #D8EADD;
  border-radius: 999px;
  cursor: pointer;
  background: #FFFFFF;
  color: #4A6B5E;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  transition: all .2s;
}
.plan-card.featured button {
  background: #2D6A54;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 0 rgba(27,71,55,0.25);
}

.payment-methods { display: flex; gap: 12px; justify-content: center; margin: 22px 0; flex-wrap: wrap; }
.btn-kakao, .btn-toss, .btn-naver, .btn-stripe {
  padding: 13px 26px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
}
.btn-kakao { background: #FAE100; color: #000; }
.btn-toss { background: #0064FF; color: #fff; }
.btn-naver { background: #03C75A; color: #fff; }
.btn-stripe { background: #6772e5; color: #fff; }
.btn-close {
  width: 100%; padding: 13px;
  background: #F0F9F4; color: #4A6B5E;
  border: 2px solid #E8F2EC;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 14px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
}
.btn-close:hover { background: #E8F2EC; }

/* ── Auth pages ──────────────────────────────────────── */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #C8E8D3 0%, #B5DCC4 55%, #A8D0B8 100%);
}
.auth-card {
  background: #FFFFFF;
  border-radius: 28px;
  padding: 44px;
  width: 440px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(27,71,55,0.18);
  font-family: 'Fredoka', sans-serif;
  border: 2px solid rgba(255,255,255,0.7);
}
.auth-card h1 {
  font-family: 'Caveat Brush', cursive;
  font-size: 42px;
  color: #1B4737;
  margin-bottom: 8px;
  transform: rotate(-1deg);
  display: inline-block;
}
.auth-card h2 {
  font-size: 16px;
  color: #4A6B5E;
  margin-bottom: 26px;
  font-weight: 500;
}
.error-msg { color: #ef4444; margin-top: 12px; font-size: 13px; }

/* ── Upload container / key group ────────────────────── */
.upload-container, .bulk-container { max-width: 900px; margin: 0 auto; }
.form-group { margin-bottom: 18px; }
.key-group {
  background: #FFFFFF;
  border: 2px solid #E8F2EC;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(27,71,55,0.05);
}
.key-group h3 {
  margin-bottom: 14px;
  color: #1B4737;
  font-family: 'Fredoka', sans-serif;
  font-size: 17px;
  font-weight: 600;
}

/* ── Headings ────────────────────────────────────────── */
h1, h2, h3, h4 { color: #1B4737; font-family: 'Fredoka', sans-serif; }
h1 { font-family: 'Caveat Brush', cursive; font-size: 36px; }
h2 { font-size: 24px; margin-bottom: 20px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; color: #2D6A54; }
p { color: #4A6B5E; line-height: 1.65; }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #F0F9F4; }
::-webkit-scrollbar-thumb {
  background: #A8DCBE;
  border-radius: 999px;
  border: 3px solid #F0F9F4;
}
::-webkit-scrollbar-thumb:hover { background: #4FA687; }

/* ── Accordion (details/summary) ─────────────────────── */
details.accordion {
  background: #FFFFFF;
  border: 2px solid #E8F2EC;
  border-radius: 18px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: all .25s ease;
}
details.accordion:hover { border-color: #A8DCBE; box-shadow: 0 6px 20px rgba(79,166,135,0.1); }
details.accordion[open] {
  border-color: #4FA687;
  box-shadow: 0 6px 20px rgba(79,166,135,0.15);
}
details.accordion summary {
  padding: 18px 22px;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  color: #1B4737;
  font-size: 15px;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(90deg, rgba(232,245,236,0.4) 0%, transparent 100%);
  transition: background .2s;
}
details.accordion summary:hover { background: #F0F9F4; }
details.accordion summary::-webkit-details-marker { display: none; }
details.accordion summary::after {
  content: "▾";
  color: #2D6A54;
  font-size: 16px;
  transition: transform .3s ease;
}
details.accordion[open] summary::after { transform: rotate(180deg); }
details.accordion .accordion-body {
  padding: 10px 22px 20px;
  border-top: 1px solid #E8F2EC;
  background: #FFFFFF;
}

/* ── Sparkles (decorative) ───────────────────────────── */
.sparkle-bg {
  position: fixed;
  color: #4FA687;
  opacity: 0.3;
  font-size: 16px;
  pointer-events: none;
  animation: twinkle 4s ease-in-out infinite;
  z-index: 0;
}
.sparkle-bg:nth-child(1) { top: 15%; left: 5%; animation-delay: 0s; }
.sparkle-bg:nth-child(2) { top: 35%; right: 4%; animation-delay: 1.5s; }
.sparkle-bg:nth-child(3) { bottom: 25%; left: 3%; animation-delay: 2.5s; }
.sparkle-bg:nth-child(4) { bottom: 10%; right: 6%; animation-delay: 0.8s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.6; transform: scale(1.3) rotate(20deg); }
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-tabs {
    order: 3; width: 100%;
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .nav-tabs::-webkit-scrollbar { height: 4px; }
  .nav-tabs::-webkit-scrollbar-thumb { background: #4FA687; border-radius: 2px; }
  .tab-btn { flex-shrink: 0; padding: 9px 14px; font-size: 13px; }
  .header { padding: 12px 16px; gap: 10px; }
  .tab-content { padding: 18px; }
  .logo { font-size: 26px; }
  .logo::after { font-size: 15px; }
  h1 { font-size: 28px; }
  h2 { font-size: 20px; }
  .platform-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .platform-card { padding: 12px; font-size: 13px; }
  .status-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .drop-zone { padding: 32px 18px; }
  .modal-content { padding: 24px; border-radius: 18px; }
  .platform-tabs {
    gap: 6px; overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch; padding-bottom: 4px;
  }
  .ptab { flex-shrink: 0; font-size: 13px; padding: 7px 14px; }
  .user-info .btn-subscribe span.label { display: none; }
  .user-menu { right: -10px; }
}

@media (max-width: 520px) {
  .pricing-grid { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr 1fr; }
  .input, .textarea { padding: 11px; font-size: 14px; }
  .log-area { font-size: 11px; height: 220px; }
  .auth-card { width: 92%; padding: 30px 22px; }
  .auth-card h1 { font-size: 32px; }
}
