:root {
  --bg-medical: #eefafd;
  --text-medical: #2c5282;
  --border-medical: #bee3f8;

  --bg-it: #f7fafc;
  --text-it: #2d3748;
  --border-it: #e2e8f0;

  --bg-arts: #fff5f7;
  --text-arts: #702459;
  --border-arts: #fed7e2;

  --bg-edu: #fffaf0;
  --text-edu: #744210;
  --border-edu: #feebc8;

  --bg-biz: #f0fff4;
  --text-biz: #22543d;
  --border-biz: #c6f6d5;

  --bg-safety: #fff5f5;
  --text-safety: #742a2a;
  --border-safety: #fed7d7;

  --bg-science: #fafffa;
  --text-science: #234e52;
  --border-science: #b2f5ea;

  --bg-industry: #f7fafc;
  --text-industry: #2d3748;
  --border-industry: #cbd5e0;
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  margin: 0;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

/* Header & Navigation */
header {
  background-color: #2d3748;
  color: white;
  position: sticky;
  top: 0;
  z-index: 2000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 30px;
}
header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}
header p {
  margin: 5px 0 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.category-nav {
  background-color: #1a202c;
  border-top: 1px solid rgba(255,255,255,0.1);
  position: relative;
  z-index: 1001;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap; 
  gap: 5px;
  position: relative;
  overflow: visible;
}
.nav-link {
  color: #a0aec0;
  text-decoration: none;
  padding: 15px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  position: relative; 
  cursor: pointer;
}
.nav-link::after {
  content: '\f107'; 
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.8rem;
  margin-left: 5px;
  opacity: 0.5;
}

/* Nav Dropdown Styles */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  min-width: 240px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
  border-radius: 0 0 12px 12px;
  padding: 10px 0;
  z-index: 3000;
  border-top: 4px solid #63b3ed;
  max-height: 400px;
  overflow-y: auto;
  animation: dropdownFadeIn 0.25s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.nav-link:hover .nav-dropdown {
  display: block;
}

.nav-dropdown ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-dropdown li {
  padding: 12px 20px;
  color: #2d3748;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

.nav-dropdown li:last-child {
  border-bottom: none;
}

.nav-dropdown li:hover {
  background-color: #ebf8ff;
  color: #2b6cb0;
  padding-left: 28px;
}

.nav-link i {
  font-size: 1rem;
}
.nav-link:hover {
  color: white;
}
.nav-link.active {
  color: #63b3ed;
  border-bottom-color: #63b3ed;
  background: rgba(99, 179, 237, 0.1);
}

.nav-area {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Mega Menu Styles */
.mega-menu-wrapper {
  position: relative;
}

.btn-mega-menu {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-mega-menu:hover {
  background: #63b3ed;
  border-color: #63b3ed;
  color: #1a202c;
}

.mega-menu-content {
  position: absolute;
  top: calc(100% + 10px);
  right: 0; /* Changed from right: -100px to align with the nav-area right */
  background-color: #ffffff;
  width: 850px;
  max-width: calc(100vw - 40px); /* Prevent overflowing screen width */
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  padding: 30px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 3000;
  border: 1px solid #edf2f7;
}

.mega-menu-wrapper:hover .mega-menu-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

.mega-menu-column h3 {
  font-size: 1rem;
  color: #2d3748;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #edf2f7;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mega-menu-column h3 i {
  color: #63b3ed;
}

.mega-menu-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-menu-column li {
  font-size: 0.85rem;
  color: #4a5568;
  padding: 6px 0;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-menu-column li:hover {
  color: #3182ce;
  padding-left: 5px;
  font-weight: 600;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 5px 15px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s;
}
.search-container:focus-within {
  background: rgba(255,255,255,0.2);
  border-color: #63b3ed;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.3);
}
.search-container i {
  color: #a0aec0;
  margin-right: 10px;
}
.search-container input {
  background: transparent;
  border: none;
  color: white;
  padding: 8px 0;
  width: 200px;
  outline: none;
  font-size: 0.9rem;
}
.search-container input::placeholder {
  color: #a0aec0;
}

#backToTop {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: #2d3748;
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
}
#backToTop:hover {
  background-color: #1a202c;
  transform: translateY(-5px);
}

.btn-inquiry {
  background-color: #4a5568;
  color: white;
  padding: 10px 22px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-inquiry:hover {
  background-color: #2d3748;
  border-color: white;
}

/* Trending Section Styles */
.trending-section {
  margin-top: 40px;
  margin-bottom: 60px;
  background: linear-gradient(to right, #f8fafc, #edf2f7);
  padding: 40px 30px;
  border-radius: 24px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.section-subtitle {
  font-size: 1.5rem;
  font-weight: 800;
  color: #2d3748;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.trending-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.trending-card {
  padding: 20px 25px 20px 65px !important; 
  flex-direction: row !important;
  align-items: center;
  gap: 15px;
  background: white;
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: visible;
  height: 80px;
}
.trending-card .card-icon {
  width: 45px !important;
  height: 45px !important;
  font-size: 1.2rem !important;
  margin-bottom: 0 !important;
  flex-shrink: 0;
  border-radius: 12px;
}
.trending-card h2 {
  margin: 0 !important;
  font-size: 1.1rem !important;
  color: #2d3748;
  font-weight: 800 !important;
  white-space: nowrap;
}
.trending-card::before {
  content: attr(data-rank);
  position: absolute;
  left: -15px; 
  top: 50%;
  transform: translateY(-50%);
  background: #718096;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 2;
  border: 3px solid white;
}

/* TOP 3 Ranking Colors */
.trending-card[data-rank="1"]::before { 
  background: linear-gradient(135deg, #ecc94b, #d69e2e); 
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
  left: -20px;
}
.trending-card[data-rank="2"]::before { 
  background: linear-gradient(135deg, #e2e8f0, #a0aec0); 
  width: 42px;
  height: 42px;
  left: -18px;
}
.trending-card[data-rank="3"]::before { 
  background: linear-gradient(135deg, #ed8936, #c05621); 
  width: 42px;
  height: 42px;
  left: -18px;
}

@media (max-width: 900px) {
  .trending-container {
    grid-template-columns: 1fr;
    gap: 15px;
    padding-left: 20px;
  }
}

main {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.category-section {
  margin-bottom: 100px;
  scroll-margin-top: 140px;
}
.category-title {
  padding-bottom: 10px;
  border-bottom: 2px solid #edf2f7;
  margin-bottom: 30px;
  font-size: 1.8rem;
  color: #1a202c;
  font-weight: 700;
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card-icon {
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.category-section:nth-of-type(1) .card-icon { color: var(--text-medical); background: linear-gradient(135deg, #ffffff, var(--bg-medical)); }
.category-section:nth-of-type(2) .card-icon { color: var(--text-it); background: linear-gradient(135deg, #ffffff, var(--bg-it)); }
.category-section:nth-of-type(3) .card-icon { color: var(--text-arts); background: linear-gradient(135deg, #ffffff, var(--bg-arts)); }
.category-section:nth-of-type(4) .card-icon { color: var(--text-edu); background: linear-gradient(135deg, #ffffff, var(--bg-edu)); }
.category-section:nth-of-type(5) .card-icon { color: var(--text-biz); background: linear-gradient(135deg, #ffffff, var(--bg-biz)); }
.category-section:nth-of-type(6) .card-icon { color: var(--text-safety); background: linear-gradient(135deg, #ffffff, var(--bg-safety)); }
.category-section:nth-of-type(7) .card-icon { color: var(--text-science); background: linear-gradient(135deg, #ffffff, var(--bg-science)); }
.category-section:nth-of-type(8) .card-icon { color: var(--text-industry); background: linear-gradient(135deg, #ffffff, var(--bg-industry)); }

.card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.03);
}

.card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 30px rgba(0,0,0,0.1);
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.card::after {
  content: '\f105';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  bottom: 25px;
  right: 25px;
  font-size: 1.2rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.card:hover::after {
  opacity: 0.5;
  transform: translateX(0);
}

.card h2 {
  margin-top: 0;
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: #1a202c;
}
.card p {
  color: #4a5568;
  font-size: 0.95rem;
  margin: 8px 0;
}

/* Modal Styling */
.modal-info-item {
  margin-bottom: 25px;
}
.modal-info-item h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  color: #2d3748;
  margin-bottom: 10px;
}
.modal-info-item p {
  line-height: 1.8;
  color: #4a5568;
  margin: 0;
}
.certs-box {
  background: #f0fff4;
  padding: 20px;
  border-radius: 12px;
  border-left: 5px solid #48bb78;
}
.dept-box {
  background: #ebf8ff;
  padding: 20px;
  border-radius: 12px;
  border-left: 5px solid #4299e1;
  margin-bottom: 25px;
}

/* Modal Basic Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background-color: white;
  padding: 40px;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: modalFadeIn 0.3s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.close-modal {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 30px;
  font-weight: bold;
  color: #a0aec0;
  cursor: pointer;
  transition: color 0.2s;
}
.close-modal:hover {
  color: #4a5568;
}
#modal-title {
  margin-top: 0;
  font-size: 2rem;
  color: #1a202c;
  border-bottom: 3px solid #edf2f7;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

/* About Section */
.about-section {
  background-color: white;
  padding: 40px 30px;
  border-radius: 20px;
  margin-bottom: 40px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  border: 1px solid #edf2f7;
}
.about-container h2 {
  font-size: 1.4rem;
  color: #2d3748;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.about-container p {
  color: #4a5568;
  font-size: 1rem;
  line-height: 1.8;
  margin: 0;
}

/* Inquiry Section Styling */
.inquiry-section {
  padding: 80px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
}
.inquiry-container {
  max-width: 800px;
  margin: 0 auto;
}
.inquiry-header {
  text-align: center;
  margin-bottom: 40px;
}
.inquiry-header h2 {
  font-size: 2rem;
  color: #1a202c;
  margin-bottom: 10px;
}
.inquiry-header p {
  color: #718096;
  font-size: 1.1rem;
}
.inquiry-card {
  background: white;
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}
.modern-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.modern-form .form-group {
  margin-bottom: 20px;
}
.modern-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: #4a5568;
  font-size: 0.9rem;
}
.modern-form input, .modern-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #edf2f7;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s;
  box-sizing: border-box;
}
.modern-form input:focus, .modern-form textarea:focus {
  border-color: #63b3ed;
  outline: none;
  background-color: #f0f9ff;
}
.btn-submit {
  width: 100%;
  padding: 16px;
  background-color: #2d3748;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-submit:hover {
  background-color: #1a202c;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Footer Links & Ad Placeholders */
.footer-links {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 15px;
  font-size: 0.85rem;
}
.footer-links a {
  color: #a0aec0;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: white;
}
.footer-links .divider {
  color: #4a5568;
}

.ad-placeholder-top {
  width: 100%;
  height: 90px;
  background: #f1f5f9;
  margin-bottom: 30px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cbd5e0;
}
.ad-placeholder-top::after { content: '광고 배치 가능 영역 (728x90)'; color: #94a3b8; font-size: 0.8rem; }

/* Partners Section Styling */
.partners-section {
  padding: 60px 20px;
  background-color: #f8fafc;
  border-top: 1px solid #edf2f7;
}
.partners-container {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}
.partners-title {
  font-size: 1.1rem;
  color: #718096;
  margin-bottom: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.partners-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
}
.partner-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #4a5568;
  transition: all 0.3s ease;
  width: 160px;
}
.partner-item i {
  font-size: 2rem;
  color: #cbd5e0;
  transition: all 0.3s ease;
}
.partner-item span {
  font-size: 0.9rem;
  font-weight: 600;
}
.partner-item:hover {
  color: #2b6cb0;
  transform: translateY(-5px);
}
.partner-item:hover i {
  color: #2b6cb0;
}

footer {
  text-align: center;
  padding: 40px;
  background: #2d3748;
  color: white;
  margin-top: 0; /* Adjusted to sit right under partners */
}

@media (max-width: 900px) {
  .search-container input {
    width: 150px;
  }
}

@media (max-width: 600px) {
  .header-content {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }
  .nav-area {
    margin-top: 15px;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .search-container {
    width: 100%;
  }
  .search-container input {
    width: 100%;
  }
  .btn-inquiry {
    width: 100%;
    text-align: center;
  }
  .modal-content {
    padding: 20px;
    border-radius: 0;
    height: 100%;
    max-height: 100%;
  }
  .partners-list {
    gap: 20px;
  }
  .partner-item {
    width: calc(50% - 10px);
  }
  .modern-form .form-row {
    grid-template-columns: 1fr;
  }
}
