/* 기본 설정 */
body,
html {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans KR', sans-serif;
  /* background-color: #f4f6f9; */
  color: #333;
}

.sidebar-header a {
  text-decoration: none;
  color: #adb5bd;
}

/* 레이아웃 컨테이너 */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* 사이드바 스타일 */
.sidebar {
  width: 250px;
  background-color: #343a40;
  color: #fff;
  position: fixed;
  height: 100%;
  overflow-y: auto;
  left: 0;
  top: 0;
}

.sidebar-header {
  padding: 20px;
  /* background-color: #23272b; */
  text-align: center;
  height: 70px;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.5em;
}

.sidebar-nav {
  margin-top: 30px;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0px;
}

.sidebar-nav ul li {
  margin-bottom: 0px;
}

.sidebar-nav ul li a {
  display: flex;
  align-items: center;
  padding: 15px 15px;
  color: #ffffff;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
  padding-left: 70px;
  /* justify-content: end; */
}

.sidebar-nav ul li a:hover,
.sidebar-nav ul li.active>a {
  background-color: #00d6b380;
  color: #fff;
}

.sidebar-nav ul li a i {
  /* 재근 20250416 */
  width: 30px;
  /* margin-right: 15px; */
}

/* 메인 콘텐츠 영역 */
.main-content {
  margin-left: 250px;
  width: calc(100% - 250px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 헤더 스타일 */
.main-header {
  background-color: #fff;
  /* 원래 색상으로 변경 */
  color: #333;
  /* 텍스트 색상 원래대로 변경 */
  padding: 15px 20px;
  border-bottom: 1px solid #dee2e6;
  position: fixed;
  width: calc(100% - 250px);
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 콘텐츠 중앙 정렬 */
  height: auto;
  /* 높이 자동 조정 */
  justify-content: center;
      /* 세로 중앙 정렬 */
}

/* 헤더 내 메뉴 토글과 사용자 정보 정렬 */
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: #333;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-info .username {
  margin-right: 10px;
  /* 여백 축소 */
  font-weight: 500;
  color: #23272b;
  /* 텍스트 색상 흰색으로 변경 */
}

.logout-button {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  /* 패딩 축소 */
  background-color: #495057;
  color: #fff;
  border-radius: 4px;
  /* 라운드 축소 */
  text-decoration: none;
  transition: background 0.3s;
  font-size: 0.7em;
  /* 폰트 크기 축소 */
}

.logout-button:hover {
  background-color: #c82333;
}

.logout-button i {
  margin-right: 5px;
  /* 여백 축소 */
}

/* 헤더 내 검색 및 데이터 수 컨트롤 */
.header-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  /* 요소 간 간격 */
  margin-top: 10px;
  /* 상단 여백 추가 */
}

.data-count {
  font-size: 0.9em;
  /* 폰트 크기 축소 */
  color: #fff;
  /* 텍스트 색상 흰색으로 변경 */
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 40px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9em;
}

.search-input:focus {
  outline: none;
  border-color: #007bff;
}

/* 페이지 콘텐츠 스타일 */
.content {
  padding: 40px 30px 40px 30px !important;
  /* 상단 패딩 조정 */
  flex-grow: 1;
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start !important;
  /* 콘텐츠 중앙 정렬 */
}

/* 테이블 스타일 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  /* 폰트 크기 축소 */
  line-height: 1.6;
  /* 라인 높이 축소 */
  border: 1px solid #ddd;
  border-radius: 5px;
  /* 라운드 축소 */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  /* 그림자 효과 축소 */
  background-color: #fff;
  /* 배경색 유지 */
  margin: 0 auto;
  /* 중앙 정렬 */
  border:none;
}

table thead tr {
  background-color: #ffffff;
  /* 헤더 색상 유지 */
  color: #686868 !important;
  text-align: center;
  /* 헤더 텍스트 중앙 정렬 */
}

table th,
table td {
  padding: 8px 10px;
  /* 패딩 축소 */
  border-bottom: 1px solid #dddddd;
  text-align: center;
  /* 셀 내용 중앙 정렬 */
  vertical-align: middle !important;
  color: #686868;
}

table th {
  font-weight: bold;
  font-size: 1em;
  /* 헤더 폰트 크기 축소 */
}

table th a {
  color: #888888 !important;
  text-decoration: none;
  transition: color 0.3s ease, background-color 0.3s ease;
}

table th a:hover {
  text-decoration: underline;
}

table tbody tr {
  background-color: #ffffff;
  transition: background-color 0.3s ease;
}

table tbody tr:nth-of-type(odd) {
  background-color: #fafafa;
}

table tbody tr:hover {
  background-color: #d1ecf1;
  /* 호버 효과 색상 유지 */
}

.edit-link,
.delete-link {
  padding: 4px 15px;
  border-radius: 4px;
  transition: background 0.3s, color 0.3s;
  text-decoration: none;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  border: 1px solid #bebebe;
  color: #333 !important;
  background-color: #f8f9fa;
  align-items: center !important;
    /* 세로 중앙 정렬 */
}

.edit-link {
  background-color: #e9e9e9;
  color: #414141;
}

.edit-link:hover {
  background-color: #afafaf;
}

.delete-link {
  background-color: #dc3545;
  color: #fff;
  margin-left: 5px;
  /* 여백 축소 */
}

.delete-link:hover {
  background-color: #c82333;
}

/* 페이지네이션 스타일 */
.pagination {
  margin: 20px 0;
  /* 위아래 마진 설정 */
  display: flex;
  justify-content: center;
  /* 중앙 정렬 */
  align-items: center;
  flex-wrap: wrap;
  /* 작은 화면에서 줄바꿈 */
  align-items: center; /* 세로 중앙 정렬 */
}

.pagination ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
}

.pagination li {
  margin: 0 5px;
  /* 아이템 간 간격 */
}

.pagination li a,
.pagination li span {
  display: inline-block;
  padding: 8px 12px;
  color: #007bff;
  text-decoration: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9em;
  transition: background 0.3s ease;
}

.pagination li.active span {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
}

.pagination li.disabled span {
  color: #ccc;
  border-color: #ddd;
  cursor: not-allowed;
}

.pagination li a:hover {
  background-color: #e9ecef;
}

/* 추가 정보 스타일 */
.additional-info {
  margin-top: 15px;
  /* 마진 축소 */
  font-size: 0.9em;
  /* 폰트 크기 축소 */
  color: #666;
  text-align: center;
  /* 중앙 정렬 */
}

.query-time,
.session-timer {
  margin-bottom: 5px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-250px);
    transition: transform 0.3s ease-in-out;
    position: fixed;
    z-index: 999;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .main-header {
    background-color: #fff;
    color: #333;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    position: fixed;
    width: calc(100% - 250px);
    top: 0;
    left: 250px;
    z-index: 1000;
  }

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

  .header-controls {
    flex-direction: column;
    align-items: center;
    /* 중앙 정렬 */
    gap: 10px;
    /* 요소 간 간격 축소 */
    width: 100%;
  }

  .data-count {
    font-size: 0.9em;
    margin-right: 0;
    margin-bottom: 5px;
    color: #555;
    /* 텍스트 색상 변경 */
  }

  .search-container {
    width: 100%;
  }

  .search-container i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 1em;
  }

  .search-input {
    width: 100%;
  }

  table thead {
    display: none;
  }

  table,
  table tbody,
  table tr,
  table td {
    display: block;
    width: 100%;
  }

  table tr {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    /* 각 행에 테두리 추가 */
    border-radius: 5px;
    /* 라운드 축소 */
    padding: 10px;
    background-color: #fff;
  }

  table td {
    text-align: left;
    /* 모바일에서는 왼쪽 정렬 */
    padding-left: 50%;
    position: relative;
    border: none;
    /* 기존 테두리 제거 */
  }

  table td::before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    width: calc(50% - 30px);
    text-align: left;
    font-weight: bold;
    color: #495057;
    /* 레이블 색상 변경 */
  }

  .pagination {
    max-width: 100%;
  }
}

/* 기타 스타일 */
body.active {
  overflow: hidden;
}

/* 대시보드 위젯 스타일 */
.dashboard-widgets {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  /* 위젯 간 간격 */
  justify-content: center;
  /* 중앙 정렬 */
  width: 100%;
  max-width: 1200px;
}

.widget {
  background: linear-gradient(135deg, #ffffff, #f0f0f0);
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 25px;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 250px;
}

.widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.widget-icon {
  font-size: 2.5em;
  color: #007bff;
  margin-right: 20px;
  transition: color 0.3s ease;
}

.widget:hover .widget-icon {
  color: #0056b3;
}

.widget-info h3 {
  margin: 0;
  font-size: 1.8em;
  color: #343a40;
  transition: color 0.3s ease;
}

.widget:hover .widget-info h3 {
  color: #007bff;
}

.widget-info p {
  margin: 5px 0 0 0;
  color: #6c757d;
  font-size: 1em;
}

/* 추가 위젯 스타일 예시 */
.widget-secondary {
  background: linear-gradient(135deg, #f9f9f9, #e0e0e0);
  color: #495057;
}

.widget-secondary .widget-icon {
  color: #28a745;
}

.widget-secondary:hover {
  background: linear-gradient(135deg, #f0f0f0, #dcdcdc);
}

.widget-secondary:hover .widget-icon {
  color: #1e7e34;
}

.widget-secondary:hover .widget-info h3 {
  color: #28a745;
}

/* edit-form-container 스타일 */
.edit-form-container {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 40px;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  /* 중앙 정렬 */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.edit-form-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* 폼 제목 스타일 */
.edit-form-container h1 {
  font-size: 2em;
  margin-bottom: 20px;
  color: #343a40;
  text-align: center;
}

/* 폼 설명 스타일 */
.edit-form-container p {
  font-size: 1em;
  color: #6c757d;
  text-align: center;
  margin-bottom: 30px;
}

/* 메시지 영역 스타일 */
#message {
  margin-bottom: 20px;
}

/* 폼 그룹 스타일 */
.edit-form-container .form-group {
  margin-bottom: 20px;
}

/* 레이블 스타일 */
.edit-form-container .form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
  display: block;
}

/* 텍스트 영역 스타일 */
.edit-form-container .form-control {
  border-radius: 5px;
  border: 1px solid #ced4da;
  padding: 12px;
  font-size: 1em;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.edit-form-container .form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 8px rgba(0, 123, 255, 0.25);
}

/* 버튼 스타일 */
.edit-form-container .btn-primary {
  background-color: #007bff;
  border: none;
  padding: 12px;
  font-size: 1em;
  border-radius: 5px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.edit-form-container .btn-primary:hover {
  background-color: #0056b3;
  transform: scale(1.02);
}

.edit-form-container .btn-primary:active {
  background-color: #004085;
}

/* ========================================
   DataTables 공통 스타일
   ======================================== */

/*
   ⚠️ 중요: 모든 DataTables 스타일은 /includes/layouts/head.php에서 중앙 관리됩니다.

   포함된 스타일:
   - Pagination (페이지네이션 버튼)
   - Length Menu (개씩 보기 선택박스)
   - 정렬 화살표 (선택적)

   중복 방지를 위해 이 파일에는 DataTables 관련 스타일을 추가하지 마세요.
   수정이 필요하면 head.php를 편집하세요.
*/

/* 반응형 디자인 */
@media (max-width: 768px) {
  .edit-form-container {
    padding: 30px 20px;
  }

  .edit-form-container h1 {
    font-size: 1.5em;
  }

  .edit-form-container .btn-primary {
    padding: 10px;
    font-size: 0.9em;
  }
}