/* Custom styles refactored from PHP files */

/* Global layout fix for scrollbar jump */
html {
    overflow-y: scroll;
}

/* Admin Panel Language Selector */
.admin-sidebar .language-selector {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 0;
}

.admin-sidebar .language-selector .dropdown-toggle {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.admin-sidebar .language-selector .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.admin-sidebar .language-selector .dropdown-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.admin-sidebar .language-selector .dropdown-item {
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.admin-sidebar .language-selector .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .language-selector .dropdown-item.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

/* templates/header.php */
.header-logo-img {
    height: 50px;
}

.navbar .dropdown-menu {
    z-index: 1050;
}

.search-container-width {
    min-width: 250px;
}

/* api/obligation_details.php */
.delivery-history-table-container {
    max-height: 200px;
}

/* pages/contributions.php & pages/obligations.php */
.w-5 {
    width: 5%;
}

.w-10 {
    width: 10%;
}

.w-15 {
    width: 15%;
}

.w-20 {
    width: 20%;
}

.w-25 {
    width: 25%;
}

.w-30 {
    width: 30%;
}

.w-auto {
    width: auto;
}

/* admin/media.php */
.media-card-img {
    aspect-ratio: 4/3;
    object-fit: cover;
}

.media-card-placeholder {
    aspect-ratio: 4/3;
}

.media-card-placeholder-icon {
    font-size: 3rem;
}

/* functions.php */
.hidden-by-default {
    display: none;
}

/* pages/matrix.php */
.matrix-container {
    overflow-x: auto;
    padding-bottom: 15px;
}

.matrix-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.8rem;
    table-layout: fixed;
}

.matrix-table th,
.matrix-table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    text-align: center;
    vertical-align: middle;
}

.matrix-table thead th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.matrix-table .obligation-header {
    position: sticky;
    left: 0;
    background-color: #f8f9fa;
    z-index: 11;
    width: 40%;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.matrix-table .stakeholder-header {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding: 0.5rem 0.25rem;
    max-height: 200px;
    font-weight: normal;
    font-size: 0.75rem;
}

.matrix-table .entity-group-header {
    top: 0;
}

.matrix-table .stakeholder-header-row th {
    top: 38px;
}

.matrix-table .matrix-check {
    color: #198754;
    font-weight: bold;
}

/* A single, simple highlight class */
.matrix-table .highlight {
    background-color: #e7f1ff !important;
}

/* pages/stakeholders.php */
.tier-label {
    text-align: center;
    font-weight: bold;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 40px 0 20px 0;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.stakeholder-card.entity-type-2 {
    border-style: dashed;
    border-color: #6c757d;
    border-width: 2px;
}

.card-footer .nav-tabs {
    margin: -0.75rem -0.75rem 0 -0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.card-footer .tab-content {
    text-align: left;
}

.card-footer .list-unstyled li {
    font-size: 0.85rem;
    padding: 0.25rem 0;
}

.stakeholder-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.stakeholder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.entity-group {
    padding: 20px;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    height: 100%;
}

.entity-label {
    font-size: 1.2rem;
    font-weight: 500;
    color: #495057;
    text-align: center;
    margin-bottom: 20px;
}

.card-tier-1 .card-body {
    background-color: #e9ecef;
}

.card-tier-2 .card-body {
    background-color: #e7f1ff;
}

.card-tier-3 .card-body {
    background-color: #d1e7dd;
}

.card-tier-4 .card-body {
    background-color: #f8f9fa;
}

.nfp-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    background-color: #dc3545;
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    z-index: 10;
    transform: translate(50%, -50%);
}

.stakeholder-card.entity-type-2 {
    border-style: dashed;
    border-color: #6c757d;
    border-width: 2px;
}

.obligations-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.obligations-list.expanded {
    max-height: 500px;
}

.obligations-list li {
    font-size: 0.85rem;
    padding: 0.25rem 0;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 0.5rem;
    text-align: center;
    border-top: 1px solid #dee2e6;
}

.toggle-obligations-btn {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #0d6efd;
}

/* --- Final Layout Fixes --- */
.card-content-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content-wrapper .card-body {
    padding: 1.5rem 1rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.role-badge {
    position: absolute;
    left: 50%;
    color: #495057;
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    z-index: 5;
    white-space: nowrap;
}

.role-badge.top {
    top: 0;
    transform: translate(-50%, -50%);
    background-color: #fffee3ff;
}

.role-badge.bottom {
    bottom: 2px;
    transform: translateX(-50%);
    background-color: #fde5e8ff;
}

/* admin/includes/header.php */
body.admin-body {
    display: flex;
    min-height: 100vh;
    background-color: #f8f9fa;
}

.admin-sidebar {
    width: 250px;
    min-height: 100vh;
}

.admin-main {
    flex-grow: 1;
}

/* Style adjustments for Summernote to fit the theme */
.note-editor.note-frame {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

/* =================================
   Component Styles
   ================================= */

/* --- Unified Nav Tabs --- */


.nav-tabs .nav-link {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    color: #0d6efd; /* Bootstrap's primary blue */
    border-radius: 0;
    border: none;
    border-bottom: 2px solid transparent;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.nav-tabs .nav-link:not(.active):hover {
    background-color: #e7f1ff;
    border-bottom-color: #a3c7ff;
}

.nav-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    font-weight: 500;
    background-color: #fff;
}


/* Specific adjustments for tabs inside a card-footer to keep them compact */
.card-footer .nav-tabs .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* =================================
   Data Portals Page
   ================================= */
.data-portal-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.data-portal-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-top: 4px solid #0d6efd; /* Default: Bootstrap Blue */
    border-radius: 0.5rem;
    padding: 2rem 1.5rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-top-color 0.2s ease-in-out;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.data-portal-card .external-link-icon {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 1.1rem;
    color: #6c757d;
    transition: color 0.2s ease-in-out;
}

.data-portal-card-link:hover .external-link-icon {
    color: #198754;
}

.data-portal-card-link:hover .data-portal-card--primary .external-link-icon {
    color: #dc3545;
}

.data-portal-card-link:hover .data-portal-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-top-color: #198754; /* Success Green on hover */
}

/* Modifier for the primary (top) card */
.data-portal-card.data-portal-card--primary {
    border-top-color: #fd7e14; /* Bootstrap Orange */
}

.data-portal-card-link:hover .data-portal-card.data-portal-card--primary {
    border-top-color: #dc3545; /* Bootstrap Red on hover for primary */
}

.data-portal-card .portal-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: #495057;
}

.data-portal-card .card-title-portal {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.data-portal-card .card-subtitle-portal {
    font-size: 1.0rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.data-portal-card .card-text-portal {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
}

/* =================================
   Topics Page
   ================================= */

.topic-group-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #343a40;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.topic-card-link {
    text-decoration: none;
    color: inherit;
}

.topic-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.5rem 1rem;
    text-align: center;
    height: 100%;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.07);
    border-color: #0d6efd; /* Bootstrap primary blue */
}

.topic-card .topic-icon-img {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
    object-fit: contain; /* Ensures the image fits within the dimensions without being distorted */
}

.topic-card .topic-card-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

/*
 * Topic Page Group Styling
 * --------------------------------------------------
 */

.topic-group {
    border-top: 5px solid #6c757d; /* Default color */
    padding: 20px;
    margin-bottom: 15px !important;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0px 0;
}

.theme_tier_1 {
    border-left: 3px solid #198754 !important; /* Light green */
}
.theme_tier_1 .topic-card {
    background-color: #e8f5e9 !important; /* Light green */
}
/* Natural Resources - Green */
.theme_natural_resources {
    border-top-color: #198754 !important; /* Bootstrap success green */
}
.theme_natural_resources .topic-card {
    background-color: #e8f5e9 !important; /* Light green */
}

/* Pollution Management - Blue */
.theme_pollution_management {
    border-top-color: #0d6efd !important; /* Bootstrap primary blue */
}
.theme_pollution_management .topic-card {
    background-color: #e7f3ff !important; /* Light blue */
}

/* Economy & Policy - Indigo */
.theme_economy_policy {
    border-top-color: #4f219b !important; /* Bootstrap indigo */
}
.theme_economy_policy .topic-card {
    background-color: #f0eaff !important; /* Light indigo */
}

/* Cross-Cutting - Orange */
.theme_cross_cutting {
    border-top-color: #fd7e14 !important; /* Bootstrap orange */
}
.theme_cross_cutting .topic-card {
    background-color: #fff3e0 !important; /* Light orange */
}

/* =================================
   Comprehensive Obligation View
   ================================= */

.stakeholder-card-obligation {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.stakeholder-card-obligation:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stakeholder-card-obligation .card-body {
    padding: 1.25rem;
    text-align: center;
}

.stakeholder-card-obligation .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #343a40;
}

.stakeholder-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.stakeholder-meta .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.stakeholder-card-obligation .nfp-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    z-index: 10;
    transform: translate(50%, -50%);
}

/* =================================
   Creative Section Dividers
   ================================= */

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 3rem 0;
    position: relative;
}

.divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #dee2e6, transparent);
    position: relative;
}

.divider-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, #0d6efd, transparent);
    opacity: 0.6;
}

.divider-icon {
    margin: 0 2rem;
    font-size: 2rem;
    color: #0d6efd;
}

.divider-content {
    display: flex;
    align-items: center;
    margin: 0 2rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.divider-text {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Responsive adjustments for dividers */
@media (max-width: 768px) {
    .divider-icon {
        margin: 0 1rem;
        font-size: 1.5rem;
    }

    .divider-content {
        margin: 0 1rem;
        padding: 0.5rem 1rem;
    }

    .divider-text {
        font-size: 0.8rem;
    }
}

/* =================================
   Comprehensive Obligation Page - Enhanced UI
   ================================= */


/* Enhanced Navigation Sidebar */
#section-nav .nav-link {
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border: none;
    font-weight: 500;
}

#section-nav .nav-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    transform: translateX(3px);
}

#section-nav .nav-link.active {
    background-color: #f1f3f5;
    color: black;
    box-shadow: 0 2px 8px rgba(94, 94, 95, 0.3);
}

#section-nav .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

/* Enhanced Card Styling for Different Sections */
.card[data-section-type="overview"] {
    border-top: 4px solid #0d6efd;
}

.nav-link[href="#overview"] {
    border-top: 4px solid #0d6efd !important;
}

.card[data-section-type="data-flow"] {
    border-top: 4px solid #198754;
}

.nav-link[href="#data-flow"] {
    border-left: 4px solid #198754 !important;
}

.card[data-section-type="delivery-history"] {
    border-top: 4px solid #fd7e14;
}

.nav-link[href="#delivery-history"] {
    border-left: 4px solid #fd7e14 !important;
}

.card[data-section-type="visualizations"] {
    border-top: 4px solid #6f42c1;
}

.nav-link[href="#visualizations"] {
    border-left: 4px solid #6f42c1 !important;
}

.card[data-section-type="templates"] {
    border-top: 4px solid #20c997;
}

.nav-link[href="#templates"] {
    border-left: 4px solid #20c997 !important;
}

.card[data-section-type="stakeholders"] {
    border-top: 4px solid #e83e8c;
}
.nav-link[href="#stakeholders"] {
    border-left: 4px solid #e83e8c !important;
}

.card[data-section-type="reporters"] {
    border-top: 4px solid #0dcaf0;
}
.nav-link[href="#reporters"] {
    border-left: 4px solid #0dcaf0 !important;
}
/* Enhanced Section Headers */
.card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.card .card-header h4, .card .card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
}

.card .card-header i {
    margin-right: 10px;
    color: #6c757d;
}

/* Enhanced Stakeholder Cards */
.stakeholder-card-obligation {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.stakeholder-card-obligation:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #0d6efd;
}

.stakeholder-card-obligation .card-title {
    color: #343a40;
    font-weight: 600;
    margin-bottom: 1rem;
}

.stakeholder-meta .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    margin: 0.125rem;
}

/* Responsive Enhancements */
@media (max-width: 991.98px) {
    .obligation-header .col-lg-8,
    .obligation-header .col-lg-4 {
        text-align: center !important;
    }

    .obligation-header .d-flex {
        justify-content: center;
    }

    .obligation-header .btn-group {
        margin-top: 1rem;
    }

    /* Mobile navigation becomes horizontal scroll */
    #section-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    #section-nav .nav-link {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 767.98px) {
    .obligation-header {
        padding: 2rem 0;
    }

    .obligation-header h1 {
        font-size: 1.75rem;
    }

    .obligation-header .badge {
        font-size: 0.75rem;
    }

    /* Stack navigation vertically on very small screens */
    #section-nav .nav {
        flex-direction: column;
    }

    #section-nav .nav-link {
        text-align: left;
        margin-bottom: 2px;
    }
}

/* Loading Animation for Better UX */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Enhanced Focus States for Accessibility */
.nav-link:focus,
.btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* =================================
   Comprehensive Obligation Page - Disabled Tabs
   ================================= */

.nav-tabs .nav-link.disabled {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.6;
}

.nav-tabs .nav-link.disabled:hover {
    background-color: transparent;
    border-color: transparent;
}

/* =================================
   EIONET Groups Page - CSS Grid Layout
   ================================= */

/* Main container for all groups */
.groups-grid-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Group section header */
.group-section-header {
    margin-bottom: 0.1rem;
}

/* CSS Grid for groups within each section */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    align-items: start; /* This is the key - prevents height synchronization */
}

/* Individual group card wrapper */
.group-card {
    display: flex;
    flex-direction: column;
    height: auto; /* Allow natural height */
}

/* Ensure cards don't stretch to match others */
.group-card .card {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 280px; /* Set minimum height for uniform appearance */
}

/* Card body should not flex to fill space */
.group-card .card-body {
    display: flex;
    flex-direction: column;
    min-height: 120px; /* Ensure consistent card body height */
    max-height: 220px; /* Prevent excessive expansion */
}

/* Control title height and text wrapping */
.group-card .card-title {
    flex: 0 0 auto;
    min-height: 3rem; /* Fixed title height */
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Card footer should also not flex */
.group-card .card-footer {
    flex: 0 0 auto;
    margin-top: auto; /* Push to bottom if needed */
}

/* Responsive adjustments for the grid */
@media (max-width: 768px) {
    .groups-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .groups-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

.text-primary-emphasis {
  color: #4a00b7 !important; /* Darker shade of your primary */
}

/* =================================
   Sticky Card Headers
   ================================= */

/* Base sticky header styles */
.card-header.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100; /* Below comprehensive_obligation navigation (1020) */
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 1px solid #dee2e6;
    transition: box-shadow 0.3s ease;
}

/* Special handling for comprehensive_obligation page */
.page-comprehensive-obligation .card-header.sticky-header {
    top: 0; /* Stick to the very top of the page */
    z-index: 1010; /* Above the sidebar navigation */
}


/* Ensure proper spacing when header becomes sticky */
.card-body.has-sticky-header {
    padding-top: 1rem;
}

/* Mobile adjustments - disable sticky on mobile for better UX */
@media (max-width: 991.98px) {
    .card-header.sticky-header {
        position: relative; /* Disable sticky on mobile */
        box-shadow: none;
        border-bottom: none;
    }

    .card-body.has-sticky-header {
        padding-top: 0;
    }
}

/* Enhanced sticky header appearance */
.card-header.sticky-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #dee2e6, transparent);
}

.navbar .dropdown-menu {
    z-index: 1056; /* Increased to be above Bootstrap's modal backdrop (1055) */
}

.dropdown-menu[aria-labelledby="dataNodesMenu"] {
    z-index: 1100; /* Ensure data nodes menu appears above page content */
}

@media print {
    body {
        background-color: #fff;
    }

    /* Hide non-essential elements during printing */
    header.site-header,
    footer.site-footer,
    .page-comprehensive-obligation .col-lg-3, /* Hide the entire navigation sidebar column */
    .page-comprehensive-obligation .btn-group, /* Hide print/share buttons */
    .page-comprehensive-obligation .sticky-top, /* Hide sticky elements */
    .no-print { /* Generic class to hide any other element */
        display: none !important;
    }

    /* Expand the main content to take full width */
    .page-comprehensive-obligation .col-lg-9 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Reset card styles for cleaner print output */
    .card {
        border: none !important;
        box-shadow: none !important;
        page-break-inside: avoid; /* Try to keep card content from splitting across pages */
    }

    .card-header.sticky-header {
        position: static !important; /* Remove sticky positioning */
    }

    /* Ensure links are visible and underlined for print */
    a {
        text-decoration: underline !important;
        color: #000 !important;
    }

    /* Show the URL for external links */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
        color: #555;
    }
}
