/* ===========================================
   기본 설정 및 공통 스타일
   =========================================== */

* {
    font-family: 'Pretendard', sans-serif !important;
}

html, body {
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* 가로 스크롤 완전 차단 */
    max-width: 100vw; /* 뷰포트 너비 초과 방지 */
    box-sizing: border-box;
}

/* 전체 페이지 구조: nav + mypage-wrapper */
body {
    display: flex;
    flex-direction: column;
    /* overflow-y 제거 - 헤더 고정을 위해 전체 페이지 스크롤 비활성화 */
}

/* 네비게이션 바 고정 */
.header {
    flex-shrink: 0; /* 크기 고정 */
    /* height는 nav.css에서 이미 65px로 정의됨 */
}

/* ===========================================
   마이페이지 전체 레이아웃
   =========================================== */

.mypage-wrapper {
    flex: 1; /* 남은 공간 모두 차지 */
    height: calc(100vh - 70px); /* 고정 높이 설정 - 헤더 제외한 전체 높이 */
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    overflow-y: auto; /* 이 영역에서만 스크롤 발생 */
    overflow-x: hidden; /* 가로 스크롤 방지 */
    max-width: 100vw; /* 뷰포트 너비 초과 방지 */
    box-sizing: border-box;
    min-height: 0; /* flex 아이템의 기본 min-height auto 해제 */
}

.mypage-layout {
    display: flex;
    flex: 1; /* 남은 공간을 모두 차지 */
    max-width: 1280px; /* 데스크톱에서 중앙 정렬을 위한 최대 너비 복원 */
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    gap: 10px;
    /* overflow와 height 제거 - 자연스럽게 확장 가능하도록 */
}

/* ===========================================
   마이페이지 사이드바
   =========================================== */

.mypage-sidebar {
    width: 230px;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    flex-shrink: 0;
    /* overflow-y: auto 제거 - 부모에서 스크롤 처리 */
}

/* 사이드바 프로필 영역 */
.sidebar-profile {
    padding: 32px 24px;
    border-bottom: 1px solid #f1f3f4;
    background-color: #fefefe;
}


/* ===========================================
   사이드바 메뉴
   =========================================== */

.sidebar-menu {
    padding: 16px 0;
}

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    margin: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    color: #374151;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-link:hover {
    background-color: #f8fafc;
    color: #f97316;
    text-decoration: none;
    border-left-color: #f97316;
}

.menu-item.active .menu-link {
    background-color: #fff7ed;
    color: #f97316;
    border-left-color: #f97316;
    font-weight: 600;
}

.menu-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    flex-shrink: 0;
}

.menu-text {
    font-size: 15px;
    line-height: 1.4;
}

/* ===========================================
   메인 콘텐츠 영역
   =========================================== */

.mypage-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mypage-content {
    flex: 1;
    padding: 0 20px 40px 20px;
    background-color: #ffffff;
    margin: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    /* min-width: 1000px; - 태블릿 가로 스크롤 문제 해결을 위해 제거 */
    max-width: 100%;
    box-sizing: border-box;
}

/* ===========================================
   마이페이지 푸터
   =========================================== */

.mypage-footer {
    background-color: #f8fafc;
    border-top: 1px solid #e5e7eb;
    padding: 0;
    width: 100%;
    margin-top: auto; /* 자동으로 하단에 배치 */
    flex-shrink: 0;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 푸터 3컬럼 레이아웃 */
.footer-columns {
    display: flex;
    justify-content: space-between;
    gap: 60px;
}

.footer-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 왼쪽 컬럼 - 회사 정보 */
.footer-company {
    flex: 1.2;
}

/* 중앙 컬럼 - 사업자 정보 */
.footer-business {
    flex: 1;
}

/* 오른쪽 컬럼 - 연락처 */
.footer-contact {
    flex: 0.8;
}

/* 회사명 및 푸터 섹션 제목 */
.company-name, .footer-section-title {
    font-size: 16px !important;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

/* 푸터 섹션 타이틀 강제 적용 */
.footer-column .footer-section-title,
.footer-column h4.footer-section-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
    margin: 0 0 8px 0 !important;
}

/* 사업자 정보 라인 */
.business-info-line {
    font-size: 14px;
    color: #64748B;
    line-height: 1.6;
    margin: 0;
}

/* 연락처 정보 라인 */
.contact-info-line {
    font-size: 14px;
    color: #64748B;
    line-height: 1.6;
    margin: 0;
}

/* 회사 정보 라인들 */
.company-info-line {
    font-size: 14px;
    color: #64748B;
    line-height: 1.6;
    margin: 0;
}

.company-info-line .pipe {
    padding: 0 12px;
    color: #d1d5db;
}

/* 사업자 정보 라인 (구분자 여백 추가) */
.company-info-line:last-of-type {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    word-spacing: 2px;
    letter-spacing: 0.2px;
}

/* 하단 정보 (저작권 + 링크) */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.copyright {
    font-size: 14px;
    color: #64748B;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    font-size: 14px;
    color: #64748B;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #f97316;
    text-decoration: none;
}

/* ===========================================
   반응형 디자인
   =========================================== */

@media (max-width: 1024px) {
    .mypage-layout {
        padding: 0;
        gap: 8px; /* 10px에서 8px로 축소 */
        max-width: 100%;
    }

    .mypage-sidebar {
        width: 240px; /* 260px에서 240px로 축소 */
    }

    .mypage-content {
        padding: 16px; /* 24px에서 16px로 축소 - 태블릿 최적화 */
        margin: 0;
        max-width: 100%;
        /* overflow-x: hidden 제거 - 부모에서 스크롤 처리 */
    }
}

@media (max-width: 768px) {
    .mypage-layout {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }

    .mypage-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .sidebar-profile {
        padding: 20px 16px;
    }

    .welcome-title {
        font-size: 18px;
    }

    .welcome-subtitle {
        font-size: 13px;
    }

    .menu-link {
        padding: 12px 16px;
        font-size: 14px;
    }

    .menu-icon {
        width: 18px;
        height: 18px;
    }

    .mypage-content {
        padding: 20px;
        margin: 0;
        border-radius: 0;
    }

    .footer-content {
        padding: 0 16px;
    }

    /* 모바일에서 푸터 컬럼을 세로로 배치 */
    .footer-columns {
        flex-direction: column;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .mypage-layout {
        padding: 0;
        gap: 0;
    }

    .sidebar-profile {
        padding: 16px;
    }

    .welcome-title {
        font-size: 16px;
    }

    .welcome-subtitle {
        font-size: 12px;
    }

    .menu-link {
        padding: 10px 16px;
        font-size: 13px;
        gap: 10px;
    }

    .menu-icon {
        width: 16px;
        height: 16px;
    }

    .mypage-content {
        padding: 16px;
        margin: 0;
    }

    .footer-content {
        padding: 0 16px;
    }

    /* 작은 모바일에서도 푸터 컬럼을 세로로 배치 */
    .footer-columns {
        flex-direction: column;
        gap: 20px;
    }
}

/* ===========================================
   개인정보처리방침 모달 스타일
   =========================================== */

.privacy-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.privacy-modal {
    background: #ffffff;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.privacy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.privacy-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.privacy-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.privacy-modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.privacy-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.privacy-content {
    padding: 24px;
    line-height: 1.6;
}

.privacy-content p {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.privacy-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin: 24px 0 12px 0;
    line-height: 1.4;
}

.privacy-content h3:first-of-type {
    margin-top: 0;
}

.privacy-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 8px 0;
    line-height: 1.4;
}

.privacy-content ol,
.privacy-content ul {
    margin: 12px 0 16px 0;
    padding-left: 20px;
}

.privacy-content li {
    font-size: 14px;
    color: #4b5563;
    margin: 8px 0;
    line-height: 1.6;
}

.privacy-content ol li {
    padding-left: 4px;
}

.privacy-content ul li {
    padding-left: 4px;
}

/* 모달 스크롤바 스타일 */
.privacy-modal-content::-webkit-scrollbar {
    width: 6px;
}

.privacy-modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.privacy-modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.privacy-modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .privacy-modal-overlay {
        padding: 10px;
    }
    
    .privacy-modal {
        max-height: 90vh;
        border-radius: 8px;
    }
    
    .privacy-modal-header {
        padding: 20px 20px 12px 20px;
    }
    
    .privacy-modal-header h2 {
        font-size: 18px;
    }
    
    .privacy-content {
        padding: 20px;
    }
    
    .privacy-content h3 {
        font-size: 15px;
    }
    
    .privacy-content h4 {
        font-size: 14px;
    }
    
    .privacy-content p,
    .privacy-content li {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .privacy-modal-overlay {
        padding: 5px;
    }
    
    .privacy-modal {
        max-height: 95vh;
        border-radius: 6px;
    }
    
    .privacy-modal-header {
        padding: 16px 16px 10px 16px;
    }
    
    .privacy-modal-header h2 {
        font-size: 16px;
    }
    
    .privacy-content {
        padding: 16px;
    }
}

/* ===========================================
   스크롤바 스타일
   =========================================== */

.mypage-sidebar::-webkit-scrollbar {
    width: 6px;
}

.mypage-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.mypage-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.mypage-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.session-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.session-modal {
    background: #ffffff;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    max-width: 320px;
    width: 85%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.session-modal h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px 0;
}

.session-modal p {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.session-modal-confirm {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    .session-modal {
        max-width: 280px;
        padding: 24px;
    }

    .session-modal h2 {
        font-size: 18px;
    }

    .session-modal p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .session-modal-confirm {
        height: 44px;
        font-size: 14px;
    }
}