/* InsureCRM - Custom Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* SPA transition */
.page { animation: fadeIn 0.2s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Kanban */
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; min-height: 400px; }
.kanban-column { min-width: 260px; max-width: 300px; flex-shrink: 0; background: #f9fafb; border-radius: 12px; padding: 12px; }
.kanban-column-header { font-weight: 700; font-size: 13px; padding: 6px 8px; border-radius: 8px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.kanban-card { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); cursor: grab; border-left: 4px solid transparent; transition: all 0.15s ease; }
.kanban-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-column.drag-over { background: #eff6ff; }

/* Sidebar */
.sidebar { width: 260px; background: #1e293b; min-height: 100vh; position: fixed; left: 0; top: 0; z-index: 40; transition: transform 0.3s ease; }
.sidebar-hidden { transform: translateX(-100%); }
.sidebar .nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: #94a3b8; font-size: 14px; cursor: pointer; transition: all 0.15s; border-radius: 8px; margin: 2px 10px; }
.sidebar .nav-item:hover, .sidebar .nav-item.active { background: #334155; color: #fff; }
.sidebar .nav-item i { width: 20px; text-align: center; }

/* Main content */
.main-content { margin-left: 260px; min-height: 100vh; transition: margin 0.3s ease; }
.main-content.full { margin-left: 0; }

/* Mobile bottom nav */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #e5e7eb; z-index: 50; padding: 4px 0; padding-bottom: env(safe-area-inset-bottom, 8px); }
.bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 0; font-size: 10px; color: #6b7280; cursor: pointer; }
.bottom-nav-item.active { color: #2563eb; }
.bottom-nav-item i { font-size: 18px; margin-bottom: 2px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 60; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s; }
.modal-content { background: #fff; border-radius: 16px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; padding: 24px; position: relative; }

/* KPI Card */
.kpi-card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f1f5f9; }
.kpi-card .kpi-value { font-size: 28px; font-weight: 800; color: #1e293b; }
.kpi-card .kpi-label { font-size: 13px; color: #64748b; margin-top: 4px; }
.kpi-card .kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* Chart container */
.chart-box { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 1px solid #f1f5f9; }

/* FAB */
.fab { position: fixed; bottom: 80px; right: 20px; width: 56px; height: 56px; border-radius: 50%; background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 4px 16px rgba(37,99,235,0.4); cursor: pointer; z-index: 45; transition: transform 0.2s; }
.fab:hover { transform: scale(1.1); }
.fab-menu { position: fixed; bottom: 144px; right: 20px; z-index: 45; display: flex; flex-direction: column; gap: 8px; animation: fadeIn 0.15s; }
.fab-menu-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-radius: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Badge / Tag */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 10px 12px; text-align: left; font-weight: 600; color: #64748b; border-bottom: 2px solid #e2e8f0; font-size: 12px; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.data-table tr:hover td { background: #f8fafc; }
.data-table tr { cursor: pointer; }

/* Login page */
.login-bg { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; border-radius: 24px; padding: 40px; width: 90%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.quick-login-btn { background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 16px; padding: 16px 12px; text-align: center; cursor: pointer; transition: all 0.2s; }
.quick-login-btn:hover { border-color: #3b82f6; background: #eff6ff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(59,130,246,0.15); }

/* D-Day badge */
.d-day { font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 12px; }
.d-day.urgent { background: #fef2f2; color: #dc2626; }
.d-day.warning { background: #fffbeb; color: #d97706; }
.d-day.normal { background: #f0fdf4; color: #16a34a; }

/* Tab bar */
.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin-bottom: 16px; }
.tab-item { padding: 8px 16px; font-size: 14px; font-weight: 600; color: #64748b; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.tab-item.active { color: #2563eb; border-bottom-color: #2563eb; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; padding-bottom: 72px; }
  .bottom-nav { display: flex; }
  .fab { bottom: 90px; }
  .fab-menu { bottom: 154px; }
  .kanban-column { min-width: 220px; }
  .modal-content { width: 95%; padding: 16px; }
  .kpi-card .kpi-value { font-size: 22px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 6px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 12px; color: #fff; font-size: 14px; font-weight: 600; z-index: 100; animation: slideIn 0.3s ease; }
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Pulse animation for live indicators */
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Form styles */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 14px; transition: border-color 0.15s; outline: none; }
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-select { width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 14px; background: #fff; outline: none; }
.form-select:focus { border-color: #3b82f6; }
textarea.form-input { min-height: 80px; resize: vertical; }

/* Btn */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fef2f2; color: #dc2626; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: #94a3b8; }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }

/* Funnel chart */
.funnel-bar { height: 36px; border-radius: 8px; display: flex; align-items: center; padding: 0 12px; font-size: 13px; font-weight: 600; color: #fff; transition: width 0.5s ease; margin-bottom: 6px; }

/* Overlay for mobile sidebar */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 35; }
.sidebar-overlay.show { display: block; }

/* KakaoTalk In-App Browser Compatibility */
/* Fallback for backdrop-filter (unsupported in some WebViews) */
.backdrop-blur { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@supports not ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  .backdrop-blur, [class*="backdrop-blur"] { background: rgba(255,255,255,0.97) !important; }
}

/* Safe area for notched devices (iPhone, etc.) */
.bottom-nav { padding-bottom: max(env(safe-area-inset-bottom, 8px), 8px); }
.main-content { padding-bottom: max(env(safe-area-inset-bottom, 0px), 0px); }
@media (max-width: 768px) {
  .main-content { padding-bottom: calc(72px + env(safe-area-inset-bottom, 8px)); }
}

/* Prevent auto-zoom on input focus (mobile Safari/WebView) */
input, select, textarea { font-size: 16px !important; }
@media (min-width: 768px) { input, select, textarea { font-size: 14px !important; } }

/* Touch target sizing for mobile */
.nav-item, .bottom-nav-item, .fab-menu-item, .btn, .tab-item { min-height: 44px; }

/* Demo mode banner */
.demo-banner { background: linear-gradient(90deg, #eff6ff, #dbeafe); border-bottom: 1px solid #bfdbfe; padding: 6px 16px; text-align: center; font-size: 12px; color: #1d4ed8; }
.demo-banner i { margin-right: 4px; }

/* === Course Cards === */
.course-card-mini { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border: 1px solid #f1f5f9; transition: all 0.2s ease; }
.course-card-mini:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }
.course-thumb { height: 80px; display: flex; align-items: center; justify-content: center; position: relative; }

.course-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); border: 1px solid #f1f5f9; transition: all 0.2s ease; }
.course-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.12); transform: translateY(-3px); }
.course-thumb-lg { height: 130px; display: flex; align-items: center; justify-content: center; position: relative; }
@media (max-width: 768px) { .course-thumb-lg { height: 100px; } }

.course-detail-header { min-height: 160px; }
@media (max-width: 768px) { .course-detail-header { min-height: 120px; } .course-detail-header h3 { font-size: 16px; } }

/* Line clamp */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* === Enrollment (수강신청) Button === */
.enroll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid #2563eb;
  background: #fff;
  color: #2563eb;
  transition: all 0.2s ease;
  min-height: 38px;
}
.enroll-btn:hover {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  transform: translateY(-1px);
}
.enroll-btn:active {
  transform: translateY(0);
}

.enroll-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
  white-space: nowrap;
}

/* Enrollment modal course header */
.enroll-course-header {
  min-height: 80px;
}

/* === Admin Mode Styles === */
.admin-header-bar {
  background: linear-gradient(90deg, #7c3aed, #6d28d9);
  color: #fff;
  padding: 8px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

/* === Contact (문의하기) Page === */
.contact-hero {
  text-align: center;
}
.contact-hero-inner {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #f5f3ff 100%);
  border: 1px solid #e0e7ff;
  border-radius: 20px;
  padding: 32px 20px;
}
.contact-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.quick-contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.quick-contact-link:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.1);
}

/* FAQ Accordion */
.faq-item {
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s;
}
.faq-item:hover { border-color: #e2e8f0; }
.faq-q {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.faq-arrow {
  font-size: 10px;
  color: #9ca3af;
  transition: transform 0.2s;
}
.faq-item.open .faq-arrow { transform: rotate(90deg); }
.faq-a {
  padding: 0 14px;
  font-size: 12px;
  color: #6b7280;
  max-height: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}
.faq-item.open .faq-a {
  max-height: 100px;
  padding: 0 14px 12px;
}

