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

/* --- Design Tokens & Variables --- */
:root {
  /* Brand Colors */
  --logo-color: #0e4987;
  --bg-white: #ffffff;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;

  /* Theme Colors */
  --theme-written: #0e4987;
  --theme-written-rgb: 14, 73, 135;
  --theme-practical: #005b5e;
  --theme-practical-rgb: 0, 91, 94;
  --theme-recommend: #812940;
  --theme-recommend-rgb: 129, 41, 64;

  /* Current active theme color variable - defaulted to written theme */
  --theme-primary: var(--theme-written);
  --theme-primary-rgb: var(--theme-written-rgb);

  /* Neutral Palette */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  /* Semantic Colors */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Typography */
  --font-primary: 'Noto Sans KR', sans-serif;
  --font-accent: 'Outfit', sans-serif;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(14, 73, 135, 0.06);
  --shadow-lg: 0 10px 30px -5px rgba(14, 73, 135, 0.1);
  --shadow-hover: 0 20px 40px -10px rgba(14, 73, 135, 0.15);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);

  /* Borders */
  --border-width: 1px;
  --border-color: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Layout */
  --header-height: 80px;
  --content-max-width: 1200px;
}

/* --- Theme classes override --- */
body.theme-written {
  --theme-primary: var(--theme-written);
  --theme-primary-rgb: var(--theme-written-rgb);
}

body.theme-practical {
  --theme-primary: var(--theme-practical);
  --theme-primary-rgb: var(--theme-practical-rgb);
}

body.theme-recommend {
  --theme-primary: var(--theme-recommend);
  --theme-primary-rgb: var(--theme-recommend-rgb);
}

/* --- Global Resets & Defaults --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-light);
  color: var(--neutral-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.25s ease;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Typography Utilities --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.3;
}

/* --- Header / Navigation --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--border-width) solid rgba(226, 232, 240, 0.6);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
  height: 70px;
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--content-max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo Group */
.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-group img {
  height: 48px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo-group:hover img {
  transform: rotate(-5deg) scale(1.05);
}

.logo-text {
  font-family: var(--font-accent);
  font-weight: 800;
  font-size: 24px;
  color: var(--logo-color);
  letter-spacing: -0.5px;
  display: flex;
  flex-direction: column;
}

.logo-subtext {
  font-family: var(--font-primary);
  font-size: 10px;
  color: var(--neutral-400);
  font-weight: 500;
  margin-top: -4px;
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  color: var(--neutral-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover,
.nav-item.active .nav-link {
  color: var(--theme-primary);
  background-color: rgba(var(--theme-primary-rgb), 0.05);
}

/* Dropdown Menu styling */
.dropdown-menu {
  position: absolute;
  top: calc(100% - 10px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-white);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-600);
  white-space: nowrap;
}

.dropdown-link:hover {
  background-color: rgba(var(--theme-primary-rgb), 0.05);
  color: var(--theme-primary);
  transform: translateX(4px);
}

.dropdown-link i {
  font-size: 14px;
}

/* Call to Action Button */
.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-admin-mode {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  color: var(--neutral-700);
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
}

.btn-admin-mode:hover {
  background: var(--neutral-800);
  color: var(--bg-white);
}

.btn-admin-mode.active {
  background: #f59e0b;
  color: #fff;
  animation: pulse-admin 2s infinite;
}

@keyframes pulse-admin {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Mobile Menu Button */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--neutral-700);
  cursor: pointer;
}

/* --- Main Layout Wrapper --- */
main {
  flex: 1;
  margin-top: var(--header-height);
}

/* --- Hero & Intro Sections --- */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), 0.03) 0%, rgba(var(--theme-primary-rgb), 0.08) 100%);
  padding: 80px 24px 100px;
  overflow: hidden;
  text-align: center;
}

.hero-bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  background-image: radial-gradient(var(--theme-primary) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(var(--theme-primary-rgb), 0.1);
  color: var(--theme-primary);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 24px;
  border: 1px solid rgba(var(--theme-primary-rgb), 0.15);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-title {
  font-family: var(--font-primary);
  font-size: 46px;
  font-weight: 900;
  color: var(--neutral-900);
  line-height: 1.25;
  margin-bottom: 20px;
  letter-spacing: -1.5px;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero-title span {
  color: var(--theme-primary);
}

.hero-description {
  font-size: 18px;
  color: var(--neutral-600);
  margin-bottom: 36px;
  font-weight: 400;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  word-break: keep-all;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Common Content Container --- */
.content-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 60px 24px;
}

/* Page Headers */
.page-header {
  margin-bottom: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: var(--border-width) solid var(--border-color);
  padding-bottom: 20px;
}

.page-title-group h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--neutral-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-group h2 i {
  color: var(--theme-primary);
}

.page-title-group p {
  color: var(--neutral-500);
  font-size: 14px;
  margin-top: 4px;
}

/* --- Buttons & UI Elements --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background-color: var(--theme-primary);
  color: var(--bg-white);
  box-shadow: 0 4px 14px rgba(var(--theme-primary-rgb), 0.3);
}

.btn-primary:hover {
  background-color: rgb(from var(--theme-primary) calc(r * 0.85) calc(g * 0.85) calc(b * 0.85));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--theme-primary-rgb), 0.4);
}

.btn-secondary {
  background-color: var(--bg-white);
  color: var(--neutral-700);
  border: var(--border-width) solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--neutral-50);
  color: var(--neutral-900);
  border-color: var(--neutral-400);
}

.btn-accent {
  background-color: #f59e0b;
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-accent:hover {
  background-color: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* Mini Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-edit {
  background-color: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.btn-edit:hover {
  background-color: #d97706;
  color: #fff;
}

.btn-delete {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.btn-delete:hover {
  background-color: #ef4444;
  color: #fff;
}

.btn-move {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.btn-move:hover:not(:disabled) {
  background-color: #3b82f6;
  color: #fff;
}

.filter-btn {
  background: transparent;
  color: var(--neutral-600);
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background: #fff;
  color: var(--theme-primary);
  box-shadow: var(--shadow-sm);
}

/* --- Cards / Grid Layout --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
}

.card {
  background-color: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(var(--theme-primary-rgb), 0.2);
}

.card-header {
  padding: 24px 24px 16px;
  position: relative;
}

.card-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.card-badge-written {
  background-color: rgba(14, 73, 135, 0.1);
  color: #0e4987;
}

.card-badge-practical {
  background-color: rgba(0, 91, 94, 0.1);
  color: #005b5e;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: 8px;
}

.card-body {
  padding: 0 24px 24px;
  color: var(--neutral-600);
  font-size: 14px;
  flex: 1;
}

.card-footer {
  padding: 16px 24px;
  background-color: var(--neutral-50);
  border-top: var(--border-width) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--neutral-500);
}

.card-meta-info {
  display: flex;
  gap: 12px;
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Archive (자료실) Table & Upload UI --- */
.archive-list {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: var(--border-width) solid var(--border-color);
  border-top: 4px solid var(--theme-primary);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.archive-table th {
  background-color: var(--neutral-50);
  padding: 16px 24px;
  font-weight: 700;
  color: var(--neutral-700);
  font-size: 14px;
  border-bottom: 2px solid var(--border-color);
}

.archive-table td {
  padding: 18px 24px;
  border-bottom: var(--border-width) solid var(--border-color);
  color: var(--neutral-600);
  font-size: 14px;
}

.archive-table tr:last-child td {
  border-bottom: none;
}

.archive-table tr:hover td {
  background-color: rgba(var(--theme-primary-rgb), 0.01);
}

.archive-title-cell {
  font-weight: 600;
  color: var(--neutral-900);
  cursor: pointer;
}

.archive-title-cell:hover {
  color: var(--theme-primary);
}

.download-link {
  color: var(--theme-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background-color: rgba(var(--theme-primary-rgb), 0.08);
  white-space: nowrap;
}

.download-link:hover {
  background-color: var(--theme-primary);
  color: #fff;
  transform: translateY(-1px);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--neutral-400);
}

/* --- Filter Group Buttons --- */
.filter-group {
  display: inline-flex;
  gap: 4px;
  background: var(--neutral-100);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.filter-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: var(--neutral-900);
}

.filter-btn.active {
  background: #fff;
  color: var(--theme-primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* --- Pagination Controls --- */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  color: var(--neutral-700);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--theme-primary);
  color: var(--theme-primary);
  background: rgba(var(--theme-primary-rgb), 0.05);
}

.pagination-btn.active {
  background: var(--theme-primary);
  color: #fff;
  border-color: var(--theme-primary);
  font-weight: 700;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--neutral-300);
}

.empty-state p {
  font-size: 15px;
  font-weight: 500;
}

/* --- YouTube Custom Player --- */
.youtube-player-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* 16:9 Aspect Ratio */
  background-color: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}

.youtube-iframe-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Block mouse events to prevent share/link clicks */
}

.youtube-iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Block clicks completely inside video screen overlay */
.youtube-screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  background: transparent;
  cursor: pointer;
}

/* Custom Play Overlay (Pre-Play or Paused State Cover) */
.player-custom-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.player-custom-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.player-custom-cover-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
}

.player-play-btn {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background-color: var(--theme-primary);
  color: #fff;
  border: none;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(var(--theme-primary-rgb), 0.5);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.player-play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(var(--theme-primary-rgb), 0.7);
}

.player-custom-cover.playing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Custom Control Bar */
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  padding: 20px 20px 10px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.youtube-player-container:hover .player-controls,
.youtube-player-container.controls-active .player-controls {
  opacity: 1;
  transform: translateY(0);
}

.player-progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  transition: height 0.1s ease;
}

.player-progress-bar-container:hover {
  height: 8px;
}

.player-progress-bar {
  height: 100%;
  background-color: var(--theme-primary);
  border-radius: var(--radius-full);
  width: 0%;
  position: relative;
}

.player-progress-handle {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background-color: #fff;
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%) scale(0);
  transition: transform 0.1s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.player-progress-bar-container:hover .player-progress-handle {
  transform: translateY(-50%) scale(1);
}

.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.player-controls-left,
.player-controls-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-ctrl-btn {
  background: none;
  border: none;
  color: #e2e8f0;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-ctrl-btn:hover {
  color: var(--theme-primary);
}

.player-time-display {
  font-size: 13px;
  font-family: var(--font-accent);
}

.player-volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-volume-slider {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.player-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* YouTube warning banner overlay */
.player-block-warning {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #f1f5f9;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  opacity: 0.8;
}

/* --- Recommendations (추천 사이트) --- */
.recommend-card {
  border-top: 4px solid var(--theme-recommend);
}

.recommend-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: rgba(var(--theme-recommend-rgb), 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--theme-recommend);
  margin-bottom: 16px;
}

.recommend-link {
  color: var(--theme-recommend);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
}

.recommend-link:hover {
  text-decoration: underline;
}

/* --- Admin / Settings Drawer or Modals --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 550px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.open .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  background-color: var(--neutral-50);
  border-bottom: var(--border-width) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--neutral-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header h3 i {
  color: var(--theme-primary);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--neutral-400);
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-close-modal:hover {
  color: var(--neutral-800);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--neutral-700);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: var(--border-width) solid var(--border-color);
  background-color: var(--bg-white);
  transition: all 0.2s ease;
  font-size: 14px;
}

.form-input:focus {
  outline: none;
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.15);
}

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

.form-helper {
  font-size: 12px;
  color: var(--neutral-400);
  margin-top: 4px;
}

.modal-footer {
  padding: 16px 24px;
  background-color: var(--neutral-50);
  border-top: var(--border-width) solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* --- Toast Notification System --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--neutral-900);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  transform: translateY(20px);
  opacity: 0;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 350px;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--error);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

.toast-icon {
  font-size: 16px;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--error);
}

.toast.warning .toast-icon {
  color: var(--warning);
}

@keyframes toastIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --- Footer --- */
footer {
  margin-top: auto;
  background-color: var(--neutral-900);
  color: var(--neutral-400);
  padding: 60px 24px 30px;
  border-top: var(--border-width) solid var(--neutral-800);
}

.footer-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-info {
  max-width: 360px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.footer-logo img {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-logo-text {
  font-family: var(--font-accent);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}

.footer-slogan {
  font-size: 14px;
  color: var(--neutral-400);
  margin-bottom: 12px;
}

.footer-links-grid {
  display: flex;
  gap: 80px;
  flex-wrap: wrap;
}

.footer-links-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links-col a {
  font-size: 14px;
  color: var(--neutral-400);
}

.footer-links-col a:hover {
  color: #fff;
  transform: translateX(2px);
}

.footer-bottom {
  border-top: 1px solid var(--neutral-800);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-bottom-links a:hover {
  color: #fff;
}

/* --- Media Queries --- */
@media (max-width: 992px) {
  .nav-links {
    display: none;
    /* Hide standard links */
  }

  .mobile-toggle {
    display: block;
    /* Show menu toggle */
  }

  .hero-title {
    font-size: 36px;
  }

  .footer-links-grid {
    gap: 40px;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 30px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile Sidebar Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background-color: var(--bg-white);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.mobile-nav-drawer.open {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-nav-header .logo-text {
  font-size: 20px;
}

.btn-close-mobile {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--neutral-600);
  cursor: pointer;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--neutral-400);
  letter-spacing: 0.5px;
  margin-top: 10px;
}

.mobile-nav-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--neutral-700);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.mobile-nav-link:hover {
  color: var(--theme-primary);
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}