/* ── SecondVerse 밴드 페이지 스타일 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f8f9fa;
  --card: #ffffff;
  --primary: #4a6cf7;
  --primary-hover: #3a5ce5;
  --text: #333333;
  --text-light: #666666;
  --border: #e2e8f0;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #22c55e;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 10px;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── 로그인 페이지 ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
  background: var(--card);
  padding: 48px 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-box h1 {
  font-size: 28px;
  margin-bottom: 6px;
  color: var(--text);
}
.login-box .subtitle {
  color: var(--text-light);
  margin-bottom: 32px;
  font-size: 14px;
}
.login-box .logo-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* ── 폼 요소 ── */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-light);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
  background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: var(--danger-hover); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: #f1f5f9; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ── 네비게이션 ── */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar .brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: rgba(74, 108, 247, 0.08);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-info {
  font-size: 13px;
  color: var(--text-light);
}
.user-info strong { color: var(--text); }

/* ── 레이아웃 ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 22px;
}

/* ── 카드 ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ── 악보 아이템 ── */
.sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
}
.sheet-item:hover { box-shadow: var(--shadow-lg); }
.sheet-info h3 { font-size: 15px; margin-bottom: 4px; }
.sheet-meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  gap: 12px;
}
.sheet-actions { display: flex; gap: 8px; }

/* ── 영상 카드 ── */
.video-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.video-card:hover { box-shadow: var(--shadow-lg); }
.video-card video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  object-fit: contain;
}
.video-card .video-info {
  padding: 14px 16px;
}
.video-card .video-info h3 { font-size: 15px; margin-bottom: 4px; }
.video-card .video-meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.video-card .category-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(74, 108, 247, 0.1);
  color: var(--primary);
}
.video-card .category-badge.practice {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

/* ── 모달 ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  padding: 16px;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card);
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 20px; font-size: 18px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ── 관리자 테이블 ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.data-table th {
  font-weight: 600;
  color: var(--text-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table tr:hover { background: #f8fafc; }

/* ── 대시보드 카드 ── */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}
.dash-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.dash-card .icon { font-size: 36px; margin-bottom: 10px; }
.dash-card h3 { font-size: 16px; margin-bottom: 4px; }
.dash-card p { font-size: 13px; color: var(--text-light); }
.dash-card .count {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}

/* ── 알림 ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.alert.success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.alert.show { display: block; }

/* ── 빈 상태 ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── 게시글 본문 이미지 ── */
.post-inline-image {
  margin: 24px auto;
  width: min(100%, 920px);
  text-align: center;
}
.post-inline-image a {
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #f8fafc;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.post-inline-image img {
  display: block;
  width: 100%;
  max-height: 920px;
  object-fit: contain;
  background: #fff;
}
.post-inline-image figcaption {
  margin-top: 8px;
  color: var(--text-light);
  font-size: 12px;
  word-break: break-all;
}
.post-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 9px;
}
.post-image-status {
  color: var(--text-light);
  font-size: 12px;
}
.post-image-status.success { color: #15803d; }
.post-image-status.error { color: var(--danger); }
.post-image-guide {
  margin-top: 7px;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.55;
}
.post-visual-editor {
  min-height: 270px;
  max-height: 58vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  color: var(--text);
  background: #fff;
  font-size: 14px;
  line-height: 1.75;
  outline: none;
  caret-color: var(--primary);
  transition: border-color .15s, box-shadow .15s;
}
.post-visual-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.post-visual-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}
.post-editor-paragraph {
  min-height: 1.75em;
  padding: 3px 5px;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.post-editor-paragraph.is-active { background: #f8fafc; }
.post-editor-image {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
}
.post-editor-image.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .09); }
.post-editor-image img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.post-editor-image-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}
.post-editor-image-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-light);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-editor-image-actions { display: flex; flex-shrink: 0; gap: 5px; }
.post-editor-image-action {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 9px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}
.post-editor-image-action:hover { border-color: var(--primary); color: var(--primary); }
.post-editor-image-action.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ── 반응형 ── */
@media (max-width: 768px) {
  .modal-overlay { align-items: flex-start; padding: 12px; }
  .modal { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 20px; }
  .navbar { padding: 0 16px; }
  .nav-links { display: none; }
  .container { padding: 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .sheet-item { flex-direction: column; align-items: flex-start; gap: 12px; }
  .dash-cards { grid-template-columns: repeat(2, 1fr); }
  .post-visual-editor { min-height: 300px; max-height: 54vh; padding: 10px; }
  .post-editor-image { padding: 8px; }
  .post-editor-image img { max-height: 330px; }
  .post-editor-image-footer { align-items: flex-start; flex-direction: column; }
  .post-editor-image-actions { align-self: flex-end; }
}

/* ── 모바일 네비게이션 ── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 220;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.mobile-nav .nav-items {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  gap: 2px;
}
.mobile-nav .mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 54px;
  gap: 1px;
  margin: 0;
  padding: 3px 2px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-decoration: none;
  color: var(--text-light);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}
.mobile-nav .mobile-nav-item:active { transform: scale(0.96); }
.mobile-nav .mobile-nav-item.active {
  color: var(--primary);
  background: rgba(74, 108, 247, 0.08);
}
.mobile-nav .mobile-nav-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
}
.mobile-nav .mobile-nav-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mobile-nav .mobile-nav-label {
  display: block;
  width: 100%;
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  line-height: 16px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-layer { display: none; }

@media (max-width: 768px) {
  .mobile-nav { display: block; }
  body.has-mobile-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.mobile-menu-open { overflow: hidden; }

  .mobile-menu-layer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 300;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear 0.28s;
  }
  .mobile-menu-layer.open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    cursor: pointer;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 0.24s ease;
  }
  .mobile-menu-layer.open .mobile-menu-backdrop { opacity: 1; }
  .mobile-menu-sheet {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    width: min(100%, 560px);
    max-height: min(78vh, 680px);
    max-height: min(78dvh, 680px);
    margin: 0 auto;
    padding: 8px 18px calc(22px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    outline: none;
    background: #fff;
    box-shadow: 0 -24px 70px rgba(15, 23, 42, 0.2);
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.22, 0.8, 0.24, 1);
  }
  .mobile-menu-layer.open .mobile-menu-sheet { transform: translateY(0); }
  .mobile-menu-handle {
    width: 42px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 99px;
    background: #cbd5e1;
  }
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }
  .mobile-menu-eyebrow {
    margin: 0 0 1px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
  }
  .mobile-menu-header h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
  }
  .mobile-menu-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
  }
  .mobile-menu-close svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }
  .mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .mobile-menu-link {
    display: flex;
    min-width: 0;
    min-height: 78px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 5px;
    border: 1px solid #e9eef5;
    border-radius: 16px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  }
  .mobile-menu-link[hidden] { display: none; }
  .mobile-menu-link:active { transform: scale(0.97); }
  .mobile-menu-link.active {
    border-color: rgba(74, 108, 247, 0.35);
    background: rgba(74, 108, 247, 0.09);
    color: var(--primary);
  }
  .mobile-menu-link-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
  }
  .mobile-menu-link-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-nav-item:focus-visible,
  .mobile-menu-link:focus-visible,
  .mobile-menu-close:focus-visible {
    outline: 3px solid rgba(74, 108, 247, 0.32);
    outline-offset: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav .mobile-nav-item,
  .mobile-menu-layer,
  .mobile-menu-backdrop,
  .mobile-menu-sheet,
  .mobile-menu-link { transition: none; }
}

/* ── 프로그레스 ── */
.upload-progress {
  display: none;
  margin-top: 12px;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}
