/* ============================================
   교육부서 공통 스타일 시스템
   - 모든 교육부서에서 동일하게 적용
   - 부서별 색상은 dept-themes.css에서 관리
   ============================================ */

/* 폰트 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--dept-bg, #f8fafc);
  color: #374151;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   컨테이너
   ============================================ */
.dept-container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  background: white;
  position: relative;
}

@media (min-width: 768px) {
  body {
    padding-top: 120px;
  }
  .dept-container {
    max-width: 1200px;
    border-radius: 16px;
    margin: 24px auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    min-height: auto;
  }
}

/* ============================================
   모바일 헤더
   ============================================ */
.dept-header {
  background: var(--dept-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
  padding: 20px 16px;
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  position: relative;
}

.dept-header-home {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  z-index: 10;
}

.dept-header-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.dept-header-subtitle {
  font-size: 13px;
  text-align: center;
  opacity: 0.9;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .dept-header {
    display: none;
  }
}

/* ============================================
   PC 헤더
   ============================================ */
.dept-pc-header {
  display: none;
}

@media (min-width: 768px) {
  .dept-pc-header {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--dept-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  }

  .dept-pc-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
  }

  .dept-pc-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .dept-pc-header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
  }

  .dept-pc-header-logo img {
    height: 40px;
  }

  .dept-pc-header-logo span {
    font-size: 18px;
    font-weight: 700;
  }

  .dept-pc-header-nav {
    display: flex;
    align-items: center;
    height: 52px;
    gap: 8px;
  }

  .dept-pc-nav-item {
    color: rgba(255,255,255,0.9);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
  }

  .dept-pc-nav-item:hover {
    background: rgba(255,255,255,0.15);
    color: white;
  }

  .dept-pc-nav-item.active {
    background: rgba(255,255,255,0.2);
    color: white;
  }

  .dept-pc-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .dept-pc-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
  }

  .dept-pc-btn-home {
    background: rgba(255,255,255,0.15);
    color: white;
  }

  .dept-pc-btn-home:hover {
    background: rgba(255,255,255,0.25);
  }
}

/* ============================================
   메뉴 그리드
   ============================================ */
.dept-menu-section {
  padding: 20px 16px;
}

.dept-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dept-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  background: var(--dept-card-bg, #f8fafc);
  border-radius: 16px;
  text-decoration: none;
  color: #374151;
  transition: all 0.2s;
  border: 1px solid var(--dept-border, #e5e7eb);
}

.dept-menu-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: var(--dept-primary, #667eea);
}

.dept-menu-item:active {
  transform: scale(0.98);
}

.dept-menu-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dept-icon-bg, rgba(102, 126, 234, 0.1));
  border-radius: 12px;
  margin-bottom: 8px;
}

.dept-menu-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--dept-primary, #667eea);
}

.dept-menu-label {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: #374151;
}

@media (min-width: 768px) {
  .dept-menu-section {
    padding: 32px 24px;
  }

  .dept-menu-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .dept-menu-item {
    padding: 28px 16px;
  }

  .dept-menu-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
  }

  .dept-menu-icon svg {
    width: 26px;
    height: 26px;
  }

  .dept-menu-label {
    font-size: 14px;
  }
}

/* ============================================
   콘텐츠 카드
   ============================================ */
.dept-section {
  padding: 20px 16px;
}

.dept-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dept-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

.dept-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.dept-card-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
}

/* ============================================
   하단 네비게이션
   ============================================ */
.dept-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.dept-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
  flex: 1;
}

.dept-nav-item.active {
  color: var(--dept-primary, #667eea);
}

.dept-nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.dept-nav-icon svg {
  width: 24px;
  height: 24px;
}

.dept-nav-label {
  font-size: 11px;
  font-weight: 500;
}

@media (min-width: 768px) {
  .dept-bottom-nav {
    display: none;
  }
}

/* ============================================
   버튼
   ============================================ */
.dept-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.dept-btn-primary {
  background: var(--dept-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
  color: white;
}

.dept-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.dept-btn-secondary {
  background: var(--dept-light-bg, #f3f4f6);
  color: #374151;
}

.dept-btn-secondary:hover {
  background: #e5e7eb;
}

/* ============================================
   배지
   ============================================ */
.dept-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--dept-badge-bg, rgba(102, 126, 234, 0.1));
  color: var(--dept-primary, #667eea);
}

/* ============================================
   유틸리티
   ============================================ */
.dept-text-center { text-align: center; }
.dept-text-left { text-align: left; }
.dept-text-right { text-align: right; }

.dept-mt-1 { margin-top: 4px; }
.dept-mt-2 { margin-top: 8px; }
.dept-mt-3 { margin-top: 12px; }
.dept-mt-4 { margin-top: 16px; }

.dept-mb-1 { margin-bottom: 4px; }
.dept-mb-2 { margin-bottom: 8px; }
.dept-mb-3 { margin-bottom: 12px; }
.dept-mb-4 { margin-bottom: 16px; }

.dept-p-1 { padding: 4px; }
.dept-p-2 { padding: 8px; }
.dept-p-3 { padding: 12px; }
.dept-p-4 { padding: 16px; }

/* ============================================
   로딩
   ============================================ */
.dept-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #9ca3af;
}

.dept-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--dept-primary, #667eea);
  border-radius: 50%;
  animation: dept-spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes dept-spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   빈 상태
   ============================================ */
.dept-empty {
  text-align: center;
  padding: 48px 24px;
  color: #9ca3af;
}

.dept-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.dept-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
}

.dept-empty-desc {
  font-size: 14px;
  line-height: 1.5;
}

/* ============================================
   페이지 여백 (하단 네비 공간)
   ============================================ */
.dept-page-content {
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  .dept-page-content {
    padding-bottom: 32px;
  }
}
