/* ==========================================================================
   STAYLOG — Minimal High-CTR Mobile Stay Link Page
   Design Goal: Zero Friction, 1-Tap Direct Affiliate Click, Editorial Polish
   ========================================================================== */

:root {
  --bg-outer: #EFECE6;
  --bg-page: #FAF8F5;
  --bg-card: #FFFFFF;
  --bg-subtle: #F2EEE8;

  --ink-primary: #171615;
  --ink-secondary: #5C5752;
  --ink-muted: #8C867E;

  --accent: #D94E28;
  --accent-hover: #BF3E1B;
  --accent-soft: rgba(217, 78, 40, 0.1);
  --rocket: #0073E9;
  --rocket-soft: rgba(0, 115, 233, 0.1);

  --border: rgba(23, 22, 21, 0.08);
  --border-strong: rgba(23, 22, 21, 0.15);

  --shadow-card: 0 4px 16px rgba(23, 22, 21, 0.05);
  --shadow-card-hover: 0 10px 26px rgba(23, 22, 21, 0.1);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-pill: 9999px;

  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  background-color: var(--bg-outer);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background-color: var(--bg-outer);
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.4;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   Centered Mobile Column (Clean on Desktop & Edge-to-Edge on Mobile)
   ========================================================================== */
.app-shell {
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  background-color: var(--bg-page);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 540px) {
  body {
    padding: 20px 12px;
  }
  .app-shell {
    min-height: calc(100dvh - 40px);
    border-radius: 28px;
    border: 1px solid var(--border-strong);
    box-shadow: 0 20px 60px rgba(23, 22, 21, 0.1);
    overflow: clip;
  }
}

/* ==========================================================================
   1. Compact Brand Header
   ========================================================================== */
.compact-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 10px;
}

.avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
}

.header-text {
  min-width: 0;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--ink-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   2. Mandatory Coupang Partners & FTC Disclosure (Always Visible, Compact)
   ========================================================================== */
.ftc-notice-bar {
  margin: 0 16px 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.ftc-tag {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--ink-primary);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  margin-top: 1px;
}

/* ==========================================================================
   3. Sticky Single-Line Search & Minimal Filter Pills
   ========================================================================== */
.sticky-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.search-wrap {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  transition: border-color 0.18s ease;
}

.search-wrap:focus-within {
  border-color: var(--accent);
}

.search-icon {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent);
  margin-right: 8px;
}

.search-input {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--ink-muted);
  font-weight: 400;
}

.search-clear {
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-size: 0.72rem;
  align-items: center;
  justify-content: center;
}

.search-clear.visible {
  display: inline-flex;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  overflow-x: auto;
}

.pill-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
  transition: all 0.15s ease;
}

.pill-btn.active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: #fff;
  font-weight: 700;
}

/* ==========================================================================
   4. 1-Tap Direct-Link Stay Cards (2-Column Visual Grid)
   ========================================================================== */
.feed-section {
  padding: 12px 16px 20px;
}

.stay-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stay-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stay-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.stay-card:active {
  transform: scale(0.975);
}

.stay-card.highlight-exact {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-card-hover);
}

.card-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-subtle);
  overflow: hidden;
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.stay-card:hover .card-photo img {
  transform: scale(1.04);
}

.no-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(18, 17, 16, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.no-badge .hash {
  color: #FF8A6B;
}

.card-info {
  padding: 10px 10px 11px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 8px;
}

.card-region {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.card-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink-primary);
  line-height: 1.32;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tip {
  font-size: 0.72rem;
  color: var(--ink-secondary);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-cta {
  width: 100%;
  padding: 8px 6px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.01em;
  transition: background 0.15s ease;
}

.stay-card:hover .card-cta {
  background: var(--accent-hover);
}

.empty-box {
  text-align: center;
  padding: 40px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
}

.empty-box p {
  font-size: 0.84rem;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.empty-reset-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--ink-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ==========================================================================
   5. Compact Coupang Travel Essentials (1-Tap Links)
   ========================================================================== */
.essentials-section {
  padding: 16px 16px 24px;
  border-top: 6px solid var(--bg-subtle);
}

.essentials-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.essentials-title {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.api-badge {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(21, 128, 61, 0.12);
  color: #15803D;
  font-size: 0.68rem;
  font-weight: 800;
}

.essentials-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.essential-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.essential-row:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.essential-row:active {
  transform: scale(0.985);
}

.essential-thumb {
  width: 58px;
  height: 58px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-subtle);
}

.essential-meta {
  flex: 1;
  min-width: 0;
}

.essential-name {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ink-primary);
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.essential-sub {
  font-size: 0.72rem;
  color: var(--ink-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.essential-price {
  color: var(--ink-primary);
  font-weight: 800;
}

.rocket-tag {
  color: var(--rocket);
  font-weight: 800;
}

.essential-arrow {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-subtle);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink-primary);
}

/* ==========================================================================
   6. Minimal Footer
   ========================================================================== */
.minimal-footer {
  margin-top: auto;
  padding: 18px 16px 24px;
  background: var(--bg-subtle);
  font-size: 0.72rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.admin-subtle-link {
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-decoration: underline;
}

/* ==========================================================================
   Owner-Only Admin & Coupang API Sheet
   ========================================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 14, 13, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  background: var(--bg-card);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.sheet-backdrop.open .bottom-sheet {
  transform: translateY(0);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.sheet-title {
  font-size: 0.92rem;
  font-weight: 800;
}

.sheet-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-subtle);
  font-size: 0.82rem;
  font-weight: 700;
}

.sheet-body {
  padding: 16px;
  overflow-y: auto;
}

.studio-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.studio-tab {
  flex: 1;
  padding: 8px;
  border-radius: 9px;
  background: var(--bg-subtle);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-secondary);
}

.studio-tab.active {
  background: var(--ink-primary);
  color: #fff;
}

.studio-box {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  margin-bottom: 12px;
}

.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-bottom: 4px;
}

.form-input, .form-select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  font-size: 0.84rem;
}

.form-row {
  display: flex;
  gap: 6px;
}

.btn-primary {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
}

.btn-dark {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--ink-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-outline {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-top: 8px;
}

/* Toast */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  z-index: 200;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  background: rgba(20, 19, 18, 0.92);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.22s ease;
  white-space: nowrap;
}

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

.is-hidden { display: none; }
