/* ========================================================
   Korean Handout - Global Design System & Variables
   Modern, Clean, Academic & Professional LMS Style
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette: Sophisticated Slate & Academic Blue */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-border: #BFDBFE;
  --primary-glow: rgba(37, 99, 235, 0.12);
  
  --secondary: #0F766E;
  --secondary-hover: #115E59;
  --secondary-light: #F0FDFA;
  --secondary-border: #99F6E4;

  --accent-blue: #3B82F6;
  --accent-emerald: #059669;
  --accent-amber: #D97706;
  --accent-rose: #E11D48;

  /* Neutrals */
  --bg-page: #F8FAFC;
  --bg-gradient: #F8FAFC;
  --surface: #FFFFFF;
  --surface-solid: #FFFFFF;
  --surface-hover: #F1F5F9;
  --surface-subtle: #F8FAFC;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --text-main: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --text-inverse: #FFFFFF;

  /* Shadows & Radius */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Panel Card */
.glass-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/* Container */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.font-lg { font-size: 1.1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text-main);
  border-color: #94A3B8;
}

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
}

.btn-tts-icon {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
}
.btn-tts-icon:hover {
  background: var(--primary);
  color: white;
}

.btn-tts-icon-sm {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  transition: all var(--transition-fast);
}
.btn-tts-icon-sm:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-delete-sm {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}
.btn-delete-sm:hover {
  background: #FEE2E2;
  color: #991B1B;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  line-height: 1.2;
  white-space: nowrap;
}

.badge-topic {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
}

.badge-pos {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.badge-pub {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.badge-unpub {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.15rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

/* Flex Utilities */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.gap-1 { gap: 0.75rem; }
.gap-2 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }

/* Modal Base */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1.75rem;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--surface-hover);
}

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

.animate-pop {
  animation: modalFadeIn 0.25s ease-out;
}

/* ========================================================
   문장 첨삭 대조(diff) 공통 마크 — 원문/수정 구분
   ======================================================== */
.diff-del {
  background: #FEF2F2;
  color: #DC2626;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  border-radius: 2px;
  padding: 0 1px;
}

.diff-ins {
  background: #EFF6FF;
  color: #1D4ED8;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  font-weight: 700;
  border-radius: 2px;
  padding: 0 1px;
}
