/* 탄천 시설 모달 전용 스타일 */

/* 모달 크기 설정 - PC에서 1108px x 685px */
#tancheonFacilityModal .modal-content {
    width: 1108px;
    height: 685px;
    display: flex;
    flex-direction: column;
}

/* 모달 내부 콘텐츠 */
#tancheonFacilityModal .intro-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 탭 헤더 영역 */
#tancheonFacilityModal .intro-modal-header {
    width: 100%;
    height: 80px;
    background-color: #00a0df;
    flex-shrink: 0;
}

/* 탭 컨테이너 */
#tancheonFacilityModal .intro-tabs-container {
    display: flex;
    align-items: flex-end;
    height: 80px;
    padding-left: 40px;
    gap: 0;
}

/* 탭 버튼 - 가로 95px로 통일 */
#tancheonFacilityModal .intro-tab-button {
    width: 95px;
    height: 40px;
    border: none;
    border-radius: 15px 15px 0 0;
    font-family: 'NanumSquareNeo', sans-serif !important;
    font-weight: 700 !important;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    white-space: nowrap;
}

/* 활성화된 탭 */
#tancheonFacilityModal .intro-tab-button.active {
    background-color: #ffffff;
    color: #00a0df;
    height: 48px;
    z-index: 10;
    clip-path: inset(-10px -10px 0px -10px);
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.15),
                -3px 0 6px rgba(0, 0, 0, 0.08),
                3px 0 6px rgba(0, 0, 0, 0.08);
}

#tancheonFacilityModal .intro-tab-button.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px 15px 0 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: none;
    pointer-events: none;
}

/* 비활성화된 탭 */
#tancheonFacilityModal .intro-tab-button:not(.active) {
    background-color: #33b3e5;
    color: #ffffff;
    clip-path: inset(-10px -10px 0px -10px);
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.15),
                -3px 0 6px rgba(0, 0, 0, 0.08),
                3px 0 6px rgba(0, 0, 0, 0.08);
}

#tancheonFacilityModal .intro-tab-button:not(.active)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px 15px 0 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: none;
    pointer-events: none;
}

#tancheonFacilityModal .intro-tab-button:not(.active):hover {
    background-color: #2ba3d5;
}

/* 탭 콘텐츠 영역 */
#tancheonFacilityModal .intro-tab-content-container {
    flex: 1;
    background-color: #ffffff;
    padding: 40px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    /* 스크롤바 숨기기 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 스크롤바 숨기기 - Chrome, Safari, Opera */
#tancheonFacilityModal .intro-tab-content-container::-webkit-scrollbar {
    display: none;
}

/* 탭 콘텐츠 */
#tancheonFacilityModal .intro-tab-content {
    display: none;
    position: relative;
    overflow: visible;
}

#tancheonFacilityModal .intro-tab-content.active {
    display: block;
}

/* PC 버전 타이틀 스타일 */
#tancheonFacilityModal .content-with-title {
    display: block;
}

/* 타이틀 컨테이너 - 여러 개의 타이틀을 감싸는 컨테이너 */
#tancheonFacilityModal .title-container {
    display: flex;
    flex-direction: column;
    gap: 20px; /* 각 제목+본문 세트 간 간격 */
}

/* 타이틀과 선 묶음 */
#tancheonFacilityModal .title-with-line {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* 타이틀 이미지 */
#tancheonFacilityModal .title-image {
    width: 164px;
    height: 28px;
    display: block;
    margin-bottom: 16px; /* 이미지와 선 사이 간격 */
}

/* 그라데이션 가로선 */
#tancheonFacilityModal .gradient-line {
    width: 100%; /* 전체 너비 */
    height: 1px;
    background: linear-gradient(to right, #00A0DF, #00B451);
}

/* 본문 영역 - 1028*440 */
#tancheonFacilityModal .content-body {
    width: 1028px;
    height: 440px;
    display: flex;
    gap: 40px;
    margin-top: 20px; /* 제목 영역과의 간격 */
}

/* 좌측 사진 영역 - 660*440 */
#tancheonFacilityModal .content-left {
    width: 660px;
    height: 440px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* 이미지 슬라이더 컨테이너 */
#tancheonFacilityModal .image-slider {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 슬라이더 이미지 컨테이너 */
#tancheonFacilityModal .slider-image-container {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-in-out;
}

/* 슬라이더 화살표 버튼 */
#tancheonFacilityModal .slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 좌측 화살표 */
#tancheonFacilityModal .slider-arrow-prev {
    left: 0;
    border-radius: 0 4px 4px 0;
}

/* 우측 화살표 */
#tancheonFacilityModal .slider-arrow-next {
    right: 0;
    border-radius: 4px 0 0 4px;
}

/* 슬라이더 호버 시 화살표 표시 */
#tancheonFacilityModal .image-slider:hover .slider-arrow {
    opacity: 1;
}

/* 화살표 호버 효과 */
#tancheonFacilityModal .slider-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* 화살표 클릭 효과 */
#tancheonFacilityModal .slider-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

/* 우측 표 영역 - 328*440 */
#tancheonFacilityModal .content-right {
    width: 328px;
    height: 440px;
    flex-shrink: 0;
    background-color: #ffffff; /* 흰색 배경 */
    overflow-y: auto;
    overflow-x: hidden;
}

/* 우측 영역 이미지 */
#tancheonFacilityModal .content-right img {
    width: 100%;
    height: auto;
    display: block;
}

/* 콘텐츠 래퍼 - 타이틀 제외한 나머지 부분 */
#tancheonFacilityModal .content-wrapper {
    flex: 1;
}

/* 콘텐츠 래퍼 */
#tancheonFacilityModal .intro-content-wrapper {
    width: 100%;
    min-height: 485px; /* 685px - 80px(헤더) - 80px(패딩) - 40px(여백) = 485px */
    height: auto; /* 콘텐츠에 따라 자동 높이 */
}

/* 이미지 스타일 - 타이틀 이미지 제외 */
#tancheonFacilityModal .intro-tab-content img:not(.title-image) {
    display: block;
    width: 100%;
    height: auto;
}

/* PC 이미지만 기본적으로 표시 */
#tancheonFacilityModal .intro-tab-content .pc-image {
    display: block;
}

#tancheonFacilityModal .intro-tab-content .mobile-image {
    display: none;
}

/* 닫기 버튼 위치 조정 - 콘텐츠 안쪽으로 */
#tancheonFacilityModal .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    transition: opacity 0.3s ease;
}

/* 닫기 버튼 이미지 */
#tancheonFacilityModal .modal-close::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    background-image: url('../../../assets/images/btn_close.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#tancheonFacilityModal .modal-close:hover {
    opacity: 0.8;
    transform: none;
    background-color: transparent;
}

/* 서남 모달의 탭 버튼도 95px로 통일 */
#seonamFacilityModal .intro-tab-button {
    width: 95px !important;
    font-size: 14px !important;
}

/* 모바일 반응형 */
@media screen and (max-width: 768px) {
    /* 모바일에서 타이틀과 선은 그대로 표시 */
    #tancheonFacilityModal .title-with-line,
    #tancheonFacilityModal .title-container {
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* 타이틀 컨테이너 간격 조정 */
    #tancheonFacilityModal .title-container {
        gap: 30px !important; /* 모바일에서 섹션 간 간격 증가 */
    }
    
    /* 본문 영역 세로 배치 */
    #tancheonFacilityModal .content-body {
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        gap: 20px !important;
    }
    
    /* 좌측 슬라이더 영역 */
    #tancheonFacilityModal .content-left {
        width: 100% !important;
        height: 300px !important; /* 모바일 높이 조정 */
    }
    
    /* 우측 데이터 영역 */
    #tancheonFacilityModal .content-right {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
    
    /* 모바일에서 슬라이더 화살표 크기 조정 */
    #tancheonFacilityModal .slider-arrow {
        width: 35px !important;
        height: 50px !important;
        font-size: 20px !important;
        opacity: 0.7 !important; /* 항상 표시 */
    }
    
    /* 모바일에서 content-with-title 레이아웃 조정 */
    #tancheonFacilityModal .content-with-title {
        display: block !important;
    }
    
    /* 모달 컨테이너 - base-modal의 max-width 오버라이드 */
    #tancheonFacilityModal .modal-container {
        max-width: 100% !important;
        max-height: 100% !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* modal-content 패딩 제거 및 배경 이미지 제거 - 인트로 모달과 동일하게 */
    #tancheonFacilityModal .modal-content {
        width: 100vw !important;
        height: 100vh !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        padding: 0 !important; /* 패딩 강제 제거 */
        background-image: none !important; /* 배경 이미지 제거 */
        background: #ffffff !important; /* 흰색 배경만 */
        max-width: 100vw !important;
        max-height: 100vh !important;
    }
    
    /* base-modal의 모바일 스타일 오버라이드 */
    #tancheonFacilityModal.base-modal {
        padding: 0 !important;
    }
    
    /* base-modal의 반응형 스타일 오버라이드 */
    #tancheonFacilityModal.base-modal .modal-container {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    /* 모달 body 스타일 오버라이드 */
    #tancheonFacilityModal .modal-body {
        padding: 0;
        overflow: visible;
        max-height: none;
    }
    
    /* 모달 내부 콘텐츠 */
    #tancheonFacilityModal .intro-modal-content {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden; /* 전체 컨테이너는 스크롤 방지 */
    }
    
    /* 탭 헤더 */
    #tancheonFacilityModal .intro-modal-header {
        width: 100%;
        height: 108px;
        background-color: #00a0df;
        position: relative;
        flex-shrink: 0; /* 크기 고정 */
        z-index: 10;
        overflow-x: auto; /* 가로 스크롤 허용 */
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
        /* 스크롤바 숨기기 */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    /* 스크롤바 숨기기 - Chrome, Safari, Opera */
    #tancheonFacilityModal .intro-modal-header::-webkit-scrollbar {
        display: none;
    }
    
    /* 탭 컨테이너 - 가로 스크롤 가능하도록 수정 */
    #tancheonFacilityModal .intro-tabs-container {
        padding-left: 15px;
        padding-right: 15px;
        height: 108px;
        gap: 5px;
        overflow-x: visible;
        flex-wrap: nowrap;
        align-items: flex-end;
        display: inline-flex; /* 컨텐츠 크기만큼 늘어나도록 */
        min-width: 100%;
        width: auto;
    }
    
    /* 탭 버튼 - 화면 크기에 따라 유연하게 대응 */
    #tancheonFacilityModal .intro-tab-button {
        /* 최소 너비 설정하고 가능한 경우 늘어나도록 */
        min-width: 60px;
        width: auto;
        flex: 1 1 auto; /* 유연하게 늘어나고 줄어듦 */
        max-width: 100px; /* 최대 너비 제한 */
        padding: 0 5px;
        height: 40px;
        font-size: 11px;
        white-space: nowrap; /* 텍스트 줄바꿈 방지 */
        word-break: keep-all;
        line-height: 1.2;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        border-radius: 15px 15px 0 0;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    #tancheonFacilityModal .intro-tab-button:active {
        opacity: 0.8;
    }
    
    #tancheonFacilityModal .intro-tab-button.active {
        height: 45px;
    }
    
    /* 탭 콘텐츠 컨테이너 - 모바일에서 스크롤 가능하도록 (인트로 모달과 동일) */
    #tancheonFacilityModal .intro-tab-content-container {
        flex: 1 1 auto !important;
        min-height: 0 !important; /* flexbox에서 스크롤을 위해 필수 */
        height: auto !important;
        max-height: calc(100vh - 108px) !important; /* 헤더 높이 제외 */
        padding: 20px !important;
        overflow-y: scroll !important; /* scroll로 강제 */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important; /* iOS 부드러운 스크롤 */
        position: relative !important;
        background-color: #ffffff !important;
        /* 스크롤바 숨기기 */
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        box-sizing: border-box !important; /* 패딩이 전체 너비에 포함되도록 */
    }
    
    #tancheonFacilityModal .intro-tab-content-container::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* 탭 콘텐츠 내부 */
    #tancheonFacilityModal .intro-tab-content {
        display: none;
        position: relative;
        overflow: visible !important;
        width: 100% !important;
    }
    
    #tancheonFacilityModal .intro-tab-content.active {
        display: block !important;
    }
    
    /* 콘텐츠 래퍼 - 인트로 모달과 동일하게 */
    #tancheonFacilityModal .intro-content-wrapper {
        width: 100% !important;
        min-height: auto !important; /* 최소 높이 제한 없음 */
        height: auto !important; /* 콘텐츠에 따라 자동 높이 */
    }
    
    /* 이미지 전환 */
    #tancheonFacilityModal .intro-tab-content .pc-image {
        display: none !important;
    }
    
    #tancheonFacilityModal .intro-tab-content .mobile-image {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
    }
    
    /* 닫기 버튼 */
    #tancheonFacilityModal .modal-close {
        display: flex;
        position: absolute;
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 100;
        padding: 0;
        font-size: 0; /* 텍스트 숨기기 */
    }
    
    /* 모바일에서도 이미지 사용 */
    #tancheonFacilityModal .modal-close::after {
        content: '';
        display: block !important;
        width: 40px;
        height: 40px;
        background-image: url('../../../assets/images/btn_close.png') !important;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
    
    /* 기존 X 텍스트 제거 */
    #tancheonFacilityModal .modal-close::before {
        display: none !important;
    }
    
    #tancheonFacilityModal .modal-close:hover {
        opacity: 0.8;
        background-color: transparent;
    }
    
    #tancheonFacilityModal .modal-close:active {
        opacity: 0.7;
    }
}

/* 모바일에서 강제로 100vw 적용 - 추가 우선순위 */
@media screen and (max-width: 768px) {
    /* 최상위 모달 오버레이 */
    #tancheonFacilityModal.modal-overlay {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        padding: 0 !important; /* mobile.css의 padding 오버라이드 */
    }
    
    /* modal-container 강제 재정의 */
    #tancheonFacilityModal.modal-overlay .modal-container {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* modal-content 강제 재정의 - mobile.css 오버라이드 */
    #tancheonFacilityModal.modal-overlay .modal-container .modal-content {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        aspect-ratio: unset !important; /* mobile.css의 aspect-ratio 제거 */
        background-image: none !important; /* mobile.css의 배경 이미지 제거 */
        background: #ffffff !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important; /* center에서 stretch로 변경 */
        justify-content: flex-start !important;
        box-sizing: border-box !important;
    }
    
    /* 슬라이드 관련 요소들 숨기기 (탄천 모달에는 불필요) */
    #tancheonFacilityModal .slide-image-container,
    #tancheonFacilityModal .slide-btn,
    #tancheonFacilityModal .slide-indicators {
        display: none !important;
    }
    
    /* 탭 콘텐츠 컨테이너 패딩 강제 적용 - 최우선 */
    #tancheonFacilityModal.modal-overlay .modal-container .modal-content .intro-modal-content .intro-tab-content-container {
        padding: 20px !important;
        box-sizing: border-box !important;
    }
}

/* 초소형 화면 대응 (280px 이하) */
@media screen and (max-width: 280px) {
    /* 탭 버튼 더 작게 */
    #tancheonFacilityModal .intro-tab-button {
        min-width: 45px !important;
        font-size: 10px !important;
        padding: 0 3px !important;
        height: 36px !important;
    }
    
    #tancheonFacilityModal .intro-tab-button.active {
        height: 40px !important;
    }
    
    /* 탭 컨테이너 패딩 조정 */
    #tancheonFacilityModal .intro-tabs-container {
        padding-left: 10px !important;
        padding-right: 10px !important;
        gap: 3px !important;
    }
    
    /* 콘텐츠 패딩 축소 */
    #tancheonFacilityModal .intro-tab-content-container {
        padding: 15px !important;
    }
}
