/* 
 * 디지털헬스케어센터 웹사이트 메인 CSS 파일
 * 이 파일은 모든 CSS 모듈을 임포트하여 하나의 파일로 제공합니다.
 */

/* Tailwind CSS 통합 */
/* @import url('/lib/tailwind/tailwind.min.css'); */

/* Base Styles */
@import url('./base/reset.css');
@import url('./base/typography.css');
@import url('./base/colors.css');
@import url('./base/variables.css');

/* Layout Styles */
@import url('./layout/grid.css');
@import url('./layout/header.css');
@import url('./layout/footer.css');
@import url('./layout/sidebar.css');
@import url('./layout/container.css');

/* Component Styles */
@import url('./components/buttons.css');
@import url('./components/forms.css');
@import url('./components/cards.css');
@import url('./components/tables.css');
@import url('./components/alerts.css');
@import url('./components/badges.css');
@import url('./components/modal.css');
@import url('./components/navigation.css');
@import url('./components/pagination.css');
@import url('./components/scroll-top.css'); /* ← 추가 */

/* Page Styles */
@import url('./pages/home.css');
@import url('./pages/certificate.css');
@import url('./pages/education.css');
@import url('./pages/board.css');
@import url('./pages/auth.css');
@import url('./pages/mypage.css');
@import url('./pages/admin.css');
@import url('./pages/about.css');

/* Utility Styles */
@import url('./utilities/spacing.css');
@import url('./utilities/flex.css');
@import url('./utilities/display.css');
@import url('./utilities/text.css');

/* 
 * 기본 스타일 재정의
 */
:root {
  --primary-color: #2563eb; /* 파란색 - 메인 브랜드 색상 */
  --secondary-color: #1e40af; /* 진한 파란색 */
  --accent-color: #f59e0b; /* 노란색 - 강조 색상 */
  --success-color: #10b981; /* 초록색 */
  --warning-color: #f59e0b; /* 주황색 */
  --danger-color: #ef4444; /* 빨간색 */
  --text-primary: #111827; /* 거의 검은색 */
  --text-secondary: #4b5563; /* 회색 */
  --text-tertiary: #9ca3af; /* 밝은 회색 */
  --background-light: #f9fafb; /* 밝은 배경 */
  --background-medium: #f3f4f6; /* 중간 밝기 배경 */
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: #ffffff;
}

/* 공통 컨테이너 스타일 - Tailwind 브레이크포인트에 맞춤 */
.container {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

/* 반응형 컨테이너 - Tailwind 브레이크포인트 사용 */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

/* 중간 브레이크포인트 추가 - 레이아웃 문제 해결 */
@media (min-width: 896px) {
  .container {
    max-width: 896px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

/* 네비게이션 전환점 (1200px) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* 전체 화면 컨테이너 (최대 1536px까지) */
@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

/* 공통 섹션 스타일 */
section {
  padding: 4rem 0;
}

/* 중간 화면에서의 섹션 패딩 조정 */
@media (max-width: 1023px) {
  section {
    padding: 3rem 0;
  }
}

@media (max-width: 767px) {
  section {
    padding: 2.5rem 0;
  }
}

/* 공통 헤딩 스타일 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* 반응형 헤딩 크기 조정 */
@media (max-width: 1023px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
}

/* 버튼 스타일 */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  color: #fff;
  background-color: var(--primary-color);
}

/* 링크 스타일 */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: var(--secondary-color);
}

/* 카드 스타일 */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.25rem;
}

.card-body {
  flex: 1 1 auto;
  padding: 1.25rem;
}

/* 반응형 카드 패딩 */
@media (max-width: 1023px) {
  .card-body {
    padding: 1rem;
  }
}

/* 폼 요소 스타일 */
.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* 헤더 네비게이션 스타일 */
.main-nav ul {
  display: flex;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  display: block;
}

.main-nav a:hover {
  color: var(--primary-color);
}

/* 드롭다운 메뉴 스타일 */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  float: left;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  font-size: 1rem;
  color: var(--text-primary);
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.25rem;
}

.submenu a {
  display: block;
  width: 100%;
  padding: 0.25rem 1.5rem;
  clear: both;
  font-weight: 400;
  color: var(--text-primary);
  text-align: inherit;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
}

.submenu a:hover {
  color: var(--primary-color);
  background-color: var(--background-light);
}

/* 모바일 메뉴 토글 버튼 */
#mobile-menu-button {
  display: none;
}

/* 네비게이션 브레이크포인트 - 1200px 기준 정확히 적용 */
@media (max-width: 1199px) {
  /* 메인 네비게이션 숨기기 */
  .main-nav,
  #main-header .main-nav {
    display: none !important;
  }
  
  /* 모바일 버튼 표시 */
  #mobile-menu-button {
    display: flex !important;
  }
  
  /* 1199px 이하에서 계정 버튼 완전히 숨기기 - 다양한 선택자로 확실하게 */
  .auth-buttons,
  #main-header .auth-buttons,
  .auth-buttons .login-btn,
  .auth-buttons .signup-btn,
  #main-header .auth-buttons .login-btn,
  #main-header .auth-buttons .signup-btn,
  #main-header .container .auth-buttons,
  header .auth-buttons {
    display: none !important;
    visibility: hidden !important;
  }
}

/* 1200px 이상에서는 정상적으로 네비게이션 표시 */
@media (min-width: 1200px) {
  /* 메인 네비게이션 표시 */
  .main-nav,
  #main-header .main-nav {
    display: flex !important;
  }
  
  /* 모바일 버튼 숨기기 */
  #mobile-menu-button {
    display: none !important;
  }
  
  /* 계정 버튼 표시 */
  .auth-buttons,
  #main-header .auth-buttons {
    display: flex !important;
    visibility: visible !important;
  }
  
  .auth-buttons .login-btn,
  .auth-buttons .signup-btn,
  #main-header .auth-buttons .login-btn,
  #main-header .auth-buttons .signup-btn {
    display: inline-block !important;
    visibility: visible !important;
  }
  
  /* 모바일 오버레이 완전히 숨기기 */
  #mobile-menu-overlay {
    display: none !important;
  }
}

/* 모바일 메뉴 */
#mobile-menu {
  width: 100%;
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
}

/* 로고 스타일 */
.logo img {
  height: auto;
}

/* 페이지네이션 스타일 */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  border-radius: 0.25rem;
}

.page-item:not(:first-child) .page-link {
  margin-left: -1px;
}

.page-link {
  position: relative;
  display: block;
  padding: 0.5rem 0.75rem;
  margin-left: -1px;
  line-height: 1.25;
  color: var(--primary-color);
  background-color: #fff;
  border: 1px solid #dee2e6;
}

.page-link:hover {
  z-index: 2;
  color: var(--secondary-color);
  text-decoration: none;
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.page-item.active .page-link {
  z-index: 3;
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* 알림 및 경고 메시지 스타일 */
.alert {
  position: relative;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

/* 유틸리티 클래스 */
.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.hidden {
  display: none !important;
}

/* 로그인/회원가입 폼 스타일 */
.auth-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 테이블 스타일 */
.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--text-primary);
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid #dee2e6;
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid #dee2e6;
}

.table tbody + tbody {
  border-top: 2px solid #dee2e6;
}

/* 반응형 테이블 */
@media (max-width: 768px) {
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 이미지 스타일 */
.img-fluid {
  max-width: 100%;
  height: auto;
}

/* 섹션 배경색 변형 */
.bg-light {
  background-color: var(--background-light);
}

.bg-medium {
  background-color: var(--background-medium);
}

/* 푸터 스타일 */
footer {
  background-color: #1f2937;
  color: white;
  padding: 3rem 0;
}

footer a {
  color: #9ca3af;
  transition: color 0.15s ease-in-out;
}

footer a:hover {
  color: white;
}

/* 애니메이션 효과 */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 추가 커스텀 스타일 */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-section {
  background-image: linear-gradient(to right, rgba(37, 99, 235, 0.9), rgba(79, 70, 229, 0.9)), url('../images/banners/hero-bg.jpg');
  background-size: cover;
  background-position: center;
}

/* 모달 기본 스타일 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
  max-width: 500px;
  margin: 1.75rem auto;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 0.3rem;
  outline: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  border-top-left-radius: 0.3rem;
  border-top-right-radius: 0.3rem;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid #dee2e6;
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
}

.close {
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  opacity: 0.5;
  background: none;
  border: none;
  padding: 0;
}

.close:hover {
  opacity: 0.75;
}

.show {
  display: block;
}

/* 그리드 레이아웃 개선 - Tailwind 클래스 덮어쓰기 */
@media (min-width: 640px) and (max-width: 767px) {
  /* 모바일에서 2열 그리드 */
  .grid-cols-1 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  /* 태블릿에서 적절한 그리드 */
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .md\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .md\:grid-cols-4 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  /* 데스크톱 작은 화면에서 적절한 그리드 */
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* 공지사항 & 칼럼 섹션 반응형 개선 */
@media (max-width: 1023px) {
  .notice-column-section .grid,
  .notice-column-section .lg\:grid-cols-2,
  .lg\:grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
}

/* CTA 섹션 반응형 개선 */
@media (max-width: 1023px) {
  .cta-section {
    margin: 1rem 0;
    border-radius: 8px;
  }
}

/* 홈페이지 히어로 섹션 개선 */
@media (max-width: 767px) {
  .hero-section .flex {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-section .flex > * {
    width: 100%;
  }
}

/* 섹션별 그리드 간격 조정 */
@media (max-width: 1023px) {
  .gap-6 {
    gap: 1rem !important;
  }
}

@media (max-width: 767px) {
  .gap-6,
  .gap-4 {
    gap: 0.75rem !important;
  }
}

/* 플렉스 버튼의 반응형 조정 */
@media (max-width: 767px) {
  .flex.flex-wrap.gap-4 {
    flex-direction: column;
  }
  
  .flex.flex-wrap.gap-4 > * {
    width: 100%;
    text-align: center;
  }
}