/* ============================================
   천상열차분야지도 공통 스타일
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a237e;
    --primary-light: #3949ab;
    --accent: #ffd700;
    --bg-dark: #0a0a1a;
    --bg-card: #12122a;
    --text-light: #ffffff;
    --text-muted: #a0a0b0;
    --border-color: #2a2a4a;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 별 배경 - 다중 레이어로 자연스러운 밤하늘 효과 */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* 1번 레이어 - 작고 희미한 별들 (가장 많음) */
.stars-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(1px 1px at 50px 30px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 120px 90px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 200px 160px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 280px 40px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 350px 200px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 420px 120px, rgba(255,255,255,0.35), transparent),
        radial-gradient(1px 1px at 80px 280px, rgba(255,255,255,0.45), transparent),
        radial-gradient(1px 1px at 180px 350px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 320px 310px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 450px 380px, rgba(255,255,255,0.35), transparent);
    background-size: 500px 450px;
    animation: drift1 120s linear infinite;
}

/* 2번 레이어 - 중간 크기 별들 */
.stars-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(1.5px 1.5px at 100px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 500px 300px, rgba(255,255,255,0.55), transparent),
        radial-gradient(2px 2px at 200px 400px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 650px 100px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 400px 500px, rgba(255,255,255,0.45), transparent),
        radial-gradient(1.5px 1.5px at 750px 350px, rgba(255,255,255,0.5), transparent);
    background-size: 800px 600px;
    animation: drift2 180s linear infinite reverse;
}

/* 3번 레이어 - 밝은 별들 (동적으로 추가) */
#stars-layer-3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: white;
    animation: twinkleStar var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

.star.golden {
    background: var(--accent);
    box-shadow: 0 0 4px var(--accent);
}

.star.bright {
    box-shadow: 0 0 3px rgba(255,255,255,0.8);
}

@keyframes drift1 {
    from { transform: translate(0, 0); }
    to { transform: translate(-250px, -225px); }
}

@keyframes drift2 {
    from { transform: translate(0, 0); }
    to { transform: translate(-400px, -300px); }
}

@keyframes twinkleStar {
    0%, 100% {
        opacity: var(--base-opacity);
        transform: scale(1);
    }
    50% {
        opacity: var(--peak-opacity);
        transform: scale(1.2);
    }
}

/* 네비게이션 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* 언어 선택 드롭다운 */
.language-selector {
    position: relative;
    margin-left: 1.5rem;
}

.lang-btn {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lang-btn:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.lang-btn .dropdown-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.language-selector.open .dropdown-arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.language-selector.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.lang-option:hover {
    background: rgba(255, 215, 0, 0.1);
}

.lang-option.active {
    background: rgba(255, 215, 0, 0.2);
    color: var(--accent);
}

.lang-flag {
    font-size: 1.1rem;
}

/* 모바일 메뉴 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-light);
    margin: 6px 0;
    transition: all 0.3s ease;
}

/* 히어로 섹션 */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 2rem 60px;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 900px;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent);
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    min-height: 170px;
}

.hero-title .highlight {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.9;
    margin-bottom: 2.5rem;
    min-height: 100px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 버튼 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

/* 스크롤 인디케이터 */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    animation: bounce 2s infinite;
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-8px); }
    60% { transform: translateX(-50%) translateY(-4px); }
}

/* 섹션 공통 */
.section {
    padding: 100px 2rem;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* 페이지 헤더 */
.page-header {
    padding-top: 120px;
    padding-bottom: 60px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* 콘텐츠 그리드 */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.content-image {
    position: relative;
}

.content-image img {
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.content-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.content-text p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.content-text strong {
    color: var(--accent);
}

/* 통계 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* 정보 카드 */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.info-card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.info-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
}

.info-card p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

.info-card ul {
    margin-top: 1rem;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.info-card li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.info-card li strong {
    color: var(--text-light);
}

/* 체험 카드 */
.experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.experience-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    color: inherit;
    height: 380px;
}

.experience-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.experience-card-header {
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    text-align: center;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
}

.experience-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.experience-card-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.experience-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.experience-card-desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
}

.experience-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
}

/* 푸터 */
.footer {
    background: rgba(5, 5, 15, 0.9);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-logo {
    height: 24px;
    margin-bottom: 1rem;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-copyright {
    font-size: 0.8rem;
    color: #555;
}

/* 플로팅 챗봇 버튼 */
.chatbot-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.chatbot-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 25px rgba(26, 35, 126, 0.5);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    cursor: pointer;
}

.chatbot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(26, 35, 126, 0.6);
}

.chatbot-btn svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chatbot-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chatbot-float:hover .chatbot-tooltip {
    opacity: 1;
    visibility: visible;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 5px 25px rgba(26, 35, 126, 0.5);
    }
    50% {
        box-shadow: 0 5px 25px rgba(26, 35, 126, 0.7), 0 0 0 12px rgba(26, 35, 126, 0.1);
    }
}

/* 챗봇 팝업 패널 */
.chatbot-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 420px;
    height: 700px;
    max-height: calc(100vh - 150px);
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-panel.active {
    display: flex;
}

.chatbot-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.chatbot-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
}

.chatbot-panel-title span {
    font-size: 1.2rem;
}

.chatbot-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
}

.chatbot-panel-close:hover {
    color: var(--accent);
}

.chatbot-panel-body {
    flex: 1;
    overflow: hidden;
}

.chatbot-panel-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 챗봇 열림 상태에서 버튼 변경 */
.chatbot-float.open .chatbot-btn {
    animation: none;
}

@media (max-width: 768px) {
    .chatbot-panel {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
    }

    .chatbot-float {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-btn {
        width: 50px;
        height: 50px;
    }

    .chatbot-tooltip {
        display: none;
    }
}

/* 페이지 네비게이션 */
.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.page-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.page-nav-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.page-nav-link.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* 반응형 */
@media (max-width: 992px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .content-image {
        order: -1;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-dark);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1rem;
        display: none;
    }

    .nav-links.active {
        display: flex;
    }

    .hero-title {
        font-size: 2rem;
        min-height: 130px;
    }

    .hero-subtitle {
        font-size: 1rem;
        min-height: 90px;
    }

    .section {
        padding: 60px 1.5rem;
    }

    .section-title,
    .page-title {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .chatbot-float {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-btn {
        width: 50px;
        height: 50px;
    }

    .chatbot-tooltip {
        display: none;
    }

    .page-nav {
        padding: 1.5rem;
    }

    .page-nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}
