/* ============================================================
   EduWiz - 공통 스타일시트
   ============================================================ */

:root {
  --color-primary: #2f5ce8;
  --color-primary-dark: #1f3fb8;
  --color-accent: #17b26a;
  --color-text: #1a1d29;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-bg: #f7f8fb;
  --color-surface: #ffffff;
  --color-danger: #e0332f;
  --radius: 10px;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

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

/* ---------------- Header ---------------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-weight: 800;
  font-size: 22px;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}
.main-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  font-weight: 600;
  color: var(--color-text);
  font-size: 15px;
}
.main-nav a:hover { color: var(--color-primary); }

.user-menu { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.user-menu .welcome { color: var(--color-text-muted); }
.btn-link { color: var(--color-text-muted); font-weight: 500; }
.btn-signup {
  background: var(--color-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
}
.btn-signup:hover { background: var(--color-primary-dark); }

.site-main { max-width: 1160px; margin: 0 auto; padding: 40px 24px 80px; min-height: 60vh; }

/* ---------------- Hero ---------------- */
.hero {
  text-align: center;
  padding: 64px 20px;
  background: linear-gradient(180deg, #eef2ff 0%, var(--color-bg) 100%);
  border-radius: 16px;
  margin-bottom: 48px;
}
.hero h1 { font-size: 36px; font-weight: 800; letter-spacing: -1px; margin: 0 0 12px; }
.hero p { color: var(--color-text-muted); font-size: 16px; margin-bottom: 28px; }

.home-section h2 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }

/* ---------------- Buttons ---------------- */
.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-large { padding: 14px 32px; font-size: 16px; }

/* ---------------- Forms ---------------- */
.form-page {
  max-width: 420px;
  margin: 0 auto;
  background: var(--color-surface);
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.form-title { font-size: 24px; font-weight: 800; margin: 0 0 24px; text-align: center; }
.stack-form { display: flex; flex-direction: column; gap: 6px; }
.stack-form label { font-size: 13px; font-weight: 600; margin-top: 12px; color: var(--color-text-muted); }
.stack-form input[type=text],
.stack-form input[type=email],
.stack-form input[type=password],
.stack-form input[type=tel],
.stack-form input[type=date] {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}
.stack-form input:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; border-color: transparent; }
.field-hint { font-size: 12px; color: var(--color-text-muted); margin: 2px 0 0; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 18px; }
.checkbox-line a { color: var(--color-primary); text-decoration: underline; }
.stack-form .btn-primary { margin-top: 22px; width: 100%; }
.form-footer-link { text-align: center; margin-top: 20px; font-size: 14px; color: var(--color-text-muted); }
.form-footer-link a { color: var(--color-primary); font-weight: 600; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin: 0 0 16px;
  list-style: none;
}
.alert-error { background: #fdecea; color: var(--color-danger); }
.alert-success { background: #e9f9ef; color: var(--color-accent); }

/* ---------------- Lecture List ---------------- */
.lecture-list-page { display: grid; grid-template-columns: 200px 1fr; gap: 32px; }
.category-sidebar h2 { font-size: 18px; margin-bottom: 16px; }
.category-sidebar ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.category-sidebar a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--color-text-muted); }
.category-sidebar a.active, .category-sidebar a:hover { background: #eef2ff; color: var(--color-primary); font-weight: 700; }

.search-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.search-bar input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--color-border); border-radius: 8px; font-size: 14px;
}
.search-bar button {
  padding: 10px 20px; border: none; border-radius: 8px; background: var(--color-text); color: #fff; font-weight: 600; cursor: pointer;
}

.list-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.result-count { font-size: 14px; color: var(--color-text-muted); }
.sort-options { display: flex; gap: 14px; font-size: 13px; }
.sort-options a { color: var(--color-text-muted); }
.sort-options a.active { color: var(--color-primary); font-weight: 700; }

.lecture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lecture-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  transition: box-shadow .15s, transform .15s;
}
.lecture-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.card-thumb { aspect-ratio: 16/9; background: #eef0f4; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #b0b4bd; font-size: 13px; }
.card-badges { display: flex; gap: 4px; padding: 10px 14px 0; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.badge-new { background: #e9f9ef; color: var(--color-accent); }
.badge-best { background: #fff4e5; color: #c76e00; }
.badge-recommend { background: #eef2ff; color: var(--color-primary); }
.card-title { font-size: 15px; font-weight: 700; margin: 8px 14px 4px; }
.card-teacher { font-size: 12px; color: var(--color-text-muted); margin: 0 14px 10px; }
.card-price { padding: 0 14px 16px; font-size: 15px; font-weight: 800; }
.price-original { color: #b0b4bd; text-decoration: line-through; font-weight: 500; font-size: 13px; margin-right: 6px; }
.price-final { color: var(--color-primary); }
.status-pending, .status-closed { font-size: 13px; color: var(--color-text-muted); font-weight: 600; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.pagination a {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 13px; color: var(--color-text-muted);
}
.pagination a.active { background: var(--color-primary); color: #fff; font-weight: 700; }

/* ---------------- Lecture Detail ---------------- */
.breadcrumb { font-size: 13px; color: var(--color-text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--color-text-muted); }
.detail-head { display: grid; grid-template-columns: 360px 1fr; gap: 32px; margin-bottom: 40px; }
.detail-thumb { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; background: #eef0f4; }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.detail-info .teacher { font-size: 15px; color: var(--color-text-muted); margin: 0 0 4px; }
.detail-info .meta { font-size: 13px; color: var(--color-text-muted); margin: 0 0 12px; }
.detail-info .badges { display: flex; gap: 6px; margin-bottom: 16px; }
.price-box { font-size: 22px; font-weight: 800; margin-bottom: 24px; }
.detail-content { border-top: 1px solid var(--color-border); padding-top: 32px; }

/* ---------------- Tables (mypage) ---------------- */
.mypage { max-width: 800px; margin: 0 auto; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.data-table th { color: var(--color-text-muted); font-weight: 600; font-size: 13px; }

.policy-page { max-width: 800px; margin: 0 auto; }

.empty-state { text-align: center; padding: 80px 20px; color: var(--color-text-muted); }
.empty-state .btn-primary { margin-top: 16px; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--color-border); margin-top: 60px; }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 32px 24px; font-size: 13px; color: var(--color-text-muted); }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .lecture-list-page { grid-template-columns: 1fr; }
  .lecture-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-head { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .lecture-grid { grid-template-columns: 1fr; }
}
