/* 1. 기본 설정 및 변수 */
:root {
    --primary-color: #000222;    /* 학회 메인 색상 (네이비) */
    --secondary-color: #280274;  /* 포인트 색상 (퍼플) */
    --text-dark: #222222;
    --text-gray: #7f7f7f;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', 'Roboto', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* 2. 헤더 (header-wrap) 디자인 */
#header-wrapper {
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

/* 메인 페이지 투명 헤더 (기본) */
.header-wrap {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 스크롤 시 또는 서브페이지용 블랙 헤더 */
.header-wrap.scrolled, .sub-page #header-wrapper {
    position: fixed;
    background: var(--primary-color) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
}

/* 로고 영역 */
#header-logo {
    display: flex;
    align-items: center;
}

.logo-text {
    font-size: 26px;
    font-weight: 900;
    color: var(--white);
    letter-spacing: -1px;
}

.logo-white {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

/* 3. 메뉴 (Navigation) */
.top-nav {
    display: flex;
    gap: 40px;
}

.menu-item {
    position: relative;
    padding: 30px 0;
}

.menu-item > a {
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
}

.menu-item:hover > a, .current-menu-item > a {
    color: #71e7c5; /* 포인트 민트 색상 */
}

/* 서브메뉴 가로형으로 변경 */
.menu-item-has-children {
    position: static; /* 부모 제약을 풀어 전체 너비를 활용할 수 있게 함 */
}

.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;      /* 헤더 전체 너비 사용 */
    background: rgba(0, 2, 34, 0.95); /* 배경색 지정 */
    padding: 10px 0;
    text-align: center; /* 메뉴 중앙 정렬 */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

/* 서브메뉴 내부 항목들을 가로로 나열 */
.sub-menu li {
    display: inline-block;
    margin: 0 15px;
}

.sub-menu li a {
    display: inline-block;
    padding: 10px 15px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8) !important;
}

.sub-menu li a:hover {
    color: #71e7c5 !important;
    background: transparent;
}

/* 마우스 호버 시 애니메이션 */
.menu-item-has-children:hover .sub-menu {
    display: block;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 헤더 컨텐츠 정렬 보정 */
.header-content {
    position: relative; /* 서브메뉴의 기준점 */
}

/* 4. 유틸리티 메뉴 */
.util-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-search-btn i { color: var(--white); font-size: 20px; }
.top-member-btn a {
    color: var(--white);
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 15px;
    border-radius: 20px;
}

.top-member-btn a:hover {
    background: var(--white);
    color: var(--primary-color);
}

/* 5. 본문 섹션 디자인 */
.hero-section {
    height: 85vh;
    background: linear-gradient(rgba(0,2,34,0.6), rgba(0,2,34,0.6)), 
                url('https://images.unsplash.com/photo-1507413245164-6160d8298b31?q=80&w=2000') center/cover;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.btn {
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: 600;
    display: inline-block;
}

.btn-primary { background: var(--white); color: var(--primary-color); }
.btn-outline { border: 2px solid var(--white); color: var(--white); margin-left: 10px; }

/* 6. 주요활동 카드 */
.activity-section { padding: 100px 0; }
.section-title { text-align: center; margin-bottom: 60px; }

.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.activity-card {
    padding: 40px;
    background: var(--white);
    border: 1px solid #eee;
    border-radius: 20px;
    transition: var(--transition);
}

.activity-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* 7. 서브페이지 공통 스타일 */
.sub-page .sub-title-wrap {
    padding: 120px 0 60px;
    background: #f4f7fa;
    text-align: center;
}

/* 애니메이션 */
@keyframes fadeInDown {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 8. 반응형 레이아웃 */
@media (max-width: 992px) {
    .top-nav { display: none; } /* 모바일 메뉴는 별도 구현 필요 */
    .hero-content h1 { font-size: 2.5rem; }
}

/* 서브페이지(intro.html) 헤더 배경색 설정 */
.sub-page #header-wrapper {
    background-color: var(--primary-color) !important; /* 네이비색 강제 적용 */
    position: relative; /* 메인과 달리 페이지 상단에 공간을 차지함 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 서브페이지 본문 상단 여백 조절 */
/* 헤더가 relative로 바뀌면서 본문과 겹치지 않게 됩니다 */
.sub-page .sub-title-wrap {
    padding: 60px 0;
    background-color: #f4f7f9;
}

/* 서브메뉴(2단 메뉴)가 서브페이지에서도 잘 보이게 설정 */
.sub-page .sub-menu {
    background: rgba(0, 2, 34, 1); /* 투명도 없이 불투명하게 */
}

/* 학회 소개 전용 폰트 강조 */
.text-primary {
    color: #71e7c5 !important; /* 포인트 민트색 */
    font-weight: 700;
    letter-spacing: 1px;
}

.intro-section p {
    word-break: keep-all; /* 한글 줄바꿈을 단어 단위로 예쁘게 */
}

.vision-card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.info-table .row {
    transition: background 0.3s;
}

.info-table .row:hover {
    background-color: #fcfcfc;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .info-table .row {
        flex-direction: column;
        gap: 5px;
    }
    .info-table div {
        width: 100% !important;
    }
}

/* 가입 안내 페이지 전용 스타일 */
.mt-80 { margin-top: 80px; }

.section-title-small { margin-bottom: 30px; }
.section-title-small h3 { 
    font-size: 1.5rem; 
    color: var(--primary-color); 
    font-weight: 700;
    margin-bottom: 10px;
}

/* 안내 카드 보정 */
.info-card { text-align: center; min-height: 250px; }
.info-card .badge {
    display: inline-block;
    padding: 5px 12px;
    background: #e9ecef;
    border-radius: 5px;
    font-size: 12px;
    margin-top: 15px;
    color: var(--primary-color);
}

/* 학회 전용 테이블 스타일 */
.ks-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 2px solid var(--primary-color);
}
.ks-table th, .ks-table td {
    padding: 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
}
.ks-table th { background: #f8f9fa; font-weight: 600; }

/* 단계별 절차 스타일 */
.step-list { border-left: 2px solid #eee; padding-left: 20px; }
.step-item { position: relative; margin-bottom: 25px; }
.step-num { 
    font-size: 11px; 
    font-weight: 900; 
    color: var(--text-gray); 
    display: block; 
}
.step-item p { font-weight: 500; font-size: 1.1rem; }
.step-item.active p { color: #71e7c5; }

/* 정관 요약 리스트 */
.rule-list { padding: 0; }
.rule-list li { 
    font-size: 14px; 
    color: #666; 
    margin-bottom: 15px; 
    padding-left: 15px; 
    position: relative; 
    line-height: 1.7;
}
.rule-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}