/* 기본 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --header-height: 70px;
}

@media (max-width: 768px) {
    :root {
        --header-height: 120px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 115px;
    }
}

@media (max-width: 360px) {
    :root {
        --header-height: 110px;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ============ 헤더 스타일 ============ */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    min-height: var(--header-height);
    transform: translateY(0);
}

.header.header-hidden {
    transform: translateY(calc(-1 * var(--header-height)));
    box-shadow: none;
}

.header-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 30px;
    height: 70px;
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    align-items: center;
    gap: 30px;
}

.logo {
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
}

.logo img {
    height: 70px;
    width: auto;
    display: block;
}

/* 검색 영역 - 정중앙 배치 */
.search-container {
    max-width: 600px;
    position: relative;
    justify-self: center;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 42px;
    padding: 0 45px 0 18px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.search-input:focus {
    border-color: #ff6c0f;
    box-shadow: none;
    z-index: auto;
}

.search-button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #000000;
    background-color: #ffffff;
}

.search-button:hover {
    background-color: #7f7f7f;
}

.search-button svg {
    width: 20px;
    height: 20px;
}

/* 헤더 액션 버튼 */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    position: relative;
    height: 100%;
}

.login-btn {
    position: relative;
}

.header-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #656565;
    height: 44px;
    width: 44px;
}

.header-btn:hover {
    background-color: #f5f5f5;
}

.header-btn svg {
    width: 28px;
    height: 28px;
}

.lang-btn {
    padding: 0;
    width: 44px;
    height: 44px;
}

.lang-btn img {
    border-radius: 3px;
    width: 28px;
    height: auto;
}

/* ============ 로고 텍스트 스타일 (특정 페이지만 적용) ============ */
.logo-with-text .logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 8px 0;
}

.logo-with-text .logo-wrapper img {
    height: 42px !important;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo-with-text:hover .logo-wrapper img {
    transform: scale(1.03);
}

.logo-text {
    font-size: 10px;
    font-weight: 700;
    color: #ff6c0f;
    letter-spacing: 0.5px;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
}

.logo-with-text:hover .logo-text {
    color: #ff8c3a;
    letter-spacing: 1px;
}

/* ============ 푸터 스타일 ============ */
.footer {
    background-color: #2b2b2b;
    color: #999;
    padding: 30px;
}

.footer-container {
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.footer-main {
    flex: 1;
}

.footer-logo {
    height: 50px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.footer-logo img {
    height: 80px;
    width: auto;
    opacity: 0.8;
    display: block;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.footer-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #ff6c0f;
}

.footer-info {
    line-height: 1.7;
}

.footer-info p {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.footer-copyright {
    margin-top: 15px;
    font-weight: 600;
    font-size: 11px;
}

.footer-account {
    background-color: #333;
    padding: 20px 25px;
    border-radius: 8px;
    min-width: 250px;
    height: fit-content;
}

.footer-account p {
    font-size: 13px;
    margin-bottom: 5px;
    color: #999;
}

.footer-account .account-title {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 14px;
}

/* ============ 공통 모달 스타일 ============ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    0% {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    100% {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: overlayFadeIn 0.4s ease;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 1100px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes modalSlideUp {
    0% {
        transform: translateY(100px) scale(0.9);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* 모달 헤더 (고정 영역) */
.modal-header {
    position: relative;
    padding: 25px 40px 20px;
    border-bottom: 2px solid #f0f0f0;
    flex-shrink: 0;
    background-color: #ffffff;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 40px;
    color: #656565;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

/* 기본 모달 닫기 버튼 호버 (회전 적용) */
.modal-close:hover {
    background-color: #f5f5f5;
    color: #ff6c0f;
    transform: rotate(90deg) scale(1.1);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* 모달 본문 (스크롤 영역) */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    padding-right: 35px;
    margin-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 #f5f5f5;
}

/* 모달 스크롤바 스타일 */
.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
    margin: 8px 0;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 10px;
    border: 2px solid #f5f5f5;
    transition: background 0.3s ease;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* ============ 반응형 - 헤더 & 푸터 ============ */
@media (max-width: 1024px) {
    .header-container {
        height: 65px;
        grid-template-columns: 180px 1fr 180px;
    }

    .logo img {
        height: 65px;
    }

    .search-input {
        height: 40px;
    }

    .header-btn {
        height: 42px;
        width: 42px;
    }

    .lang-btn {
        width: 42px;
        height: 42px;
    }

    .footer {
        padding: 25px 20px;
    }

    .footer-logo {
        height: 48px;
    }

    .footer-logo img {
        height: 70px;
    }

    .footer-container {
        flex-direction: column;
    }

    .footer-account {
        width: 100%;
        max-width: 300px;
    }

    /* 모달 반응형 */
    .modal-content {
        max-width: 850px;
    }

    .modal-header {
        padding: 22px 35px 18px;
    }

    .modal-title {
        font-size: 22px;
    }

    .modal-body {
        padding: 28px 35px;
        padding-right: 30px;
        margin-right: 8px;
    }

    .modal-body::-webkit-scrollbar {
        width: 8px;
    }

    /* 로고 텍스트 */
    .logo-with-text .logo-wrapper {
        gap: 1px;
        padding: 7px 0;
    }

    .logo-with-text .logo-wrapper img {
        height: 40px !important;
    }

    .logo-text {
        font-size: 9.5px;
        letter-spacing: 0.4px;
    }
}

@media (max-width: 768px) {
    .header {
        position: sticky;
        z-index: 1000;
        min-height: 120px;
    }

    .header-container {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        min-height: auto;
        gap: 0;
    }

    /* 검색바가 보이는 경우 */
    .header-container .logo {
        grid-row: 1;
        grid-column: 1;
    }

    .header-container .header-actions {
        grid-row: 1;
        grid-column: 3;
    }

    .header-container .search-container {
        grid-row: 2;
        grid-column: 1 / -1;
        max-width: 100%;
        margin: 5px 0;
        display: flex;
    }

    .logo img {
        height: 60px;
    }

    .search-input {
        height: 38px;
    }

    .header-btn {
        width: 40px;
        height: 40px;
        padding: 6px;
    }

    .header-btn svg {
        width: 25px;
        height: 25px;
    }

    .lang-btn {
        width: 40px;
        height: 40px;
    }

    .lang-btn img {
        width: 26px;
    }

    .footer {
        padding: 20px;
    }

    .footer-logo {
        height: 42px;
    }

    .footer-logo img {
        height: 60px;
    }

    .footer-links {
        flex-direction: row;
        gap: 15px;
    }

    .footer-link {
        font-size: 12px;
    }

    /* 모달 반응형 */
    .modal {
        padding: 15px;
    }

    .modal-content {
        max-width: 98%;
        border-radius: 16px;
    }

    .modal-header {
        padding: 18px 25px 15px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-close {
        font-size: 36px;
        width: 40px;
        height: 40px;
        top: 18px;
        right: 20px;
    }

    .modal-body {
        padding: 22px 25px;
        padding-right: 22px;
        margin-right: 5px;
    }

    .modal-body::-webkit-scrollbar {
        width: 6px;
    }

    /* 로고 텍스트 */
    .logo-with-text .logo-wrapper {
        gap: 0px;
        padding: 6px 0 3px 0;
    }

    .logo-with-text .logo-wrapper img {
        height: 36px !important;
    }

    .logo-text {
        font-size: 9px;
        letter-spacing: 0.3px;
        margin-top: -1px;
    }
}

@media (max-width: 480px) {
    .header {
        min-height: 115px;
    }

    .logo img {
        height: 60px;
    }

    .search-input {
        height: 36px;
        font-size: 13px;
    }

    .search-button {
        width: 30px;
        height: 30px;
    }

    .search-button svg {
        width: 18px;
        height: 18px;
    }

    .header-actions {
        gap: 6px;
    }

    .header-btn {
        padding: 5px;
        width: 38px;
        height: 38px;
    }

    .header-btn svg {
        width: 25px;
        height: 25px;
    }

    .lang-btn {
        width: 38px;
        height: 38px;
    }

    .lang-btn img {
        width: 24px;
    }

    .footer-info p {
        font-size: 11px;
    }

    .footer-logo {
        height: 38px;
    }

    .footer-logo img {
        height: 50px;
    }

    .footer-links {
        flex-direction: row;
        gap: 12px;
    }

    .footer-link {
        font-size: 11px;
        white-space: nowrap;
    }

    /* 모달 반응형 */
    .modal {
        padding: 10px;
    }

    .modal-content {
        border-radius: 14px;
    }

    .modal-header {
        padding: 16px 20px 14px;
    }

    .modal-title {
        font-size: 17px;
    }

    .modal-close {
        font-size: 32px;
        width: 38px;
        height: 38px;
        top: 16px;
        right: 18px;
    }

    .modal-body {
        padding: 20px 20px;
        padding-right: 18px;
        margin-right: 4px;
    }

    .modal-body::-webkit-scrollbar {
        width: 5px;
    }

    /* 로고 텍스트 */
    .logo-with-text .logo-wrapper {
        gap: 0px;
        padding: 5px 0 2px 0;
    }

    .logo-with-text .logo-wrapper img {
        height: 34px !important;
    }

    .logo-text {
        font-size: 8.5px;
        letter-spacing: 0.3px;
        margin-top: -1px;
    }
}

@media (max-width: 360px) {
    .header {
        min-height: 110px;
    }

    .logo img {
        height: 55px;
    }

    .header-btn {
        width: 36px;
        height: 36px;
    }

    .lang-btn {
        width: 36px;
        height: 36px;
    }

    .modal-header {
        padding: 14px 18px 12px;
    }

    .modal-title {
        font-size: 16px;
    }

    .modal-close {
        font-size: 30px;
        width: 36px;
        height: 36px;
    }

    .modal-body {
        padding: 18px 18px;
        padding-right: 16px;
        margin-right: 3px;
    }

    .modal-body::-webkit-scrollbar {
        width: 4px;
    }

    /* 로고 텍스트 */
    .logo-with-text .logo-wrapper {
        padding: 4px 0 2px 0;
    }

    .logo-with-text .logo-wrapper img {
        height: 32px !important;
    }

    .logo-text {
        font-size: 8px;
        letter-spacing: 0.2px;
        margin-top: -1px;
    }
}



/* 스크롤바 스타일링 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #656565;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff6c0f;
}

/* ============ 메뉴 모달 토글 (JavaScript용) ============ */
/* 메뉴 모달 기본 숨김 */
.menu-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 메뉴 모달 활성화 (.active 클래스) */
.menu-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

/* 메뉴 모달 콘텐츠 애니메이션 */
.menu-modal .modal-content {
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-modal.active .modal-content {
    transform: scale(1);
}

/* ============ 업로드 모달 토글 (JavaScript용) ============ */
/* 업로드 모달 기본 숨김 */
.upload-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 업로드 모달 활성화 (.active 클래스) */
.upload-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

/* 업로드 모달 콘텐츠 애니메이션 */
.upload-modal .modal-content {
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.upload-modal.active .modal-content {
    transform: scale(1);
}

.lang-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lang-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
}

.lang-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.lang-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s ease;
    overflow: hidden;
}

.lang-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.lang-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.lang-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.lang-modal-close:hover {
    color: #ff6c0f;
}

.lang-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* 언어 그리드 */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.lang-item:hover {
    background-color: #f8f8f8;
    border-color: #e0e0e0;
}

.lang-item.selected {
    background-color: #fff5f0;
    border-color: #ff6c0f;
}

.lang-item img {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.lang-item span {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-item:hover span,
.lang-item.selected span {
    color: #ff6c0f;
}

/* Google 번역 상단 바 숨기기 */
.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none !important;
}

.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

.goog-te-banner-frame {
    display: none !important;
}

/* 반응형 - 언어 모달 */
@media (max-width: 768px) {
    .lang-modal-content {
        width: 95%;
        max-width: 500px;
    }

    .lang-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .lang-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .lang-item img {
        width: 24px;
        height: 17px;
    }

    .lang-item span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .lang-modal-header {
        padding: 16px 20px;
    }

    .lang-modal-header h3 {
        font-size: 16px;
    }

    .lang-modal-body {
        padding: 16px 20px;
    }

    .lang-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lang-item {
        padding: 10px;
    }
}