@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    /* 세련된 슬레이트(Slate) 모노톤 컬러 시스템 */
    --primary: #0f172a;          
    --secondary: #475569;        
    --accent: #3b82f6;           
    
    --bg-main: #f8fafc;          
    --bg-section: #ffffff;       
    --border-color: #e2e8f0;     
    
    --radius-lg: 20px;
    --radius-md: 12px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 15px 30px -5px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   [애니메이션 키프레임 정의]
   ========================================= */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 타이핑 커서 깜빡임 애니메이션 */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* =========================================
   1. Header & Hero (배경 변경 및 사이즈 축소)
   ========================================= */
.hero-section {
    /* 배경 이미지를 bg1.png로 변경하고, 패턴이 잘 보이도록 그라데이션 투명도를 살짝 조절했습니다 */
    background: linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.9)), url('') center/cover no-repeat;
    color: #ffffff;
    /* 하단 패딩을 줄여 전체적인 헤더 높이를 20% 가량 축소했습니다 */
    padding: 0 20px 110px; 
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    /* --- 색상 및 디자인 추가 부분 --- */
    background-color: rgba(68, 72, 90, 0.08); /* 약간 밝은 반투명 배경 */
    padding: 15px 30px;                          /* 안쪽 여백을 주어 버튼처럼 만듦 */
    margin-top: 20px;                            /* 화면 상단에서 살짝 띄움 */
}


.nav-logo {
    font-size: 1.0rem;
    color: #ffffff;
    text-decoration: none;
}

.hero-content {
    max-width: 1000px;
    /* 기존 60px에서 20px로 줄여 컨텐츠를 전체적으로 위로 끌어올렸습니다 */
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px; 
}

/* 마스코트 래퍼 (애니메이션 제거) */
.hero-mascot {
    width: 300px; 
    flex-shrink: 0;
    opacity: 0; 
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hero-mascot img {
    width: 60%;
    height: auto;
    display: block;
    /* 움직이는 float 애니메이션을 제거하여 고정시켰습니다 */
}

/* 텍스트 영역: 우측 정렬 유지 */
.hero-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: center;     
    opacity: 0; 
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.6s forwards;
}

.typing-container {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
    line-height: 1.2;
    display: flex;
    align-items: center;
    min-height: 84px; /* 타이핑 도중 레이아웃이 흔들리지 않도록 최소 높이 지정 */
}

.cursor {
    display: inline-block;
    font-weight: 300;
    color: var(--accent); 
    animation: blink 1s step-end infinite;
    margin-left: 5px;
}

.hero-text p {
    font-size: 1.15rem;
    color: #cbd5e1;
    font-weight: 400;
    word-break: keep-all;
}

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column; 
        align-items: center;
        gap: 30px;
    }
    .hero-text {
        align-items: center;
        text-align: center; 
    }
    .hero-mascot {
        width: 240px;
    }
    .typing-container {
        font-size: 2.2rem;
        min-height: 60px;
    }
}

/* =========================================
   2. Gateway (교사 / 학생 진입로)
   ========================================= */
.gateway-container {
    max-width: 1000px;
    /* 헤더 높이 축소에 맞춰 마진 값을 조정했습니다 */
    margin: -55px auto 80px; 
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    position: relative;
    z-index: 10;
}

.gateway-card {
    background: var(--bg-section);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: left;
    text-decoration: none;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.gateway-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary);
}

.gateway-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}

.gateway-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
}

.gateway-info h2 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.gateway-info p {
    color: var(--secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* =========================================
   3. Core Values
   ========================================= */
.values-section {
    max-width: 1200px;
    margin: 0 auto 100px;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 50px;
    letter-spacing: -0.02em;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.value-card {
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.value-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--primary); 
}

.value-icon svg {
    width: 48px;
    height: 48px;
    stroke-width: 1.2;
}

.value-card h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 12px;
    font-weight: 700;
}

.value-card p {
    color: var(--secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: keep-all;
}

/* =========================================
   4. Programs
   ========================================= */
.programs-section {
    max-width: 1200px;
    margin: 0 auto 100px;
    padding: 0 20px;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--secondary);
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) { .program-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .program-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .program-grid { grid-template-columns: 1fr; } }

.program-card {
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.program-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.program-img-wrapper {
    padding: 24px; 
    background-color: #f1f5f9; 
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.program-img {
    width: 100%;
    height: clamp(150px, 10vh, 200px);
    object-fit:contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.4s ease;
}

.program-card:hover .program-img {
    transform: scale(1.04);
}

.program-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.program-info {
    padding: 20px;
    text-align: center;
}

.program-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.program-desc {
    font-size: 0.85rem;
    color: var(--secondary);
}

/* =========================================
   5. Footer
   ========================================= */
footer {
    background-color: var(--bg-section);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 40px 20px;
}

footer p {
    font-size: 0.9rem;
    color: var(--secondary);
}
/* =========================================
   6. Modal (프로그램 상세 설명 팝업)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-section);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    padding: 40px;
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover { color: var(--primary); }

.modal-img {
    width: 100%;
    height: clamp(10%, 200px, 300px);
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    background: #f1f5f9;
}

.modal-badge {
    display: inline-block;
    background: var(--primary);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 800;
}

.modal-desc {
    color: var(--secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    word-break: keep-all;
}

.modal-btn {
    display: inline-block;
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.modal-btn:hover { background: #2563eb; }


/* =========================================
   5. Footer
   ========================================= */
footer {
    background-color: var(--bg-section);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 40px 20px;
}

.visitor-stats {
    font-size: 0.95rem;
    color: var(--secondary);
    margin-bottom: 12px;
}

.visitor-stats strong {
    color: var(--primary);
    font-weight: 800;
}

footer p {
    font-size: 0.9rem;
    color: var(--secondary);
}
/* =========================================
   7. 상단 네비게이션 메뉴 및 버튼
   ========================================= */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* 모바일 화면에서 줄바꿈 되도록 설정 */
    gap: 15px;
}

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

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #ffffff;
}

.nav-auth {
    display: flex;
    gap: 12px;
}

.auth-btn {
    padding: 6px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.login-btn {
    background-color: transparent;
    border: 1px solid #cbd5e1;
    color: #cbd5e1;
}

.login-btn:hover {
    background-color: #cbd5e1;
    color: #0f172a;
}

.logout-btn {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #e74c3c;
}

.logout-btn:hover {
    background-color: #c0392b;
}

.signup-btn {
    background-color: #3b82f6; /* 눈에 띄는 파란색 */
    color: white;
    border: 1px solid #3b82f6;
}

.signup-btn:hover {
    background-color: #2563eb; /* 마우스 올렸을 때 조금 더 진해짐 */
    color: white;
}

.user-greeting {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    align-self: center;
    margin-right: 10px;
}

/* 모바일 화면 대응 */
@media (max-width: 768px) {
    .nav-links {
        order: 3; /* 모바일에서는 메뉴가 아래로 내려가도록 순서 변경 */
        width: 100%;
        justify-content: center;
        gap: 15px;
    }
}


/* 모바일 화면 대응 수정 */
@media (max-width: 768px) {
    nav {
        padding: 15px;
        border-radius: 12px;
    }
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 15px;
        margin-top: 10px; /* 모바일에서 메뉴가 아래로 내려갈 때 간격 추가 */
    }
}