/* === HEADER SECTION === */
.region-header-wrapper {
    margin: 0 auto;
    width: 98%;
    min-height: 120px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
}

.region-header-box {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    border-radius: 8px;
}

.region-header-overlay {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    width: 100%;
    height: 100%;
    display: inline-block;
    border-radius: 8px;
}

.region-header-overlay .region-title {
    margin: 0;
    text-align: left;
    color: white !important;
    font-size: 1.8rem;
    font-weight: 600;
}

.region-header-overlay .breadcrumb {
    margin-left: 4px;
    margin-bottom: 6px;
    text-align: left;
    color: white;
    font-size: 14px;
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 400;
}

.region-header-overlay .breadcrumb a {
    color: white;
    text-decoration: none;
}

.region-header-overlay .breadcrumb a:hover {
    text-decoration: underline;
}

.region-header-overlay .breadcrumb .separator {
    margin: 0 6px;
}

.breadcrumb i {
    font-size: 13px;
}

.breadcrumb i.bi-folder2-open {
    margin-right: 8px;
}

.breadcrumb i.bi-chevron-right {
    margin: 0 6px;
}

/* === REGION DETAILS LAYOUT === */
.region-details-wrapper {
    display: grid;
    grid-template-columns: 2fr 5fr;
    width: 100%;
    margin: 10px auto;
    padding: 0 20px 20px;
    gap: 20px;
}

/* === LEFT PANE - FILTERS === */
.region-settings-wrapper {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid #d3d3d3;
    border-radius: 0;
}

/* === SUB-REGIONS (HUC + PROVINCES) === */
.sub-regions-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    cursor: pointer;
}

.sub-regions h4 {
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: "IBM Plex Sans", sans-serif;
    color: grey;
    text-transform: uppercase;
}

.sub-regions h5 {
    font-weight: 600;
    font-size: 0.9rem;
    font-family: "IBM Plex Sans", sans-serif;
    color: black;
}

.sub-regions .toggle-text {
    font-weight: 300;
    font-size: 0.9rem;
    font-family: "IBM Plex Sans", sans-serif;
    color: black;
    text-transform: uppercase;
}

#huc-list,
#prov-list {
    padding-left: 10px;
    margin-bottom: 15px;
}

#huc-list label,
#prov-list label {
    display: block;
    margin-bottom: 5px;
    cursor: pointer;
}

#huc-list input[type="checkbox"],
#prov-list input[type="checkbox"] {
    accent-color: royalblue;
}

/* === CATEGORIES (Main + Sub) === */
.categories {
    display: flex;
    flex-direction: column;
}

.categories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

.categories h4 {
    font-weight: 600;
    font-size: 0.9rem;
    font-family: "IBM Plex Sans", sans-serif;
    color: grey;
    text-transform: uppercase;
}

.categories .toggle-text {
    font-weight: 300;
    font-size: 0.9rem;
    font-family: "IBM Plex Sans", sans-serif;
    color: black;
    text-transform: uppercase;
}

.category-label {
    display: block;
    margin-bottom: 5px;
    cursor: pointer;
    font-weight: 500;
}

.subcategory-list {
    padding-left: 15px;
    margin-top: 3px;
    margin-bottom: 10px;
}

.subcategory-label {
    display: block;
    margin-bottom: 4px;
    cursor: pointer;
    font-weight: 400;
}

.category-group input[type="checkbox"] {
    accent-color: royalblue;
}

/* === CATEGORY ACTION BUTTONS === */
.category-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.category-actions button {
    padding: 6px 12px;
    border: 1px solid black;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.2s, color 0.2s;
}

.category-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.category-actions button:hover:not(:disabled) {
    background: #333;
    color: #fff;
}

/* === Disabled checkboxes === */
input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

input[type="checkbox"]:disabled + label,
input[type="checkbox"]:disabled ~ label {
    color: #999;
}

input[type="checkbox"]:disabled + span,
input[type="checkbox"]:disabled + label,
input[type="checkbox"]:disabled ~ label {
    color: #d3d3d3;
}

label.disabled {
    color: #d3d3d3;
    cursor: not-allowed;
}

/* === RIGHT PANE: SERIES LIST === */
.region-series-wrapper {
    margin-left: 24px;
    height: 100%;
    overflow-y: auto;
}

/* === SERIES GRID - MODERN STYLE === */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    grid-auto-rows: 1fr;
}

.series-item-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.2s ease;
    padding-bottom: 16px;
}

.series-item-link.hidden {
    opacity: 0;
    transform: scale(0.97);
    pointer-events: none;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
}

/* === MODERN CARD DESIGN === */
.series-item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    height: 100%;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
    cursor: pointer;
    transition: all 0.2s ease;
    word-break: break-word;
}

.s-item-series-code {
    font-weight: 600;
    font-size: 0.8rem;
    font-family: "Inter", sans-serif;
    color: #d3d3d3;
    margin-bottom: 8px;
}

.s-item-series-title {
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    color: #1a73e8;
    margin-bottom: 8px;
}

.s-item-latest-value {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    color: #1a202c;
    font-size: 1.4rem;
}

.s-item-latest-date {
    font-family: "Inter", sans-serif;
    font-weight: 300;
    text-transform: uppercase;
    color: #64748b;
    font-size: 12px;
}

/* === MODERN TREND PILL DESIGN === */
.s-item-compare {
    font-size: 1rem;
    border-radius: 50px;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: 8px;
}

/* Green trend pill */
.s-item-compare.trend-color-green {
    background-color: #d1fae5;
    border: 1px solid #10b981;
    color: #065f46;
}

/* Red trend pill */
.s-item-compare.trend-color-red {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

/* Gray/neutral trend pill */
.s-item-compare.trend-color-gray {
    background-color: #f3f4f6;
    border: 1px solid #9ca3af;
    color: #4b5563;
}

.s-item-change {
    font-family: "Inter", sans-serif;
    font-weight: 500;
}

/* Trend color styles for text */
.trend-color-green {
    color: #10b981;
}

.trend-color-red {
    color: #ef4444;
}

.trend-color-gray {
    color: #6b7280;
}

.s-item-period-compared {
    font-size: 12px;
}

/* === CARD HOVER EFFECT === */
.series-item:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #2563EB;
}

.series-item-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.series-item-link.hide {
    opacity: 0;
    transform: translateY(10px);
}

.series-count {
    font-weight: 300;
    font-family: "Inter", monospace;
    color: #777;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 2px 8px;
}

.collapsed {
    display: none;
}

/* === SERIES PAGINATION === */
.series-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.series-pagination a,
.series-pagination span {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 0;
    text-decoration: none;
    color: #000;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.series-pagination a:hover {
    background-color: #d3d3d3;
    color: black;
    border-color: #ccc;
}

.series-pagination span.active {
    background-color: #000;
    color: #fff;
    border-color: #000;
    cursor: default;
}

.series-pagination span.disabled {
    color: #aaa;
    border-color: #eee;
    cursor: not-allowed;
}

.series-pagination i.bi {
    font-size: 0.9rem;
}

/* === FILTER PANE === */
.region-settings-wrapper {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    gap: 20px;
    height: fit-content;
}

.filter-pane-hdr {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #111;
    margin-bottom: 10px;
}

/* === FILTER GROUP === */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-hdr-label {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #6A7282;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.filter-subgroup {
    position: relative;
    margin-bottom: 10px;
}

/* === DROPDOWN BUTTON === */
.filter-select-btn {
    width: 100%;
    padding: 10px 14px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    color: #6B7280;
}

.filter-select-btn:hover {
    border-color: #2563EB;
    background: #F9FAFB;
}

.filter-select-btn.has-selection {
    color: #111;
    font-weight: 500;
    border-color: #2563EB;
}

.filter-select-label {
    flex: 1;
    text-align: left;
}

/* === DROPDOWN MENU === */
.filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.filter-dropdown.show {
    display: block;
}

.filter-dropdown-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

/* === CHECKBOX LABELS === */
.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    color: #374151;
}

.filter-checkbox-label:hover {
    background: #F3F4F6;
}

.filter-checkbox-label.disabled {
    color: #D1D5DB;
    cursor: not-allowed;
}

.filter-checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    accent-color: #2563EB;
}

.filter-checkbox-label > span:first-of-type {
    flex: 1;
    text-align: left;
}

.series-count {
    font-size: 12px;
    color: #9CA3AF;
    flex-shrink: 0;
    margin-left: auto;
}

/* === CATEGORY GROUP IN DROPDOWN === */
.category-group-dropdown {
    margin-bottom: 8px;
}

.category-group-dropdown .category-label {
    font-weight: 600;
}

.subcategory-list-dropdown {
    padding-left: 20px;
    margin-top: 4px;
}

.subcategory-list-dropdown .subcategory-label {
    font-size: 13px;
}

/* === ACTIVE FILTERS === */
.active-filters-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #E5E7EB;
}

.active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #6A7282;
    text-transform: uppercase;
}

.clear-all-btn {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #6B7280;
    transition: all 0.2s;
}

.clear-all-btn:hover {
    background: #F3F4F6;
    border-color: #DC2626;
    color: #DC2626;
}

.active-filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-radius: 16px;
    font-size: 12px;
    color: #3730A3;
    font-family: "Inter", sans-serif;
}

.filter-tag i {
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}

.filter-tag i:hover {
    color: #DC2626;
}

/* === ACTION BUTTONS === */
.category-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.category-actions button,
.btn-primary {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

#apply-filters,
.btn-primary {
    background: #2563EB;
    color: white;
}

#apply-filters:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    background: #1D4ED8;
}

#apply-filters:disabled {
    background: #E5E7EB;
    color: #9CA3AF;
    cursor: not-allowed;
}

/* === SCROLLBAR STYLING === */
.filter-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown-content::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

.filter-dropdown-content::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.filter-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .series-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .region-details-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .series-grid {
        grid-template-columns: 1fr;
    }
}