/* NEUPL Components — 절제된 형태 */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--surface); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost {
  border: 0;
  background: transparent;
  height: auto;
  padding: 0;
  color: var(--text-muted);
}
.btn-ghost:hover { background: transparent; color: var(--text); text-decoration: underline; }

.btn-sm { height: 28px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn-lg { height: 44px; padding: 0 var(--space-5); font-size: var(--text-base); }
.btn-block { width: 100%; }

/* Inputs */
.field { display: block; margin-bottom: var(--space-4); }
.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.field-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-top: var(--space-1);
}
.field-error {
  display: block;
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-1);
}

.input,
.textarea,
.select {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  transition: border-color 0.15s;
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
}

.textarea {
  height: auto;
  min-height: 100px;
  padding: var(--space-3);
  line-height: var(--leading);
  resize: vertical;
}

/* Card / Panel */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.card + .card { margin-top: var(--space-4); }

.card-title {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

/* Listing — 카드 대신 가로선 위주 */
.row-list {
  border-top: 1px solid var(--border);
}
.row-list .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.row .row-main { flex: 1; min-width: 0; }
.row .row-title {
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: 2px;
}
.row .row-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.row .row-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn    { background: var(--warn-bg);    color: var(--warn); }
.badge-error   { background: var(--error-bg);   color: var(--error); }

/* Alerts (flash) */
.alert {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  background: var(--surface);
}
.alert-success { border-left-color: var(--success); background: var(--success-bg); color: var(--success); }
.alert-warn    { border-left-color: var(--warn);    background: var(--warn-bg);    color: var(--warn); }
.alert .alert-link {
  margin-left: var(--space-2);
  color: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.alert .alert-link:hover {
  text-decoration: none;
}
.alert-error   { border-left-color: var(--error);   background: var(--error-bg);   color: var(--error); }

/* Empty state */
.empty {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Auth pages (login/register) */
.auth-card {
  max-width: 380px;
  margin: var(--space-8) auto;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-card h1 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.auth-card .auth-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}
.auth-card form { margin-top: var(--space-4); }
.auth-card .auth-foot {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
}

/* Utility */
.row-flex { display: flex; gap: var(--space-3); }
.row-flex.center { align-items: center; }
.row-flex.between { justify-content: space-between; }
.spacer { flex: 1; }
.text-right { text-align: right; }

/* ========== 우측 삼선 메뉴 + 팝업 (사이트 공통) ========== */
.site-header {
  position: relative;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s, color 0.15s;
}
.menu-btn:hover {
  background: var(--surface);
}
.menu-btn[aria-expanded="true"] {
  background: var(--surface);
}

.menu-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: var(--space-5);
  width: 240px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-2);
  z-index: 1000;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.menu-popup[hidden] { display: none; }

.menu-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: var(--space-2) var(--space-3) 4px;
}

.menu-item {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color 0.1s;
}
.menu-item:hover {
  background: var(--surface);
  text-decoration: none;
}
.menu-item.active {
  background: var(--surface-2);
  font-weight: 500;
}
.menu-item .menu-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  background: var(--accent);
  color: var(--accent-on);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.menu-info {
  padding: 4px var(--space-3) var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}

@media (max-width: 640px) {
  .menu-popup {
    right: var(--space-4);
    width: calc(100vw - var(--space-4) * 2);
    max-width: 280px;
  }
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}
.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Shorts Grid */
.shorts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}
@media (max-width: 640px) {
  .shorts-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
}
.shorts-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.15s;
}
.shorts-card:hover { border-color: var(--border-strong); text-decoration: none; }
.shorts-card .thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--surface-2);
  overflow: hidden;
}
.shorts-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.shorts-card .thumb-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-faint); font-size: var(--text-xs);
}
.shorts-card .thumb-tag {
  position: absolute; left: 8px; top: 8px;
  padding: 2px 8px;
  font-size: 11px; font-weight: 500;
  background: rgba(11, 18, 32, 0.85); color: var(--text);
  border-radius: var(--radius-sm);
}
.shorts-card .thumb-duration {
  position: absolute; right: 8px; bottom: 8px;
  padding: 2px 6px;
  font-size: 11px;
  background: rgba(11, 18, 32, 0.85); color: var(--text);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
.shorts-card .meta { padding: var(--space-3); }
.shorts-card .meta .title {
  font-size: var(--text-sm); font-weight: 500;
  margin-bottom: 4px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.shorts-card .meta .sub {
  font-size: var(--text-xs); color: var(--text-faint);
}

/* Video Player (상세) */
.video-frame {
  max-width: 380px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}
.video-frame video {
  width: 100%; display: block;
  aspect-ratio: 9 / 16; object-fit: contain;
  background: #000;
}

/* Banner Slider */
.banner-slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: var(--space-6);
}
.banner-slide { display: none; width: 100%; aspect-ratio: 16 / 5; position: relative; }
.banner-slide.active { display: block; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-slide .caption {
  position: absolute; left: var(--space-5); bottom: var(--space-4);
  font-size: var(--text-md); font-weight: 500;
  color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.banner-dots {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.banner-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.4); cursor: pointer;
  transition: background 0.2s;
}
.banner-dots span.active { background: #fff; }

/* File input (custom) */
.file-input {
  display: block; width: 100%;
  padding: var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--text-sm); color: var(--text-muted);
  cursor: pointer;
}
.file-input input[type="file"] {
  display: block; width: 100%; margin-top: var(--space-2);
  color: var(--text);
}
