/**
 * Common Styles
 */

/* ==========================================================================
   1. Variables (CSS 변수)
   ========================================================================== */
:root {
    /* Colors - Figma Design System */
    --color-primary: #0068B7;
    --color-secondary: #01275C;
    --color-black: #1B1B1B;
    --color-black-900: #363A40;
    --color-black-200: #E2E8F0;
    --color-white: #FFFFFF;
    --color-text: #131319;
    --color-text-light: #717171;
    --color-border: #D6D6D5;
    --color-bg: #FFFFFF;
    
    /* Typography */
    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    
    /* Spacing */
    --container-max-width: 1584px;
    --container-padding: 72px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ==========================================================================
   2. Base (기본 스타일)
   ========================================================================== */
body {
    font-family: var(--font-main);
    font-size: 16px;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
}

/* ==========================================================================
   3. Layout (레이아웃)
   ========================================================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--container-padding);
}

/* ==========================================================================
   4. Buttons (버튼)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #0052a3;
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #222222;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ==========================================================================
   5. Forms (폼)
   ========================================================================== */
/* Form 컴포넌트는 components.css에 정의되어 있습니다 */

/* ==========================================================================
   6. Header (헤더)
   ========================================================================== */

/* --- 6.1 Header Base --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 78px;
    z-index: 1000;
    background: transparent;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.header.hide {
    transform: translateY(-100%);
}

.header.show {
    transform: translateY(0);
    background: #FFFFFF !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header.show .nav-link {
    color: var(--color-black);
}

.header-content {
    max-width: 1920px;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

/* --- 6.2 Header Logo --- */
.header-logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-logo img {
    height: 45px;
    width: auto;
}

/* --- 6.3 Header Navigation --- */
.header-nav {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.nav-link {
    font-family: var(--font-main);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--color-black);
    white-space: nowrap;
    padding: 24px;
    display: block;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    opacity: 0.7;
}

/* --- 6.4 Header Theme --- */
.header[data-theme="white"] .nav-link {
    color: #FFFFFF;
}

/* --- 6.5 Language Selector --- */
.header-lang {
    display: flex;
    gap: 24px;
    align-items: center;
}

.lang-btn {
    font-family: var(--font-main);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--color-black);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.3s ease;
}

.lang-btn.active {
    text-decoration: underline;
}

.lang-btn:hover {
    opacity: 0.7;
}

.header[data-theme="white"] .lang-btn {
    color: #FFFFFF;
}

/* --- 6.6 Submenu --- */
.submenu-bg {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 0;
    background: #FFFFFF;
    overflow: hidden;
    transition: height 0.3s ease;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header:hover .submenu-bg,
.header.menu-open .submenu-bg {
    height: 230px;
    border-top: 1px solid var(--color-black-200);
}

/* Submenu */
.submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    background: transparent;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.header:hover .has-submenu .submenu,
.header.menu-open .has-submenu .submenu {
    opacity: 1;
    visibility: visible;
}

.submenu-link {
    font-family: var(--font-main);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-black-900);
    text-align: center;
    transition: color 0.3s ease;
}

.submenu-link:hover,
.submenu-link.active {
    color: var(--color-primary);
}

/* --- 6.7 Header Hover State --- */
.header:hover,
.header.menu-open {
    background: #FFFFFF !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header:hover .nav-link,
.header.menu-open .nav-link {
    color: var(--color-black);
}

.header:hover .lang-btn,
.header.menu-open .lang-btn {
    color: var(--color-black);
}

/* --- 6.8 Hamburger Button --- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-black);
    transition: all 0.3s ease;
}

.header[data-theme="white"] .hamburger-btn span {
    background: #FFFFFF;
}

.header.show .hamburger-btn span,
.header:hover .hamburger-btn span {
    background: var(--color-black);
}

.hamburger-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   7. Mobile Menu (모바일 메뉴)
   ========================================================================== */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: #FFFFFF;
    z-index: 1002;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu-logo img {
    height: 30px;
    width: auto;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    color: var(--color-black);
}

.mobile-menu-nav {
    padding: 20px 0;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid #F8F8F9;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 24px;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--color-black);
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    text-decoration: none;
}

.mobile-nav-link:hover {
    background: #F8F8F9;
}

.mobile-nav-item.has-submenu .mobile-nav-link svg {
    transition: transform 0.3s ease;
}

.mobile-nav-item.has-submenu.active .mobile-nav-link svg {
    transform: rotate(180deg);
}

.mobile-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #F8F8F9;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav-item.has-submenu.active .mobile-submenu {
    max-height: 500px;
}

.mobile-submenu li {
    border-bottom: 1px solid #FFFFFF;
}

.mobile-submenu-link {
    display: block;
    padding: 12px 24px 12px 48px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text-light);
    transition: color 0.3s ease;
}

.mobile-submenu-link:hover {
    color: var(--color-primary);
}

.mobile-menu-lang {
    display: flex;
    gap: 24px;
    padding: 24px;
    justify-content: center;
    border-top: 1px solid var(--color-border);
}

.mobile-lang-btn {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 500;
    color: var(--color-black);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-lang-btn.active {
    text-decoration: underline;
}

/* ==========================================================================
   8. Footer (푸터)
   ========================================================================== */
.footer {
    background: var(--color-secondary);
    padding: 60px 240px 50px;
}

.footer-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    order: -1;
}

.footer-logos {
    display: flex;
    gap: 36px;
    align-items: center;
}

.footer-logo img {
    height: 45px;
    width: auto;
}

.footer-logo-secondary img {
    height: 43px;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 19px;
    width: 100%;
    order: 1;
    margin-top: -63px;
}

.footer-ce img {
    height: 45px;
    width: auto;
}

.footer-copyright {
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

.footer-right {
    display: flex;
    flex-direction: column;
    gap: 32px;
    order: 0;
}

.footer-nav {
    display: flex;
    gap: 34px;
    justify-content: flex-end;
}

.footer-nav-link {
    font-family: var(--font-main);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
    color: #FFFFFF;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.footer-nav-link:hover {
    opacity: 0.7;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-info-row {
    display: flex;
    gap: 8px;
    font-family: var(--font-main);
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.footer-info-label {
    font-weight: 600;
    color: #FFFFFF;
}

.footer-info-title {
    font-weight: 400;
    min-width: 50px;
}

.footer-info-text {
    font-weight: 500;
}

/* ==========================================================================
   11. Responsive (반응형)
   ========================================================================== */

/* --- 11.1 Large Desktop (1440px) --- */
@media (max-width: 1440px) {
    .header-content {
        padding: 0 60px;
    }
    
    .footer {
        padding: 60px 120px 50px;
    }
}

/* --- 11.2 Tablet (1024px) --- */
@media (max-width: 1024px) {
    .header {
        height: 70px;
    }
    
    .header-content {
        padding: 0 40px;
    }
    
    .header-logo img {
        height: 30px;
    }
    
    .hamburger-btn {
        display: flex;
    }
    
    .header-nav,
    .header-lang {
        display: none;
    }
    
    .submenu-bg,
    .submenu {
        display: none;
    }
    
    .footer {
        padding: 50px 60px 40px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 40px;
    }
    
    .footer-nav {
        justify-content: flex-start;
        gap: 24px;
    }
}

/* --- 11.3 Mobile (768px) --- */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .container-fluid {
        padding: 0 20px;
    }

    .header {
        height: 60px;
    }

    .header-content {
        padding: 0 20px;
    }

    .header-logo img {
        height: 25px;
    }

    .footer {
        padding: 40px 40px 30px;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }

    .footer-left {
        order: 1;
    }

    .footer-right {
        order: 2;
    }

    .footer-bottom {
        order: 3;
        margin-top: 0;
    }

    .footer-logos {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .footer-logo img {
        height: 35px;
    }

    .footer-nav {
        flex-wrap: wrap;
        gap: 16px;
    }

    .footer-nav-link {
        font-size: 16px;
    }

    .footer-info-row {
        flex-direction: column;
        gap: 4px;
        font-size: 13px;
    }
}

/* --- 11.4 Small Mobile (480px) --- */
@media (max-width: 480px) {
    .footer {
        padding: 30px 20px 20px;
    }
    
    .footer-copyright {
        font-size: 11px;
    }
}

/* ==========================================================================
   12. Sub Top (서브페이지 상단)
   ========================================================================== */

/* --- 12.1 Sub Top Base --- */
.sub-top {
    position: relative;
    width: 100%;
    height: 542px;
    margin-top: 78px;
    overflow: hidden;
}

.sub-top-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.sub-top-bg-img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center;
}

.sub-top-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
}

/* --- 12.2 Sub Top Content --- */
.sub-top-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.sub-top-breadcrumb {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    backdrop-filter: blur(5px);
    margin-bottom: 10px;
    display: none;
}

.breadcrumb-text {
    font-family: 'Pretendard', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.sub-top-title {
    font-family: 'Pretendard', sans-serif;
    font-weight: 800;
    font-size: 90px;
    line-height: 1.2;
    color: #FFFFFF;
    text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.1);
    margin: 0;
}

/* --- 12.3 Sub Top Tab --- */
.sub-top-tab {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1920px;
    padding: 0 240px;
    background: rgba(44, 50, 58, 0.3);
    backdrop-filter: blur(80px);
    z-index: 3;
}

.sub-top-tab-inner {
    display: flex;
    width: 100%;
}

.sub-top-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    backdrop-filter: blur(22px);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sub-top-tab-item:hover {
    background: rgba(0, 104, 183, 0.3);
}

.sub-top-tab-item.active {
    background: linear-gradient(90deg, rgba(0, 104, 183, 0.7) 0%, rgba(0, 104, 183, 0.7) 100%);
}

.sub-top-tab-item span {
    font-family: 'Pretendard', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.sub-top-tab-item.active span {
    font-weight: 700;
    color: #FFFFFF;
}

/* --- 12.4 Sub Top Responsive --- */
@media (max-width: 1440px) {
    .sub-top-tab {
        padding: 0 120px;
    }
}

@media (max-width: 1024px) {
    .sub-top {
        height: 400px;
        margin-top: 78px;
    }
    
    .sub-top-title {
        font-size: 60px;
    }
    
    .sub-top-tab {
        padding: 0 60px;
    }
    
    .sub-top-tab-item span {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .sub-top {
        height: 320px;
        margin-top: 60px;
    }
    
    .sub-top-title {
        font-size: 42px;
    }
    
    .breadcrumb-text {
        font-size: 12px;
    }
    
    .sub-top-tab {
        padding: 0 20px;
    }
    
    .sub-top-tab-item {
        padding: 15px 8px;
    }
    
    .sub-top-tab-item span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sub-top {
        height: 280px;
    }
    
    .sub-top-title {
        font-size: 32px;
    }
    
    .sub-top-tab {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sub-top-tab-inner {
        min-width: max-content;
    }
    
    .sub-top-tab-item {
        padding: 12px 16px;
    }
}