/* 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif, 'Malgun Gothic', '맑은 고딕', Dotum, '돋움', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.2em;
}

h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.6em;
}

h3 {
    color: #2c3e50;
    margin: 20px 0 10px;
    font-size: 1.3em;
}

/* 필터 섹션 스타일 */
.filter-section {
    margin-bottom: 25px;
    background: #f1f8ff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #d0e3ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input {
    width: 100%;
    max-width: 600px;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    display: block;
    margin: 0 auto 15px;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.category-btn {
    padding: 15px 30px;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #1976d2;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
    min-width: 100px;
}

.category-btn:hover {
    background: #bbdefb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-btn.active {
    background: #1976d2;
    color: white;
    border-color: #1565c0;
    box-shadow: 0 2px 5px rgba(25, 118, 210, 0.4);
}

/* 카테고리 제목 스타일 */
.category-title {
    text-align: center;
    margin: 15px 0 10px;
    color: #0d47a1;
    font-size: 1.1em;
    font-weight: 600;
}

/* 학과 목록 컨테이너 */
.majors-container {
    display: flex;
    gap: 25px;
    margin-top: 20px;
}

/* 학과 리스트 스타일 */
.majors-list {
    flex: 1;
    max-width: 400px;
    max-height: 600px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 15px;
}

.major-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    margin-bottom: 5px;
}

.major-item:hover {
    background-color: #f1f8ff;
}

.major-item.active {
    background-color: #e3f2fd;
    border-left: 4px solid #3498db;
    padding-left: 11px;
}

.major-category {
    font-size: 0.8em;
    color: #666;
    margin-top: 4px;
}

/* 학과 상세 정보 스타일 */
.major-detail {
    flex: 2;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    overflow: hidden;
}

.result-card {
    padding: 25px;
    min-height: 100%;
}

.kdc-section {
    margin-top: 20px;
}

.kdc-list {
    list-style-type: none;
    margin: 10px 0 0 0;
    padding: 0;
}

.kdc-list li {
    display: inline;
    margin-right: 8px;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: 0.9em;
    border-left: none !important;
    box-shadow: none !important;
}

.kdc-code {
    font-weight: 600;
    color: #0b57d0;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    cursor: pointer;
    display: inline;
    line-height: 1.4;
    font-size: 13px;
}

.kdc-code:hover {
    text-decoration: underline;
}

.kdc-code:active {
    transform: none;
    box-shadow: none;
}

.kdc-code:focus-visible {
    outline: none;
    text-decoration: underline;
}

.kdc-code::after {
    content: "";
    display: none;
}

.overview-major-link {
    background: transparent;
    border: none;
    padding: 0;
    color: #0b57d0;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.95em;
}

.overview-major-link:hover {
    text-decoration: none;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* 전문대학 서브메뉴 스타일 */
.junior-college-menu {
  position: relative;
  display: inline-block;
}

.junior-college-menu .subcategories {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.1);
  z-index: 1;
  border-radius: 8px;
}

.junior-college-menu:hover .subcategories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 10px;
}

.subcategory-btn {
  padding: 8px 12px;
  background: #e8f4fc;
  border: 1px solid #bbdefb;
  border-radius: 15px;
  font-size: 14px;
}

/* 반응형 디자인 */
@media (max-width: 900px) {
    .majors-container {
        flex-direction: column;
    }
    
    .majors-list, 
    .major-detail {
        max-width: 100%;
        max-height: none;
    }
    
    .kdc-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .kdc-list {
        grid-template-columns: 1fr;
    }
    
    .major-item {
        padding: 10px 12px;
    }
}

/* 모바일 서브메뉴 토글 방식으로 변경 */
@media (max-width: 768px) {
  .junior-college-menu {
    width: 100%;
  }
  
  .junior-college-menu .subcategories {
    position: static;
    display: none;
    width: 100%;
    box-shadow: none;
    background: transparent;
    padding: 5px 0 0 0;
  }
  
  .junior-college-menu.active .subcategories {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  
  .category-btn {
    padding: 12px 20px;
    min-width: 80px;
    font-size: 14px;
  }
  
  .subcategory-btn {
    padding: 10px;
    font-size: 13px;
  }
}

/* 커리어넷 버튼 스타일 */
.career-net-btn {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
    background-color: #f0f7ff;
    color: #1976d2;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid #bbdefb;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.career-net-btn:hover {
    background-color: #e3f2fd;
    color: #0d47a1;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.desc-section p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* 매우 작은 화면 대응 */
@media (max-width: 360px) {
  .category-btn {
    padding: 10px 15px;
    min-width: 70px;
    font-size: 13px;
  }
  
  .subcategory-btn {
    font-size: 12px;
  }
  
  .kdc-list {
    grid-template-columns: 1fr;
  }
}

/* 요약 섹션 카드 레이아웃 스타일 */
.overview-container {
    margin-top: 20px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.overview-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.overview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.overview-card-header {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.overview-major-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.overview-major-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f5f5f5;
}

.overview-major-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.overview-major-name {
    font-weight: 600;
    color: #0b57d0;
    cursor: pointer;
    font-size: 1.05em;
    background: transparent;
    border: none;
    padding: 0;
    text-align: left;
    width: fit-content;
}

.overview-major-name:hover {
    text-decoration: underline;
}

.kdc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.kdc-chip {
    background-color: #e8f0fe;
    color: #1967d2;
    border: 1px solid #d2e3fc;
    border-radius: 16px;
    padding: 2px 10px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.kdc-chip:hover {
    background-color: #d2e3fc;
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

/* 요약 섹션 테이블 레이아웃 */
.overview-table-wrapper {
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.overview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.overview-table thead {
    background-color: #f8f9fa;
}

.overview-table th,
.overview-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.overview-table th {
    font-weight: 600;
    color: #425602;
}

.overview-table tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

.overview-table .ov-series {
    white-space: nowrap;
    color: #555;
    vertical-align: middle;
}

.overview-table .ov-major {
    width: 28%;
}

.overview-table .ov-kdc {
    line-height: 1.6;
}

/* 계열별 첫 행 구분선 강조 */
.overview-table tr.ov-row-first td {
    border-top: 2px solid #cbd5a4;
}
