/* 정율사관학원 상담실 - 커스텀 스타일 */

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f97316;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f8fafc;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }
body { font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; }

/* ===== 로그인 화면 ===== */
.login-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px 40px;
  width: 400px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .school-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.2;
}

.login-logo .sub-name {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== 네비게이션 ===== */
.nav-bar {
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.nav-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.nav-brand {
  font-size: 16px;
  font-weight: 800;
  padding: 14px 0;
  margin-right: 32px;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.nav-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
}

.nav-tab {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.nav-tab:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-tab.active { color: white; border-bottom-color: #f59e0b; background: rgba(255,255,255,0.1); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  margin-left: auto;
}

/* ===== 컨텐츠 영역 ===== */
.main-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ===== 카드 ===== */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 버튼 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #ea580c; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: #f1f5f9; color: var(--text-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-outline { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ===== 폼 요소 ===== */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dark);
  transition: border-color 0.2s;
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-control-sm { padding: 6px 10px; font-size: 13px; }

textarea.form-control { resize: vertical; min-height: 80px; }

/* ===== 체크박스/라디오 그룹 ===== */
.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 14px;
}

.check-item input[type="checkbox"],
.check-item input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ===== 배지 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-orange { background: #fed7aa; color: #9a3412; }

/* ===== 테이블 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 12px;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-dark);
}

.data-table tr:hover td { background: #f8fafc; }

.data-table .action-cell { white-space: nowrap; }

/* ===== 모달 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-box.modal-lg { max-width: 1000px; }
.modal-box.modal-xl { max-width: 1200px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: white;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== 복붙 텍스트 박스 ===== */
.copy-box {
  background: #f0f9ff;
  border: 2px solid #bae6fd;
  border-radius: 10px;
  padding: 16px;
  font-family: monospace;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
  position: relative;
}

.copy-box .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #0ea5e9;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.copy-box .copy-btn:hover { background: #0284c7; }
.copy-box .copy-btn.copied { background: var(--success); }

/* ===== 달력 ===== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.calendar-header-cell {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 10px;
  font-weight: 700;
  font-size: 13px;
}

.calendar-cell {
  background: white;
  min-height: 100px;
  padding: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.calendar-cell:hover { background: #f0f9ff; }

.calendar-cell.today { background: #eff6ff; }
.calendar-cell.other-month { background: #f9fafb; }
.calendar-cell.other-month .day-num { color: #d1d5db; }

.calendar-cell .day-num {
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 4px;
}

.calendar-cell.today .day-num {
  background: var(--primary);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.calendar-cell .sun .day-num { color: #ef4444; }
.calendar-cell .sat .day-num { color: #3b82f6; }

.cal-event {
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  cursor: pointer;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-event.test { background: #fef3c7; color: #92400e; border-left: 3px solid #f59e0b; }
.cal-event.face { background: #dbeafe; color: #1e40af; border-left: 3px solid #3b82f6; }
.cal-event.call { background: #d1fae5; color: #065f46; border-left: 3px solid #10b981; }
.cal-event.other { background: #ede9fe; color: #5b21b6; border-left: 3px solid #8b5cf6; }
.cal-event.register { background: #fee2e2; color: #991b1b; border-left: 3px solid #ef4444; }

/* ===== 탭 콘텐츠 ===== */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 검색 필터 영역 ===== */
.filter-bar {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* ===== 통계 카드 ===== */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  text-align: center;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 6px;
  font-weight: 600;
}

/* ===== 상태 색상 ===== */
.status-문의 { background: #f3f4f6; color: #374151; }
.status-테스트예약 { background: #fef3c7; color: #92400e; }
.status-대면예약 { background: #dbeafe; color: #1e40af; }
.status-등록완료 { background: #d1fae5; color: #065f46; }
.status-보류 { background: #fee2e2; color: #991b1b; }

/* ===== 문의경로 배지 ===== */
.route-독퍼치 { background: #fce7f3; color: #9d174d; }
.route-카퍼치 { background: #ede9fe; color: #5b21b6; }
.route-블로그 { background: #d1fae5; color: #065f46; }
.route-지인추천 { background: #fef3c7; color: #92400e; }
.route-설명회 { background: #dbeafe; color: #1e40af; }
.route-기타 { background: #f3f4f6; color: #374151; }

/* ===== 그리드 레이아웃 ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-tabs { display: none; }
  .main-content { padding: 12px; }
}

/* ===== 섹션 구분선 ===== */
.section-divider {
  border: none;
  border-top: 2px dashed #e2e8f0;
  margin: 20px 0;
}

/* ===== 토스트 알림 ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: white;
  border-radius: 10px;
  padding: 12px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  animation: toastIn 0.3s ease;
  border-left: 4px solid;
  min-width: 280px;
}

.toast.success { border-left-color: var(--success); color: #065f46; }
.toast.error { border-left-color: var(--danger); color: #991b1b; }
.toast.info { border-left-color: var(--primary-light); color: var(--primary-dark); }

@keyframes toastIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== 스크롤바 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== 등록일지 특별 스타일 ===== */
.journal-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
}

.journal-section-header {
  background: var(--primary);
  color: white;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 14px;
}

.journal-section-body { padding: 16px; }

/* ===== 로딩 ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-light);
  font-size: 14px;
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 빈 상태 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; color: #d1d5db; }
.empty-state p { font-size: 15px; font-weight: 600; margin: 0; }
