/* base.html 스타일 */
body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.header {
    background-color: #1a3c5e;
    color: white;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.header h1 {
    margin: 0;
    font-size: 28px;
}
.content {
    flex-grow: 1;
    padding: 30px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }
    .content {
        padding: 15px;
    }
}


/* 푸터 CSS */
/* 푸터 CSS */
.footer {
    background-color: white;
    color: #333;
    padding: 12px;
    font-size: 16px;
    border-top: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.footer-text {
    text-align: left;
    font-weight: 500;
}
.footer-logos {
    display: flex;
    gap: 10px; /* 로고 간 10px 간격 */
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}
.footer-logo {
    height: 40px;
    width: auto;
}
.footer-logos .divider {
    width: 2px;
    height: 40px; /* 로고 높이와 맞춤 */
    background-color: #999; /* 구분선 색상 */
}

/* 태블릿 (768px~1024px) */
@media (max-width: 1024px) {
    .footer {
        padding: 10px;
        gap: 6px;
    }
    .footer-text {
        font-size: 15px;
    }
    .footer-logo {
        height: 35px;
    }
    .footer-logos .divider {
        height: 35px;
    }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 8px;
        gap: 8px;
    }
    .footer-text {
        text-align: center;
        width: 100%;
        font-size: 14px;
    }
    .footer-logos {
        justify-content: center;
        gap: 8px;
    }
    .footer-logo {
        height: 30px;
    }
    .footer-logos .divider {
        height: 30px;
    }
}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    .footer {
        padding: 6px;
        gap: 5px;
    }
    .footer-text {
        font-size: 13px;
    }
    .footer-logo {
        height: 25px;
    }
    .footer-logos .divider {
        height: 25px;
    }
}
/* 푸터 CSS 완료 */

/* navbar 스타일 */
/* 네비게이션 CSS */
.nav {
    background-color: #2a4d7a;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    gap: 20px;
}
.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px; /* 터치 타겟 */
    transition: color 0.2s;
}
.nav a:hover {
    text-decoration: underline;
    color: #e0e0e0;
}
.nav a.active {
    background-color: #1a73e8; /* 현재 페이지 강조 */
    color: white;
    border-radius: 4px;
}

/* 태블릿 (768px~1024px) */
@media (max-width: 1024px) {
    .nav {
        padding: 12px;
        gap: 15px;
    }
    .nav a {
        padding: 8px 12px;
        font-size: 15px;
    }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        align-items: center;
        padding: 10px;
        gap: 10px;
    }
    .nav a {
        padding: 10px;
        font-size: 14px;
        width: 100%;
        max-width: 300px;
        text-align: center;
        min-height: 44px; /* 터치 타겟 */
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    .nav {
        padding: 8px;
        gap: 8px;
    }
    .nav a {
        font-size: 13px;
        padding: 8px;
        min-height: 40px;
    }
}
/* 네비게이션 CSS 완료 */

/* 필터 바 */
/* 필터 컨테이너 */
.filter-container {
    background-color: #f0f0f0;
    padding: 15px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* 필터 바 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.filter-bar label {
    line-height: 1.4;
    padding: 5px 0;
    margin: 0 5px;
    font-size: 16px;
}
.filter-bar select, .filter-bar button {
    padding: 5px;
    margin: 0 5px;
    margin-top: 0;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 16px;
    line-height: 1.4;
    box-sizing: border-box;
}
.filter-bar select {
    width: 10rem; /* 모든 select 동일 너비 */
}
.filter-bar button {
    background-color: #1a3c5e;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.filter-bar button:hover, .filter-bar button:active {
    background-color: #2a4d7a;
}

/* 토글 버튼 (details.html 전용) */
.toggle-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.toggle-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background-color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}
.toggle-buttons button:hover, .toggle-buttons button:active {
    background-color: #d0d0d0;
}
.toggle-buttons button.active {
    background-color: #1a73e8;
    color: white;
}

/* 태블릿 (1100px~770px) */
@media (max-width: 1100px) {
    .filter-container {
        padding: 12px;
        gap: 6px;
    }
    .filter-bar {
        gap: 6px;
    }
    .filter-bar label {
        font-size: 15px;
        padding: 6px 0;
    }
    .filter-bar select, .filter-bar button {
        padding: 6px;
        margin: 0 4px;
        font-size: 15px;
        min-height: 40px;
        min-width: 100px;
    }
    .filter-bar select {
        width: auto;
        max-width: 180px;
    }
    .toggle-buttons {
        gap: 8px;
    }
    .toggle-buttons button {
        padding: 6px 12px;
        font-size: 13px;
        min-height: 40px;
    }
}

/* 모바일 (770px 이하) */
@media (max-width: 770px) {
    .filter-container {
        flex-direction: column;
        align-items: center;
        padding: 15px;
        gap: 8px;
    }
    .filter-bar {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 8px;
    }
    .filter-bar label {
        font-size: 14px;
        padding: 8px 0;
        width: 100%;
        max-width: 300px;
        text-align: left;
    }
    .filter-bar select, .filter-bar button {
        width: 100%;
        max-width: 300px;
        padding: 8px;
        margin: 0;
        font-size: 14px;
        min-height: 44px;
    }
    .filter-bar select {
        max-width: 100%;
    }
    .toggle-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        gap: 10px;
    }
    .toggle-buttons button {
        width: 100%;
        padding: 8px;
        font-size: 14px;
        min-height: 44px;
    }
}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    .filter-container {
        padding: 10px;
        gap: 6px;
    }
    .filter-bar label {
        font-size: 13px;
        padding: 6px 0;
    }
    .filter-bar select, .filter-bar button {
        padding: 6px;
        font-size: 13px;
        min-height: 44px;
    }
    .toggle-buttons {
        gap: 8px;
    }
    .toggle-buttons button {
        padding: 6px;
        font-size: 13px;
        min-height: 44px;
    }
}
/* 필터바 스타일 완료 */

/* overview.html 스타일 */
.overview-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #000000;
    line-height: 1.4;
}
.overview-content h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 2rem 0 1rem;
    color: #000000;
    line-height: 1.5;
}

/* 태블릿 (768px~1024px) */
@media (max-width: 1024px) {
    .overview-content h1 {
        font-size: 1.9rem;
        margin-bottom: 1.2rem;
        line-height: 1.4;
    }
    .overview-content h2 {
        font-size: 1.4rem;
        margin: 1.5rem 0 0.8rem;
        line-height: 1.5;
    }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    .overview-content h1 {
        font-size: 1.7rem;
        margin-bottom: 1rem;
        line-height: 1.45;
    }
    .overview-content h2 {
        font-size: 1.3rem;
        margin: 1.2rem 0 0.7rem;
        line-height: 1.55;
    }
}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    .overview-content h1 {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
        line-height: 1.5;
    }
    .overview-content h2 {
        font-size: 1.2rem;
        margin: 1rem 0 0.6rem;
        line-height: 1.6;
    }
}



/* overview.html 콘텐츠 섹션 CSS */
.overview-content.content-sections {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20px; /* 섹션 간 간격 */
}
.overview-pyramid, .overview-map {
    flex: 1;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 1rem;
    box-sizing: border-box;
    height: 55vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.overview-pyramid img, .overview-map img {
    width: 100%;
    max-height: 85%; /* 이미지 크기 조정 */
    object-fit: contain;
    border-radius: 8px;
}
.map-label {
    font-size: 1.2rem;
    color: #000;
    line-height: 1.2;
    max-width: 100%;
    white-space: normal;
    text-overflow: clip;
    padding: 0.5rem 0;
}

/* 태블릿 (770px~1024px) */
@media (max-width: 1024px) {
    .overview-content.content-sections {
        gap: 15px;
    }
    .overview-pyramid, .overview-map {
        height: 50vh;
        padding: 0.75rem;
    }
    .overview-pyramid img, .overview-map img {
        max-height: 80%;
    }
    .map-label {
        font-size: 1.1rem;
        padding: 0.4rem 0;
    }
}

/* 모바일 (770px 이하) */
@media (max-width: 770px) {
    .overview-content.content-sections {
        flex-direction: column; /* 수직 배치 */
        gap: 10px;
    }
    .overview-pyramid, .overview-map {
        width: 100%;
        height: 45vh;
        padding: 0.5rem;
    }
    .overview-pyramid img, .overview-map img {
        max-height: 75%;
    }
    .map-label {
        font-size: 1rem;
        padding: 0.3rem 0;
    }
}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    .overview-content.content-sections {
        gap: 8px;
    }
    .overview-pyramid, .overview-map {
        height: 40vh;
    }
    .overview-pyramid img, .overview-map img {
        max-height: 70%;
    }
    .map-label {
        font-size: 0.9rem; /* 가독성 개선 */
        line-height: 1.1;
        padding: 0.2rem 0;
    }
}

/* 모달 스타일 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* 어두운 배경 */
    z-index: 1000;
    overflow: auto;
    justify-content: center;
    align-items: center;
}
.modal-image {
    max-width: 80vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    padding: 10px;
}

/* 태블릿 (768px~1024px) */
@media (max-width: 1024px) {
    .modal-image {
        max-width: 90vw;
        max-height: 85vh;
    }
    .modal-close {
        font-size: 28px;
        padding: 8px;
    }
}

/* 모바일 (770px 이하) */
@media (max-width: 770px) {
    .modal-image {
        max-width: 95vw;
        max-height: 90vh;
    }
    .modal-close {
        font-size: 24px;
        top: 15px;
        right: 15px;
        padding: 6px;
    }
}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    .modal-image {
        max-width: 100vw;
        max-height: 85vh;
    }
    .modal-close {
        font-size: 20px;
        top: 10px;
        right: 10px;
        padding: 5px;
    }
}
/* overview.html 스타일 */


/* details.html 스타일 */
/* details.html 콘텐츠 섹션 CSS */
.details-content.content-sections {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20px; /* 섹션 간 간격 */
}
.left-column {
    display: flex;
    flex-direction: column;
    width: 35%;
    gap: 10px;
}
.right-column {
    width: 60%;
}

/* 태블릿 (770px~1024px) */
@media (max-width: 1024px) {
    .details-content.content-sections {
        gap: 15px;
    }
    .left-column {
        width: 40%;
    }
    .right-column {
        width: 55%;
    }
}

/* 모바일 (770px 이하) */
@media (max-width: 770px) {
    .details-content.content-sections {
        flex-direction: column; /* 수직 배치 */
        gap: 10px;
    }
    .left-column, .right-column {
        width: 100%;
    }
}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    .details-content.content-sections {
        gap: 8px;
    }
    .left-column, .right-column {
        gap: 8px;
    }
}

/* details.html 스타일 */


/* 기존 스타일 */
.pyramid-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 45%;
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid #ccc;
    text-align: center;
}
.pyramid-section.compact {
    width: 100%;
    padding: 15px;
}
.pyramid-section.compact h3 {
    font-size: 24px;
}
.pyramid-section.compact .population-icon {
    font-size: 80px;
    color: #000;
    margin-right: 25px;
}
.pyramid-section.compact #total-population {
    font-size: 24px;
    margin: 0;
}
.pyramid-section.compact #percentage {
    font-size: 18px;
    color: #888;
}
.pyramid-section.compact i {
    font-size: 40px;
    color: #1a73e8;
    margin-right: 15px;
}
.pyramid-section.compact #total-population {
    font-size: 20px;
    margin: 0;
}
.stats-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid #ccc;
    text-align: center;
    flex-wrap: wrap; /* 줄바꿈 허용 */
    gap: 20px; /* 그룹 간 간격 */
}
.map-label, .graph-label {
    margin-top: 10px;
    font-size: 1.2rem;
    color: #666;
}

.graph-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    display: none;
}
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px;
    border-radius: 3px;
    pointer-events: none;
    display: none;
}
.graph-section img, .map img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.pyramid img{
    width: 80%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.new-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border: 1px solid #ccc;
    height: 100%;
    box-sizing: border-box;
    gap: 40px;
}
.stats-section h3 {
    margin-bottom: 20px;
    font-size: 24px;
}
.stats-category {
    margin-bottom: 10px;
    text-align: center;
    width: 45%; /* 기본적으로 2개 그룹이 한 행에 배치 */
    box-sizing: border-box;
    
}
.stats-category:has(.stats-items > .stats-item:nth-child(3)) {
    width: 100%;
}
.stats-category h4 {
    margin-bottom: 10px;
    font-size: 20px;
    color: #333;
    display: inline;
}
.stats-category i {
    font-size: 24px;
    vertical-align: middle;
    margin-left: 10px;
    position: relative;
    top: 5px;
}
.stats-items {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}
.stats-item {
    text-align: center;
    margin: 10px;
    min-width: 100px;
}
.stats-item i {
    font-size: 36px;
    margin-bottom: 8px;
}
.stats-item p {
    margin: 5px 0;
    font-size: 16px;
}
.stats-item .percentage {
    font-weight: bold;
    color: #1a73e8;
    font-size: 18px;
}
.pyramid, .map {
    width: 45%;
    text-align: center;
}
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    white-space: pre-line;
}
.header-row h2 {
    margin: 0;
    font-size: 24px;
}
.toggle-buttons {
    display: flex;
    gap: 10px;
}
.toggle-buttons button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background-color: #1a3c5e;
    color: white;
    cursor: pointer;
    font-size: 14px;
}
.toggle-buttons button:hover {
    background-color: #2a4d7a;
}
.toggle-buttons button.active {
    background-color: #2a4d7a;
    font-weight: bold;
}
.new-section {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border: 1px solid #ccc;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.graph-container {
    text-align: center;
    margin-bottom: 80px;
}
.graph-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.graph-caption {
    margin-bottom: 5px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #000;
}
.section-caption {
    font-size: 16px;
    font-weight: 500;
    color: #666;
    text-align: right;
    margin-bottom: 20px;
}
.content-sections {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 2rem;
}
/* overview-pyramid과 overview-map 스타일 */
.overview-pyramid, .overview-map {
    flex: 1;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 1rem;
    box-sizing: border-box;
    height: 55vh;
    display: flex;
    flex-direction: column;
    align-items: center; /* 중앙 정렬 */
    justify-content: center; /* 수직 중앙 배치 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* 컨텐츠 오버플로우 방지 */
}

/* 이미지 스타일 */
.overview-pyramid img, .overview-map img {
    width: 100%;
    max-height: 90%; /* div 높이의 80%로 제한 */
    object-fit: contain;
    border-radius: 8px;
}

/* map-label 스타일 */
.map-label {
    font-size: 1.2rem; /* 동적 크기 */
    color: #000;
    line-height: 1.2;
    max-width: 100%; /* div 너비 초과 방지 */
    white-space: normal; /* 줄 바꿈 허용 */
    text-overflow: clip; /* 텍스트 오버플로우 시 잘림 */
    padding: 0.5rem 0; /* 상하 여백 */
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .overview-pyramid, .overview-map {
        width: 100%;
        height: 40vh;
        padding: 0.5rem;
    }

    .overview-pyramid img, .overview-map img {
        max-height: 75%; /* 작은 화면에서 이미지 크기 축소 */
    }

    .map-label {
        font-size: 0.9rem; /* 글자 크기 축소 */
        padding: 0.3rem 0;
    }
}

@media (max-width: 480px) {
    .overview-pyramid, .overview-map {
        height: 35vh; /* 매우 작은 화면에서 높이 조정 */
    }

    .overview-pyramid img, .overview-map img {
        max-height: 70%;
    }

    .map-label {
        font-size: 0.7rem;
        line-height: 1.1;
    }
}
.new-section {
    display: flex;
    flex-direction: column; /* tb2와 tb4를 수직 배치 */
    gap: 20px;
}
.tb2-container, .tb4-container {
    display: flex;
    flex-direction: row; /* tb2, tb4 내부에서 PM2.5와 PM10을 수평 배치 */
    gap: 20px;
}
#forest-plot-tb2-pm25, #forest-plot-tb2-pm10,
#forest-plot-tb4-pm25, #forest-plot-tb4-pm10 {
    width: 50%; /* 수평 배치 시 각 그래프가 50% 너비 차지 */
}
#graph-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
}
#forest-plot-tb3-pm25, #forest-plot-tb3-pm10 {
    width: 50%;
}
#stats-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2px; /* stats-section과 동일한 gap 설정 */
    width: 100%; /* 부모 너비를 100%로 설정 */
}