/* 상단 네비게이션 */
.top-bar {
  background-color: #f0f2f5; /* 밝은 그레이 */
  font-size: 14px;
  padding: 8px 0;
}

.top-bar-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px; /* 링크 사이 간격 */
  flex-wrap: nowrap;
}

.top-links a {
  margin-left: 15px;
  color: #444;
  text-decoration: none;
  font-weight: 600;
}

.top-links a:hover {
  color: #00AEEF;
  text-decoration: underline;
}

/* 메인 네비게이션 */
.main-nav {
  background: linear-gradient(90deg, #00bbff 0%, #0070b1 100%);
  color: #fff;
  padding: 18px 0;
  box-shadow: none; /* 그림자 제거 */
}

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

.subject-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.subject-links li a {
  color: #fff;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.subject-links li a:hover {
  background-color: rgba(255,255,255,0.2);
}

body {
  font-family: 'Pretendard', sans-serif;
  font-size: 15px;
  color: #333;
  margin: 0;
  padding: 0;
  background: #fafafa;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 30px;
}

header {
  background-color: #2d3e50;
  color: #fff;
  padding: 15px 0;
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
}

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

.btn-signup {
  background-color: #ff6f61;
  color: white !important;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  transition: background-color 0.3s ease;
}

.btn-signup:hover {
  background-color: #e65b4f;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  transition: background-color 0.3s ease;
  border-radius: 4px;
}

nav ul li a:hover {
  background-color: #4a6278;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.search-form select,
.search-form input[type="text"] {
  height: 36px;           /* 높이 통일 */
  padding: 6px 10px;      /* 내부 여백 */
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  vertical-align: middle; /* 정렬 보정 */
}

.search-form input::placeholder {
  color: #999;
}

.search-form label {
  display: flex;
  align-items: center;
  font-size: 14px;
}

.search-form input[type="checkbox"] {
  margin-right: 4px;
}

.search-btn {
  background-color: #1e88e5;         /* 진한 파란색 배경 */
  color: white;                      /* 텍스트는 흰색 */
  border: none;                      /* 테두리 제거 */
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  height: 36px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 약한 그림자 */
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.search-btn:hover {
  background-color: #1669c1;         /* 호버 시 더 짙은 파랑 */
  transform: translateY(-1px);       /* 살짝 떠오르는 느낌 */
}

.search-tips {
  font-size: 14px;
  margin-top: 20px;
  color: #444;
}

.search-tips .red {
  color: red;
}

footer {
  background-color: #f1f1f1;
  padding: 15px 0;
  text-align: center;
  font-size: 14px;
  color: #666;
}

 /* 자료 목록 테이블 */
  .post-list-section {
    margin: 40px 0 60px 0;
  }
  
  .post-list-section h2 {
    margin-bottom: 20px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d3e50;
  }
  
  .post-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
    table-layout: auto;
  }
  
  .post-table thead tr {
    background-color: #2d3e50;
    color: white;
    font-weight: 600;
    text-align: left;
  }
  
  .post-table th,
  .post-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #ddd;
    text-align: center;
  }
  
  .post-table tbody tr:hover {
    background-color: #f5f7fa;
  }

  .post-table td.title-cell {
    max-width: 240px;          /* 적절한 고정 너비 (필요시 조정) */
    white-space: nowrap;       /* 줄바꿈 방지 */
    overflow: hidden;          /* 넘치는 텍스트 감춤 */
    text-overflow: ellipsis;   /* ... 처리 */
  }
  
  .file-link {
    color: #ff6f61;
    text-decoration: none;
    font-weight: 600;
  }
  
  .file-link:hover {
    text-decoration: underline;
  }
  
  .no-data {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-style: italic;
  }
  

/* 드롭다운 스타일 */
.nav-links li.dropdown {
  position: relative;
}

.nav-links .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 160px;
}

.nav-links li.dropdown:hover .dropdown-menu {
  display: block;
}

/* 메뉴 항목 스타일 */
.dropdown-menu li {
  display: block;
}

.dropdown-menu li a {
  display: block;
  padding: 10px 15px;
  color: #333;
  background-color: white;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.dropdown-menu li a:hover {
  background-color: #f1f1f1;
  color: #2d3e50;
}

/* 업로드 버튼 */
.upload-btn-container {
  text-align: right;
}

.upload-link {
  display: inline-block;
  padding: 8px 16px;
  background-color: #1e88e5;
  color: white;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.upload-link:hover {
  background-color: #1669c1;
}

.upload-container {
  max-width: 800px;
  margin: 30px auto;
  padding: 20px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
}
.upload-container h2 {
  margin-bottom: 20px;
}
.upload-container label {
  font-weight: bold;
  display: inline-block;
  margin-top: 10px;
}
.upload-btn {
  background-color: #007bff;
  color: white;
  padding: 10px 20px;
  margin-top: 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.upload-btn:hover {
  background-color: #0056b3;
}
.error-message {
  color: red;
  margin: 20px 0;
}

.flashes {
  list-style: none;
  padding: 10px;
  margin: 10px auto;
  max-width: 600px;
  border: 1px solid #ccc;
  background-color: #fdf6e3;
  color: #333;
}
.flashes li {
  margin-bottom: 5px;
}

.admin-tabs a {
  margin-right: 15px;
  text-decoration: none;
  color: #2c3e50;
  font-weight: bold;
}
.admin-tabs a:hover {
  color: #007BFF;
}

.nav-username {
  font-weight: bold;
  color: #ff6f61;
}

.upload-form {
  background-color: #ffffff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 700px;
  margin: 30px auto;
}

.upload-form h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.8rem;
  color: #2d3e50;
}

.upload-form .form-group {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.upload-form label {
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
  color: #333;
}

.upload-form input[type="file"],
.upload-form input[type="text"],
.upload-form select {
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  flex: 1;
  min-width: 150px;
}

.upload-form input[type="file"] {
  border: none;
}

.upload-form button.upload-btn {
  background-color: #008ddc;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
}

.upload-form button.upload-btn:hover {
  background-color: #0070b1;
}

.auth-warning {
  text-align: center;
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 6px;
  margin: 20px 0;
  font-weight: bold;
}

.tab-menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tabs-left {
  display: flex;
  gap: 12px;
}

.tab-link {
  padding: 8px 16px;
  font-size: 15px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: #333;
}

.tab-link.active {
  font-weight: 600;
  border-color: #1e88e5;
  color: #1e88e5;
}

.tab-link:hover {
  color: #1e88e5;
  border-color: #90caf9;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

html, body, main, header {
  margin: 0;
  padding: 0;
}

main.container {
  padding-top: 20px; /* 여백 추가 필요시 */
}

#examFilters, #resourceFilters {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

#examFilters select,
#resourceFilters select {
  margin-bottom: 8px;
  min-width: 140px;
}

.user-info {
  margin-right: 20px;
  font-weight: 500;
  color: #333;
  white-space: nowrap; /* 줄바꿈 방지 */
  font-weight: bold;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ---------- 회원가입 전용 스타일 ---------- */
.register-container {
  max-width: 500px;
  margin: 50px auto;
  padding: 30px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  font-family: 'Pretendard', sans-serif;
}

.register-container h2 {
  text-align: center;
  font-weight: 700;
  color: #333;
  margin-bottom: 30px;
}

.register-container h3 {
  margin-top: 30px;
  font-size: 18px;
  color: #2c3e50;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.register-form .form-group {
  margin-bottom: 20px;
}

.register-form label {
  font-weight: 600;
  margin-bottom: 5px;
  display: inline-block;
}

.register-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-family: 'Pretendard', sans-serif;
}

.btn-submit {
  width: 100%;
  background-color: #4A90E2;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.btn-submit:hover {
  background-color: #357ABD;
}

.login-link {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

/* Sticky Footer Layout */
html, body {
  height: 100%;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-wrapper {
  flex: 1;
}



.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: gray;
  transition: color 0.3s ease;
  text-align: center;
}

.like-btn:hover {
  transform: scale(1.1);
  color: #e74c3c;
}

.like-btn.liked {
  color: #e74c3c;
  font-weight: bold;
}

.like-btn .like-count {
  margin-left: 5px;
  font-size: 0.9rem;
}


.pagination {
  text-align: center;
  margin: 20px 0;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 6px 10px;
  margin: 2px;
  border: 1px solid #ddd;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
}
.pagination .current {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}
.pagination .ellipsis {
  padding: 6px 10px;
  color: #999;
}

.global-flash-wrapper {
  max-width: 800px;
  margin: 20px auto 30px auto;
  padding: 0 20px;
}

.alert {
  padding: 14px 20px;
  margin-bottom: 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border-left: 6px solid;
  background-color: #f9f9f9;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.alert-success {
  background-color: #e9f9ec;
  color: #276738;
  border-color: #34a853;
}

.alert-error {
  background-color: #fdeaea;
  color: #a94442;
  border-color: #dc3545;
}

.logo-link {
  text-decoration: none;       /* 밑줄 제거 */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  font-family: 'Pretendard', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: #afeaff;
  text-shadow: 1px 1px 2px rgba(0, 174, 239, 0.35);
  letter-spacing: 1.5px;
  margin: 0;
  transition: color 0.3s ease;
}

.logo-sub {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.6em;
  text-transform: lowercase;
  color: #afeaff;
  opacity: 0.75;
  margin-top: 2px;
  text-align: center;
}

.logo-link:hover .logo {
  color: #00b2ff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
.admin-table th, .admin-table td {
  border: 1px solid #ddd;
  padding: 10px;
}
.admin-table th {
  background-color: #f2f2f2;
}

.policy-page h2 {
  margin-top: 30px;
  font-size: 1.8em;
  color: #333;
}
.policy-section {
  margin-bottom: 30px;
}
.policy-section h3 {
  margin-bottom: 10px;
  color: #007bff;
}
ul, ol {
  padding-left: 20px;
}


/* 회원가입 - 이메일 조합 입력용 */
.email-combo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.email-combo input[type="text"],
.email-combo select {
  padding: 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: 'Pretendard', sans-serif;
}

#custom_domain {
  display: none;
}

#email-error {
  color: red;
  font-size: 0.85em;
  margin-top: 5px;
}

.email-row {
  display: flex;
  gap: 8px;
}

.email-row input[type="text"],
.email-row select {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#custom_domain {
  margin-top: 8px;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#email-error {
  color: red;
  font-size: 0.85em;
  margin-top: 6px;
}


/* 로그인 전용 스타일 */
.login-container {
  max-width: 450px;
  margin: 60px auto;
  padding: 40px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  font-family: 'Pretendard', sans-serif;
  text-align: center;
}

.login-container h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 30px;
  color: #333;
}

.login-form {
  text-align: left;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #2c3e50;
}

.login-form .form-control {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.btn-login {
  width: 100%;
  background-color: #4A90E2;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

.btn-login:hover {
  background-color: #357ABD;
}

.register-link {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

.download-info-box {
  background-color: #f1f8ff;
  color: #00529B;
  padding: 10px 15px;
  border: 1px solid #bde5f8;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 15px;
  text-align: left;
}
.download-btn {
  display: inline-block;
  background-color: #4A90E2;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}
.download-btn:hover {
  background-color: #357ABD;
}


/* 테이블 스타일 */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: white;
  margin-bottom: 40px;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

th {
  background-color: #f5f5f5;
  font-weight: 600;
  color: #444;
}

tbody tr:hover {
  background-color: #f9f9f9;
}

.page-title {
  font-size: 22px;
  font-family: 'Pretendard', sans-serif;
  font-weight: 600;
  color: #222;
  margin-bottom: 20px;
}

/* 툴팁 컨테이너 */
.tooltip-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

/* 툴팁 텍스트 */
.tooltip-text {
  position: fixed;
  bottom: auto;
  top: 0;
  left: 0;
  transform: translate(-50%, -100%);
  visibility: hidden;
  opacity: 0;
  background-color: #333;
  color: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
  max-width: 400px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* 마우스 호버 시 위치를 JS로 계산해서 보여줌 */
.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.download-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.download-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.download-item i {
  font-size: 1.6rem;
}

.download-label {
  font-size: 0.75rem;
  margin-top: 2px;
}

.disabled-icon {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

.user-role {
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  margin-right: 5px;
}

.role-hunjang {
  background-color: #f5d042; /* 금색 */
  color: #000;
}

.role-yusaeng {
  background-color: #6fb9f0; /* 하늘색 */
  color: #fff;
}

/* 반응형 */
@media (max-width: 1024px) {
  .main-nav-container,
  .header-container,
  .top-bar-container,
  .container {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px;
  }

  .subject-links {
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
  }

  .top-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
  }

  .nav ul {
    flex-wrap: wrap;
    gap: 10px;
  }

  .upload-form .form-group {
    flex-direction: column;
    gap: 8px;
  }

  .logo {
    font-size: 2rem;
    text-align: center;
  }

  .logo-sub {
    font-size: 0.75rem;
  }

  .page-title {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .main-nav-container,
  .header-container,
  .top-bar-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .search-form {
    flex-direction: column;
    padding: 12px;
    gap: 10px;
  }

  .search-form select,
  .search-form input[type="text"],
  .search-btn {
    width: 100%;
  }

  .subject-links {
    justify-content: center;
    text-align: center;
  }

  .tab-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .tabs-left {
    flex-direction: column;
    width: 100%;
  }

  .tab-link {
    width: 100%;
    text-align: left;
  }

  .register-container,
  .login-container,
  .upload-form,
  .upload-container {
    padding: 20px;
    margin: 20px 10px;
  }

  .post-table th,
  .post-table td,
  .admin-table th,
  .admin-table td {
    font-size: 13px;
    padding: 8px;
  }

  .post-table td.title-cell {
    max-width: 100px;
  }

  .upload-link {
    width: 100%;
    text-align: center;
  }

  .download-icons {
    flex-direction: column;
    gap: 10px;
  }

  .dropdown-menu {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.8rem;
  }

  .top-links {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }

  .upload-form .form-group {
    flex-direction: column;
    gap: 6px;
  }

  .upload-form input,
  .upload-form select {
    width: 100%;
  }

  .btn-login,
  .btn-submit,
  .upload-btn,
  .search-btn {
    font-size: 14px;
    padding: 10px;
  }

  .download-btn {
    width: 100%;
    text-align: center;
  }

  .tab-link {
    font-size: 14px;
    padding: 6px 12px;
  }

  .post-table td.title-cell {
    max-width: 80px;
  }

  .pagination a, .pagination span {
    font-size: 12px;
    padding: 5px 7px;
  }
}
