/* /resource/www/css/status/region.css */

.status-section {
    overflow-x: hidden; /* 하위 고정 너비 요소로 인한 페이지 가로 스크롤 차단 */
    width: 100%;
}

.status-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 120px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    box-sizing: border-box;
}

/* 메인 콘텐츠 레이아웃 (지도 + 차트) */
.region-main-content {
    display: flex;
    gap: clamp(20px, 4vw, 60px);
    align-items: flex-start;
    width: 100%;
    margin-bottom: 60px;
}

/* 지도 영역 레이아웃 */
.map-container {
    flex: 0 1 361px;
    min-width: 180px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.map-area {
    width: 100%;
    aspect-ratio: 361 / 600;
    height: auto;
    background-image: url(/resource/www/images/status/map.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 24px;
    position: relative; /* 버튼 배치를 위한 기준점 */
}

/* 지역명 버튼 스타일 */
.map-btn {
    position: absolute;
    padding: 6px 12px;
    background-color: #FFFFFF;
    border: 1px solid #D4D4D4;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #444444;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-btn:hover {
    background-color: #E8F5F1;
}

.map-btn.active {
    background-color: #00754A;
    color: #FFFFFF;
    border-color: #00754A;
    box-shadow: 0 4px 8px rgba(0,117,74,0.3);
}

/* 버튼 위치 조정 (수동 미세 조정 필요) */
.btn-seoul { 
    top: 18%;
    left: 28%;
}
.btn-gyeonggi { 
    top: 25%;
    left: 39%;
}
.btn-incheon { 
    top: 24%;
    left: 14%;
}
.btn-gangwon { 
    top: 18%;
    left: 62%;
}
.btn-chungbuk { top: 210px; left: 195px; }
.btn-chungnam { 
    top: 42%;
    left: 25%;
}
.btn-gwangju { 
    top: 66%;
    left: 24%;
}
.btn-daegu { 
    top: 52%;
    left: 70%;
}
.btn-ulsan { 
    top: 57%;
    left: 85%;
}
.btn-gyeongnam { 
    top: 65%;
    left: 60%;
}
.btn-busan { 
    top: 66%;
    left: 78%;
}
.btn-jeonbuk { 
    top: 57%;
    left: 36%;
}
.btn-jeonnam { 
    top: 75%;
    left: 27%;
}
.btn-jeju { 
    top: 89%;
    left: 23%;
}

/* 토글 버튼 절대 위치 (지도의 우측 하단) */
.toggle-wrapper {
    position: absolute;
    bottom: 20px;
    right: 15px;
    z-index: 10;
}

/* header.jsp 스타일을 본뜬 토글 스위치 */
.region-toggle-switch {
    position: relative;
    width: 120px;
    height: 42px;
    background-color: #00C795; /* 전체 모드 활성 색상 */
    border-radius: 21px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 3px;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.region-toggle-switch:not(.all-mode) {
    background-color: #333333; /* 개별 모드 비활성 색상 */
}

.region-toggle-thumb {
    position: absolute;
    width: 36px;
    height: 36px;
    background-color: #FFFFFF;
    border-radius: 50%;
    left: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: left 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 2;
}

.region-toggle-switch:not(.all-mode) .region-toggle-thumb {
    left: calc(100% - 39px);
}

.region-toggle-thumb svg {
    width: 24px;
    height: 24px;
    transition: color 0.3s ease;
}

.region-toggle-thumb .arrow-path {
    stroke: #00C795;
    transition: stroke 0.3s ease;
}

.region-toggle-switch:not(.all-mode) .arrow-path {
    stroke: #333333;
}

.region-toggle-text {
    width: 100%;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    pointer-events: none;
    z-index: 1;
    position: absolute;
    transition: opacity 0.3s ease;
}

.text-individual { right: -15px; opacity: 1; }
.text-all { left: -15px; opacity: 0; }

.region-toggle-switch:not(.all-mode) .text-individual { opacity: 0; }
.region-toggle-switch:not(.all-mode) .text-all { opacity: 1; }

.status-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tabs {
    display: flex;
    background-color: #EDEDED;
    border-radius: 999px;
    padding: 8px;
    gap: 8px;
}

.tab-item {
    padding: 10px 12px;
    min-width: 100px;
    border-radius: 999px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 500;
    font-size: 16px;
    text-align: center;
    color: #222222;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.tab-item.active {
    background-color: #00754A;
    color: #FCFCFC;
}

.tab-item.sub {
    background-color: #27C289;
    color: #FCFCFC;
}

/* 차트 섹션 */
.chart-section {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.chart-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.chart-image-wrapper {
    width: 100%;
    height: 600px;
    position: relative;
}

.chart-image-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-scroll-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
}
.chart-scroll-wrap.dragging {
    cursor: grabbing;
    user-select: none;
}

.chart-scroll-wrap::-webkit-scrollbar {
    display: none;
}

/* 원형 차트 중앙 정보 overlay */
.chart-center-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; /* 크기 확대 */
    height: 200px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.chart-center-info .region-name {
    font-size: 32px; /* 숫자 강조 */
    font-weight: 700;
    color: #333333;
    padding: 4px 16px;
    background-color: #F8F9FA;
    border-radius: 20px;
}

.chart-center-info .count-wrapper {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #888888;
    font-weight: 500;
}

/* 범례 */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-item .color-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-item .label {
    font-size: 15px;
    color: #444444;
}

/* 테이블 섹션 */
.table-section {
    width: 100%;
    margin-top: 40px;
}

.table-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    /* gap: 8px; 제거 */
}

.table-row {
    display: flex;
    align-items: center;
    gap: 48px;
    padding: 16px;
    width: 100%;
}

.table-row.table-header-row {
    background-color: #EDEDED;
    border-radius: 8px;
    font-family: 'Pretendard', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: #222222;
}

.table-row:not(.header) {
    border-bottom: 1px solid #D4D4D4;
    font-family: 'Pretendard', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #222222;
}

.table-row .cell {
    text-align: center;
    flex: 1;
}

.table-row .cell.date {
    flex: 0 0 230px;
}

.pagination-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.pagination-arrow, .pagination-number {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination-arrow:hover, .pagination-number:hover {
    background-color: #EDEDED;
}

.pagination-number.active {
    font-weight: 700;
    color: #00754A;
}

/* 중간 해상도: 버튼/토글 크기 축소 */
@media screen and (min-width: 769px) and (max-width: 960px) {
    .map-btn {
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 8px;
    }

    .toggle-wrapper {
        bottom: 12px;
        right: 8px;
    }

    .region-toggle-switch {
        width: 96px;
        height: 34px;
        border-radius: 17px;
    }

    .region-toggle-thumb {
        width: 28px;
        height: 28px;
    }

    .region-toggle-switch:not(.all-mode) .region-toggle-thumb {
        left: calc(100% - 31px);
    }

    .region-toggle-text {
        font-size: 11px;
    }
}

@media screen and (max-width: 1024px) {
    .status-container {
        padding: 40px 16px;
        gap: 40px;
        box-sizing: border-box;
    }

    .region-main-content {
        flex-direction: column;
        gap: 32px;
        margin-bottom: 32px;
    }

    .map-container {
        display: none !important; /* 모바일에서 지도 미노출 */
    }

    .chart-section {
        width: 100%;
        overflow: hidden;
    }

    .chart-image-wrapper {
        height: 400px;
    }

    .chart-legend {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
        padding: 0;
        box-sizing: border-box;
    }

    .legend-item {
        gap: 6px;
    }

    .legend-item .color-box {
        width: 18px;
        height: 18px;
        border-radius: 4px;
    }

    .legend-item .label {
        font-size: 12px;
    }

    .table-section {
        padding: 0;
        margin-top: 0;
    }

    .table-list {
        gap: 8px; /* 카드 간격 8px */
    }

    .table-row.table-header-row {
        display: none !important;
    }

    .status-card {
        background-color: #EDEDED;
        border-radius: 12px;
        padding: 24px;
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-bottom: 0px;
    }

    .status-card .card-header {
        font-size: 16px;
        font-weight: 600;
        color: #222222;
        margin-bottom: 16px;
    }

    .status-card .card-body {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .status-card .card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .status-card .card-row .label {
        font-size: 14px;
        color: #555555;
    }

    .status-card .card-row .value {
        font-size: 14px;
        font-weight: 600;
        color: #222222;
    }
}
