/* ========================================
   COMPONENTS STYLES
   메가 메뉴 & 푸터 컴포넌트 스타일
   ======================================== */

/* ===== Site Header ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 248, 245, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(45, 52, 54, 0.06);
}

.site-header.scrolled {
    background: rgba(250, 248, 245, 0.98);
    box-shadow: 0 2px 20px rgba(45, 52, 54, 0.08);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== Logo ===== */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.logo:hover {
    transform: scale(1.02);
}

.logo__icon {
    font-size: 1.5rem;
}

.logo__text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Menu Toggle Button ===== */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--bg-secondary);
    border: 1px solid rgba(45, 52, 54, 0.08);
    border-radius: 12px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.menu-toggle:hover .menu-toggle__bar {
    background: #fff;
}

.menu-toggle__bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle__bar:nth-child(1) {
    margin-bottom: 5px;
}

.menu-toggle__bar:nth-child(3) {
    margin-top: 5px;
}

/* Menu Toggle Open State */
.menu-toggle.open {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.menu-toggle.open .menu-toggle__bar {
    background: #fff;
}

.menu-toggle.open .menu-toggle__bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open .menu-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.open .menu-toggle__bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Mega Menu Overlay ===== */
.mega-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 54, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    z-index: 998;
    transition: all 0.4s ease;
}

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

/* ===== Mega Menu Panel ===== */
.mega-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 999;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 60px rgba(45, 52, 54, 0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.mega-menu.open {
    right: 0;
}

/* Mega Menu Header */
.mega-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(45, 52, 54, 0.08);
    background: var(--bg-secondary);
}

.mega-menu__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.mega-menu__logo span:first-child {
    font-size: 1.4rem;
}

.mega-menu__close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-card);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.mega-menu__close:hover {
    background: var(--accent-primary);
}

.mega-menu__close span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: background 0.3s ease;
}

.mega-menu__close:hover span {
    background: #fff;
}

.mega-menu__close span:first-child {
    transform: translate(-50%, -50%) rotate(45deg);
}

.mega-menu__close span:last-child {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Mega Menu Content */
.mega-menu__content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

/* Mega Menu Section */
.mega-menu__section {
    border-bottom: 1px solid rgba(45, 52, 54, 0.06);
}

.mega-menu__section:last-child {
    border-bottom: none;
}

/* Mega Menu Trigger */
.mega-menu__trigger {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 18px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.mega-menu__trigger:hover {
    background: var(--bg-secondary);
}

.mega-menu__trigger-icon {
    font-size: 1.4rem;
    margin-right: 14px;
}

.mega-menu__trigger-text {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mega-menu__trigger-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

.mega-menu__trigger.active .mega-menu__trigger-arrow {
    transform: rotate(180deg);
}

/* Single Link (non-dropdown) */
.mega-menu__section--single .mega-menu__single-link {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mega-menu__section--single .mega-menu__single-link:hover {
    background: var(--bg-secondary);
}

.mega-menu__section--single .mega-menu__trigger-icon {
    font-size: 1.4rem;
    margin-right: 14px;
}

.mega-menu__section--single .mega-menu__trigger-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mega Menu Dropdown */
.mega-menu__dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: var(--bg-secondary);
}

.mega-menu__dropdown.open {
    max-height: 1000px;
}

.mega-menu__dropdown-inner {
    padding: 8px 16px 20px;
}

/* Category */
.mega-menu__category {
    margin-bottom: 16px;
}

.mega-menu__category:last-child {
    margin-bottom: 0;
}

.mega-menu__category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: 4px;
}

/* Menu List */
.mega-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Menu Link */
.mega-menu__link {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 12px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mega-menu__link:hover {
    background: var(--bg-card);
    transform: translateX(4px);
}

.mega-menu__link.active {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.15), rgba(255, 230, 109, 0.1));
}

.mega-menu__link-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(45, 52, 54, 0.06);
}

.mega-menu__link-content {
    flex: 1;
    min-width: 0;
}

.mega-menu__link-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.mega-menu__link-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Mega Menu Footer */
.mega-menu__footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(45, 52, 54, 0.08);
    background: var(--bg-secondary);
}

.mega-menu__footer p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
}

/* ===== PC Responsive (wider panel) ===== */
@media (min-width: 769px) {
    .mega-menu {
        max-width: 520px;
    }

    .mega-menu__dropdown-inner {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 16px 20px 24px;
    }

    .mega-menu__category {
        margin-bottom: 0;
    }

    .mega-menu__link {
        padding: 12px;
    }

    .mega-menu__link-icon {
        width: 44px;
        height: 44px;
        font-size: 1.6rem;
    }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .mega-menu {
        max-width: 100%;
    }

    .mega-menu__header {
        padding: 16px 20px;
    }

    .mega-menu__trigger {
        padding: 16px 20px;
    }

    .mega-menu__dropdown-inner {
        padding: 8px 12px 16px;
    }

    .mega-menu__link {
        padding: 12px 10px;
    }

    .mega-menu__link-icon {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }

    .mega-menu__link-title {
        font-size: 0.9rem;
    }

    .mega-menu__link-desc {
        font-size: 0.75rem;
    }
}

/* ===== Site Footer ===== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(45, 52, 54, 0.08);
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 32px;
    text-align: center;
}

.footer__content {
    margin-bottom: 24px;
}

.footer__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer__logo {
    font-size: 1.5rem;
}

.footer__title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer__desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer__links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.footer__links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer__links a:hover {
    color: var(--accent-secondary);
}

.footer__copyright {
    padding-top: 24px;
    border-top: 1px solid rgba(45, 52, 54, 0.08);
}

.footer__copyright p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ===== Page Body Offset (for fixed header) ===== */
body.has-header {
    padding-top: 80px;
}

/* ===== Mobile Footer ===== */
@media (max-width: 480px) {
    .footer__links {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-container {
        padding: 40px 20px 24px;
    }
}

/* ===== Scrollbar for Mega Menu ===== */
.mega-menu__content::-webkit-scrollbar {
    width: 6px;
}

.mega-menu__content::-webkit-scrollbar-track {
    background: transparent;
}

.mega-menu__content::-webkit-scrollbar-thumb {
    background: rgba(45, 52, 54, 0.15);
    border-radius: 3px;
}

.mega-menu__content::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 52, 54, 0.25);
}
