/* =============================================================================
   Responsive CSS for Sustainability Analysis Page
   ============================================================================= */

/* Tablet and Mobile Media Queries */
@media screen and (max-width: 1400px) {
    .guide {
        height: auto;
        min-height: 100vh;
        padding-bottom: 50px;
    }

    /* Title adjustment */
    .guide-title {
        position: relative;
        top: 20px;
        left: 20px;
        margin-bottom: 30px;
        font-size: 24px;
        line-height: 32px;
    }

    /* Grid container for sections */
    .guide-sections-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px;
        margin-top: 50px;
    }

    /* Section01 - Spider Chart */
    .guide-section01 {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: 400px;
        margin-bottom: 20px;
    }

    .chart-container {
        width: 220px;
        height: 220px;
    }

    .child37, .child38, .child39 {
        width: 220px;
        height: 220px;
    }

    .child38 {
        width: 140px;
        height: 140px;
    }

    .child39 {
        width: 50px;
        height: 50px;
    }

    /* Section02 - Overall Score */
    .guide-section02 {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: 480px;
        margin-bottom: 20px;
        overflow: hidden;
    }

    /* Ensure section02 content stays within bounds */
    .section02-image {
        width: calc(100% + 60px) !important;
        margin-left: -30px !important;
        margin-right: -30px !important;
        max-width: calc(100% + 60px) !important;
        max-height: 250px !important;
        object-fit: contain;
    }

    /* Adjust section02 content sizes for responsive */
    .section02-title-area {
        margin-bottom: 20px !important;
    }

    .section02-title-text {
        font-size: 18px !important;
        line-height: 24px !important;
    }

    .section02-score {
        font-size: 75px !important;
        line-height: 75px !important;
        margin-top: 10px !important;
    }

    /* Section03 - Category Scores Grid */
    .guide-section03 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 20px;
    }

    .section03-ux,
    .section03-hosting,
    .section03-web-design,
    .section03-bm {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: 200px;
    }

    .section03-ux-score,
    .section03-hosting-score,
    .section03-web-design-score,
    .section03-bm-score {
        font-size: 48px;
    }

    /* Section04 - Guidelines */
    .guide-section04 {
        margin-bottom: 20px;
    }

    .section04-title {
        position: relative;
        top: auto;
        left: auto;
        margin-bottom: 20px;
        font-size: 18px;
    }

    .section04-filter {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-bottom: 15px;
        height: 40px !important;
        flex-wrap: nowrap !important;
    }

    /* Ensure filter items stay in single row */
    .section04-filter-item {
        min-width: 0;
        flex-shrink: 1;
        font-size: 14px !important;
    }

    .section04-filter .filter-text {
        font-size: 14px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .section04-search {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-bottom: 20px;
    }

    .section04-content {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: 400px;
        overflow-x: auto;
        overflow-y: auto;
        padding: 20px;
        box-sizing: border-box;
    }

    .content-header-area {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
        margin-bottom: 15px;
        overflow: visible;
        min-width: 1500px;
        height: 44px;
        white-space: nowrap;
    }

    /* Fix content list positioning */
    .section04-content-list {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        min-width: 1500px;
        overflow: visible;
        height: auto;
    }

}

/* Mobile Media Queries */
@media screen and (max-width: 768px) {
    .guide {
        padding-bottom: 30px;
    }

    .guide-title {
        font-size: 20px;
        line-height: 28px;
        margin-bottom: 20px;
    }

    /* Single column layout for mobile */
    .guide-section01 {
        height: 350px;
    }

    .guide-section02 {
        height: 420px;
    }

    .chart-container {
        width: 180px;
        height: 180px;
    }

    .child37, .child38, .child39 {
        width: 180px;
        height: 180px;
    }

    .child38 {
        width: 120px;
        height: 120px;
    }

    .child39 {
        width: 40px;
        height: 40px;
    }

    /* Section03 - Single column for mobile */
    .guide-section03 {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .section03-ux,
    .section03-hosting,
    .section03-web-design,
    .section03-bm {
        height: 150px;
    }

    .section03-ux-score,
    .section03-hosting-score,
    .section03-web-design-score,
    .section03-bm-score {
        font-size: 36px;
    }

    /* Mobile adjustments for section02 score */
    .section02-score {
        font-size: 60px !important;
        line-height: 60px !important;
        margin-top: 8px !important;
    }

    .section02-title-text {
        font-size: 16px !important;
        line-height: 22px !important;
    }

    .section02-image {
        max-height: 200px !important;
    }

    /* Filter responsive - Keep single row even on mobile */
    .section04-filter {
        flex-direction: row !important;
        height: 40px !important;
        gap: 2px;
        padding: 3px;
        flex-wrap: nowrap !important;
    }

    .section04-filter-item {
        height: 34px;
        margin-bottom: 0;
        min-width: 0;
        flex-shrink: 1;
        padding: 0 4px;
    }

    .section04-filter .filter-text {
        font-size: 12px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Search bar */
    .section04-search {
        width: 100%;
    }

    /* Content area adjustments */
    .section04-content {
        height: 350px;
        overflow-x: auto;
        overflow-y: auto;
        padding: 20px;
        box-sizing: border-box;
    }

    .content-header-area {
        font-size: 14px;
        white-space: nowrap;
        min-width: 1500px;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        height: 44px;
        margin-bottom: 10px;
        width: auto !important;
    }

    /* Content list responsive */
    .section04-content-list {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        min-width: 1500px;
        overflow: visible;
        height: auto;
    }

    .section04-content-item {
        height: auto;
        min-height: 60px;
        position: relative !important;
        padding: 10px;
        width: 100% !important;
        min-width: 780px;
        white-space: nowrap;
    }



}

/* Large Mobile Media Queries */
@media screen and (max-width: 600px) {
    .guide-sections-container {
        padding: 0 15px;
        gap: 15px;
    }

    .guide-title {
        left: 15px;
        font-size: 18px;
    }

    .section04-filter {
        padding: 3px;
        height: 35px !important;
    }

    .section04-filter-item {
        height: 29px;
        padding: 0 2px;
    }

    .section04-filter .filter-text {
        font-size: 11px !important;
    }

    .section04-search {
        height: 35px;
        padding: 0 10px;
    }

    .section04-search-input {
        font-size: 13px;
    }
}

/* Container for sections in responsive mode */
@media screen and (max-width: 1400px) {
    .guide > .guide-section01,
    .guide > .guide-section02,
    .guide > .guide-section03,
    .guide > .guide-section04 {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin: 20px auto;
        max-width: 100%;
    }

    /* Ensure proper spacing between sections */
    .guide-section01 {
        margin-top: 80px;
    }
}

/* Tablet specific adjustments */
@media screen and (min-width: 769px) and (max-width: 1400px) {
    .guide-section03 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .section03-ux,
    .section03-hosting,
    .section03-web-design,
    .section03-bm {
        height: 220px;
    }

    .section04-filter {
        flex-direction: row;
        height: 40px;
    }

    .section04-content {
        height: 450px;
        overflow-x: auto;
        overflow-y: auto;
        padding: 20px;
        box-sizing: border-box;
    }

    .content-header-area {
        min-width: 1500px;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
        height: 44px;
        margin-bottom: 10px;
        white-space: nowrap;
    }

    .section04-content-list {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        min-width: 1500px;
        overflow: visible;
        height: auto;
    }

}

/* Print media query */
@media print {
    .guide {
        background-color: white !important;
        height: auto !important;
    }

    .guide-section01,
    .guide-section02,
    .guide-section03,
    .guide-section04 {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        page-break-inside: avoid;
        margin: 20px 0;
    }

    .section04-content {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}