/* =====================================================================
   공개 홈페이지 CSS
   학원 홈페이지 느낌의 깔끔한 디자인
   ===================================================================== */

@font-face {
  font-family: 'Paperlogy';
  src: url('/assets/fonts/Paperlogy-Regular.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #2c3e50;
  line-height: 1.6;
}

/* ── 헤더 ────────────────────────────────────────────────────────────── */
.public-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.public-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.public-logo h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.public-logo p {
  margin: 4px 0 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.public-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.public-nav-link {
  color: white;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: opacity 0.2s;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.public-nav-link:hover {
  opacity: 0.8;
  border-bottom-color: white;
}

.public-nav-link.is-active {
  border-bottom-color: white;
  font-weight: 600;
}

.public-nav-login {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 6px;
  border-bottom: none;
}

.public-nav-login:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ── 메인 콘텐츠 ──────────────────────────────────────────────────────── */
.public-main {
  min-height: calc(100vh - 200px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.public-content {
  width: 100%;
}

.public-header-title {
  margin-bottom: 40px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 20px;
}

.public-header-title h2 {
  margin: 0;
  font-size: 32px;
  color: #2c3e50;
}

.public-header-title p {
  margin: 8px 0 0 0;
  color: #666;
  font-size: 15px;
}

/* 카드 */
.public-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.public-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.public-card h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  color: #2c3e50;
}

.public-card p {
  margin: 0;
  color: #666;
  line-height: 1.8;
}

/* 알림 */
.alert {
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 14px;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* 배지 */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-primary {
  background: #dbeafe;
  color: #1e40af;
}

/* 버튼 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: #f0f0f0;
  color: #2c3e50;
}

.btn-primary {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-secondary {
  background: #f0f0f0;
  color: #2c3e50;
  border-color: #ddd;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.public-btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: 0.2s;
}

.public-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.public-btn-secondary {
  background: #f0f0f0;
  color: #2c3e50;
}

.public-btn-secondary:hover {
  background: #e0e0e0;
}

/* 공지사항 테이블 */
.public-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.public-table thead {
  background: #f5f5f5;
}

.public-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #667eea;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.public-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  color: #555;
}

.public-table tbody tr:hover {
  background: #f9f9f9;
}

.public-table a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.public-table a:hover {
  text-decoration: underline;
}

/* ── 푸터 ────────────────────────────────────────────────────────────── */
.public-footer {
  background: #2c3e50;
  color: white;
  padding: 40px 20px 20px;
  margin-top: 60px;
}

.public-footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 30px;
}

.public-footer-section h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
}

.public-footer-section p {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.8;
}

.public-footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  opacity: 0.7;
}

.public-footer-bottom p {
  margin: 0;
}

.public-footer-reg {
  margin-bottom: 8px !important;
  font-size: 13px;
  opacity: 0.85;
}

.public-footer-reg-missing {
  color: #ffd4d4;
}

.public-footer-links {
  margin-bottom: 10px !important;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.public-footer-sep {
  opacity: 0.4;
}

.public-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: white;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.9;
}

.public-link-btn:hover {
  opacity: 1;
}

/* ── 약관/방침 레이어 팝업 ────────────────────────────────────────────── */
.policy-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.policy-modal[hidden] {
  display: none;
}

.policy-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.policy-modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.policy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.policy-modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #2c3e50;
}

.policy-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}

.policy-modal-close:hover {
  background: #f0f0f0;
  color: #2c3e50;
}

.policy-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  color: #444;
  line-height: 1.8;
}

.policy-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e0e0e0;
  text-align: right;
}

.policy-doc[hidden] {
  display: none;
}

/* Summernote 로 작성된 본문이 레이아웃을 깨지 않도록 방어 */
.policy-doc img {
  max-width: 100%;
  height: auto;
}

.policy-doc table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.policy-doc table td,
.policy-doc table th {
  border: 1px solid #ddd;
  padding: 8px 10px;
}

.policy-empty {
  color: #999;
  text-align: center;
  padding: 40px 0;
}

/* 약관/방침/교습비 본문의 목록 들여쓰기 */
.policy-doc ul,
.policy-doc ol {
  padding-left: 22px;
  margin: 10px 0;
}

.policy-doc li {
  margin-bottom: 6px;
}

.policy-doc ul ul,
.policy-doc ol ol,
.policy-doc ul ol,
.policy-doc ol ul {
  margin: 6px 0;
}

@media (max-width: 768px) {
  .policy-modal-content {
    max-height: 90vh;
  }

  .policy-modal-body {
    padding: 16px 14px;
    font-size: 14px;
  }

  /* 모바일에서는 목록 들여쓰기를 줄여 본문이 잘리지 않게 한다 */
  .policy-doc ul,
  .policy-doc ol {
    padding-left: 18px;
    margin: 8px 0;
  }

  .policy-doc ul ul,
  .policy-doc ol ol,
  .policy-doc ul ol,
  .policy-doc ol ul {
    padding-left: 14px;
  }

  .policy-doc li {
    margin-bottom: 5px;
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  /* Summernote 가 넣는 인라인 여백이 모바일에서 과해지는 것을 방지 */
  .policy-doc p,
  .policy-doc div {
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  .policy-doc table {
    font-size: 13px;
  }
}

/* 폼 */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
}

.form-group label.required::after {
  content: ' *';
  color: #ef4444;
}

.form-group input[type="text"],
.form-group input[type="search"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  padding: 9px 11px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.45;
  font-family: 'Paperlogy', sans-serif;
  color: #2c3e50;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="datetime-local"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 11px;
  margin-top: 16px;
}

/* ── 페이지네이션 ────────────────────────────────────────────────────── */
.public-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

.public-pagination a,
.public-pagination button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  color: #2c3e50;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 14px;
  min-width: 40px;
  text-align: center;
}

.public-pagination a:hover,
.public-pagination button:hover {
  border-color: #667eea;
  color: #667eea;
}

.public-pagination button.is-active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* ── 반응형 ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .public-header-content {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }

  .public-nav {
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
  }

  .public-nav-link {
    font-size: 14px;
  }

  .public-logo h1 {
    font-size: 24px;
  }

  .public-main {
    padding: 20px;
  }

  .public-header-title h2 {
    font-size: 24px;
  }

  .public-card {
    padding: 16px;
  }

  .public-footer-content {
    gap: 20px;
  }

  .public-table {
    font-size: 13px;
  }

  .public-table th,
  .public-table td {
    padding: 8px 12px;
  }
}

/* ── 학습성과 카드 ────────────────────────────────────────────────── */
.perf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.perf-card {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.perf-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(102, 126, 234, 0.16);
}

.perf-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.perf-card-grade {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.perf-card-school {
  flex: 1 1 auto;
  font-size: 13px;
  color: #888;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perf-card-title {
  margin: 0 0 10px 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  color: #2c3e50;
  overflow-wrap: anywhere;
}

.perf-card-content {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: #666;
  overflow-wrap: anywhere;
}

/* 학생이름 — 학교 옆에 표시 */
.perf-card-name {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  letter-spacing: 0.02em;
}

.perf-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.perf-empty-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .perf-cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .perf-card {
    padding: 18px;
  }

  .perf-card-title {
    font-size: 16px;
  }
}

/* ── 공지사항 목록 ───────────────────────────────────────────────────── */
.notice-head {
  margin-bottom: 18px;
}

.notice-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.notice-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.notice-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #2c3e50;
  border-bottom: 2px solid #667eea;
  white-space: nowrap;
}

.notice-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e0e0e0;
  color: #555;
  font-size: 14px;
}

.notice-table tbody tr:hover {
  background: #f9f9f9;
}

.notice-table .col-no {
  width: 68px;
  text-align: center;
  color: #999;
  font-size: 13px;
  white-space: nowrap;
}

.notice-table .col-title {
  width: auto;
}

.notice-table .col-title a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #2c3e50;
  text-decoration: none;
  font-weight: 500;
  min-width: 0;
}

.notice-table .col-title a:hover .notice-title-text {
  color: #667eea;
  text-decoration: underline;
}

/* 제목이 길어도 한 줄 유지 */
.notice-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 날짜는 절대 두 줄로 나뉘지 않는다 */
.notice-table .col-date {
  width: 118px;
  text-align: right;
  color: #888;
  font-size: 13px;
  white-space: nowrap;
}

.notice-table .col-date.is-future {
  color: #e5484d;
  font-weight: 600;
}

.notice-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.notice-pager .btn {
  min-width: 36px;
  text-align: center;
}

.notice-pager .is-current {
  cursor: default;
}

@media (max-width: 640px) {
  .notice-table .col-no {
    display: none;              /* 모바일에서는 번호 숨김 */
  }

  .notice-table th,
  .notice-table td {
    padding: 12px 8px;
  }

  .notice-table .col-title a {
    font-size: 14px;
  }

  .notice-table .col-date {
    width: 92px;
    font-size: 12px;
  }

  .notice-table .badge {
    padding: 3px 6px;
    font-size: 11px;
  }
}
