:root {
    --bg-header: #6AE5FF;
    --bg-page: #F6F6F6;
    --card-bg: #ffffff;
    --text-main: #181423;
    --text-muted: #6c7a89;
    --border-color: #F6F6F6;
    --primary: #3081E6;
    --icon-green: #399B54;
    --icon-red: #FD4A33;
    --icon-yellow: #FCBE2D;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Instrument Sans', sans-serif;
}

body {
    font-family: 'Instrument Sans', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 60px;
}

/* Top Navigation Bar */
.top-nav {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    width: 100%;
}

.top-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    background-color: #ffffff;
    color: #181423;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    padding: 12px 13px;
    border-radius: 16px 3px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border:3px solid #181423;
}

.nav-btn:hover {
    background-color: #181423;
    color: #FFF;
}

@media (max-width: 600px) {
    .nav-logo {
        height: 32px;
        max-width: 140px;
    }
    .nav-btn {
        font-size: 12px;
        padding: 6px 14px;
    }
}

/* Header Section */
header {
    background-color: var(--bg-header);
    padding: 100px 20px 120px 20px;
    text-align: center;
    color: #ffffff;
    position: relative;
}

.back-btn {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

h1 {
    font-family: 'Young Serif', serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #181423;
}

.header-desc {
    max-width: 700px;
    margin: 0 auto 35px auto;
    font-size: 1.4rem;
    opacity: 0.9;
    color:#181423;
}

.header-link {
    color: #181423;
    text-decoration: underline;
    font-size: 1.2rem;
    font-weight: 600;
    
}

/* Main Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Map Section */
.map-wrapper {
    margin-top: -30px;
    background: #ffffff;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
}

#map {
    height: 380px;
    width: 100%;
    border-radius: 12px;
    background: #e5f3f9;
}

/* Regional Map Pin */
.regional-pin-container {
    background: transparent;
    border: none;
}

.regional-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.regional-pin .material-symbols-outlined {
    font-size: 34px;
    color: #fabd2d;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
    transition: transform 0.2s ease, filter 0.2s ease;
    user-select: none;
}

.regional-pin:hover .material-symbols-outlined {
    transform: scale(1.2);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

.regional-pin.selected .material-symbols-outlined {
    transform: scale(1.25);
    filter: drop-shadow(0 4px 8px rgba(24, 20, 35, 0.7));
}

.regional-pin.dimmed {
    opacity: 0.35;
}

/* Search and Filters Section */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 45px;
    margin-top: 45px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 13px 20px 13px 45px;
    border-radius: 30px;
    border: 3px solid #181423;
    font-size: 18px;
    outline: none;
    background-color: #fff;
}

input[type="text"]{
   color:#181423;
   font-size:16px;

}

.search-box .material-symbols-outlined {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: center;
}

.filter-dropdown {
    position: relative;
    width: 100%;

}

.filter-summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 30px;
    border: 3px solid #181423;
    background: #ffffff;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    outline: none;
    min-height: 48px;
    box-sizing: border-box;
}

.filter-summary::-webkit-details-marker {
    display: none;
}

.filter-summary span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-summary .dropdown-arrow {
    font-size: 20px;
    color: var(--text-main);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.filter-dropdown[open] .dropdown-arrow {
    transform: rotate(180deg);
}

.filter-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    min-width: 220px;
    max-height: 240px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    padding: 8px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    user-select: none;
    transition: background 0.15s ease;
}

.filter-option:hover {
    background: #f1f7fa;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 20px;
    border-radius: 30px;
    border: 3px solid #D5D4D7;
    background: #ffffff;
    color: #FD4A33;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
    min-height: 48px;
}

.reset-btn:hover {
    background: #FD4A33;
    color: white;
    border-color: #FD4A33;
}

/* Table Styling */
.table-card {
    background: #ffffff;
    border-radius: 12px;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    text-align: left;
    font-size: 16px;
    position: relative;
    
}

th {
    background-color: #6AE5FF;
    color: #181423;
    padding: 22px 16px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    position: sticky !important;
    top: 0 !important;
}

th:hover {
    background-color: #7ce9ff;
}

th .sort-icon {
    font-size: 12px;
    vertical-align: middle;
    margin-left: 4px;
}

td {
    padding: 22px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

tbody tr:hover {
    background-color: #f1f7fa;
}

/* Checkbox customization */
.compare-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Floating Compare Bar */
.compare-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #6AE5FF;
    color: #181423;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 1000;
}

.compare-bar button {
    background: #F6F6F6;
    border: 0;
    color: #181423;
    padding: 6px 16px;
    border-radius: 20px;
    font-size:16px;
    cursor: pointer;
    font-weight:600;
    transition: opacity 0.2s;
}

.compare-bar button:hover {
    opacity: 0.9;
}

.compare-bar .clear-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.compare-bar .clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: modalFadeIn 0.25s ease-out;
}

.modal-compare-card {
    max-width: 1000px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background-color: var(--bg-header);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
    box-sizing: border-box;
    flex-shrink: 0;
}

.modal-title {
    font-family: 'Young Serif', serif;
    font-size: 1.6rem;
    color: var(--text-main);
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.print-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: var(--text-main);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.print-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.print-btn .material-symbols-outlined {
    font-size: 18px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
}

/* Detail Modal 2 Columns Layout */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.field-label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-top: 18px;
}

.field-value {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 4px;
}

.direct-link {
    display: inline-block;
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    font-size: 13px;
    margin-bottom: 15px;
}

/* Parameter Status Row Styling */
.param-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.param-name {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-main);
    max-width: 80%;
}

/* Compare Matrix Table Styling */
.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.compare-table th {
    background: white;
    font-family: 'Young Serif', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    padding: 12px 16px;
    border: none;
    cursor: default;
}

.compare-table th:first-child {
    text-align: left;
}

.compare-table tr {
    background-color: #f8fafc;
    transition: background-color 0.15s;
}

.compare-table tr:nth-child(even) {
    background-color: #ffffff;
}

.compare-table tr:hover {
    background-color: #f1f7fa;
}

.compare-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-main);
    text-align: center;
    border: none;
    vertical-align: middle;
}

.compare-table td.row-label {
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: #181423;
    letter-spacing: 0.5px;
    width: 32%;
}

.compare-table tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.compare-table tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.status-icon {
    font-size: 24px;
    vertical-align: middle;
}

.status-icon.green { color: var(--icon-green); }
.status-icon.red { color: var(--icon-red); }
.status-icon.yellow { color: var(--icon-yellow); }

/* Modal Legend Styling */
.modal-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-main);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-item .status-icon {
    font-size: 20px;
}

@media (max-width: 768px) {

    h1 {
        font-family: 'Young Serif', serif;
        font-size: 2rem;
        font-weight: 700;
        margin-bottom: 15px;
        color: #181423;
    }

/* Header Section */
header {
    padding: 40px 20px 80px 20px;
}
   

    .detail-grid { grid-template-columns: 1fr; }
    .compare-table td.row-label { font-size: 10px; width: 40%; }

    .modal-overlay {
        padding: 30px;
    }

    .modal-card {
        max-height: calc(100vh - 50px);
        border-radius: 14px;
    }

    .modal-header {
        padding: 12px 16px;
        border-top-left-radius: 14px;
        border-top-right-radius: 14px;
    }

    .modal-title {
        font-size: 1.1rem;
        line-height: 1.2;
        padding-right: 10px;
    }

    .close-btn {
        flex: 0 0 28px;
    }

    .modal-body {
        padding: 20px 16px;
    }
}

@media (max-width: 600px) {
    .table-card {
        border-radius: 8px;
    }

    .table-card table {
        min-width: 0;
        table-layout: fixed;
    }

    .table-card th,
    .table-card td {
        padding: 16px 10px;
    }

    .table-card th:first-child,
    .table-card td:first-child {
        width: 64px;
    }

    .table-card th:nth-child(2),
    .table-card td:nth-child(2) {
        width: 70%;
    }

    .table-card th:nth-child(3),
    .table-card td:nth-child(3) {
        width: auto;
        overflow-wrap: anywhere;
    }

    .table-card th:nth-child(n + 3),
    .table-card td:nth-child(n + 3) {
        display: none;
    }

}

@media print {
    body > * {
        display: none !important;
    }

    body.print-detail-modal #detailModal,
    body.print-compare-modal #compareModal {
        display: flex !important;
        position: static;
        width: 100%;
        height: auto;
        padding: 0;
        background: #ffffff;
    }

    body.print-detail-modal #detailModal .modal-card,
    body.print-compare-modal #compareModal .modal-card {
        max-width: none;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    body.print-detail-modal #detailModal .modal-header,
    body.print-compare-modal #compareModal .modal-header {
        position: static;
        border-radius: 0;
    }

    body.print-detail-modal #detailModal .modal-body,
    body.print-compare-modal #compareModal .modal-body {
        overflow: visible;
    }

    body.print-detail-modal #detailModal .modal-actions,
    body.print-compare-modal #compareModal .modal-actions {
        display: none;
    }
}