.content{
    max-width: 80%;
    margin: 0 auto;
    padding: 3%;
    background: #ffffff;
}
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0px;
    background-color: #d7ebf8;
    font-size: larger;
}
a{
    font-weight: normal;
}
h1 {
    font-size: 2rem;
    color: rgb(10, 23, 78);
    font-family: Montserrat, sans-serif;
}
h2 {
    font-size: 1.75rem;
    margin-top: 1em;
    color: #275e9c;
}
h3{
    font-size: 1.5rem;
    margin-top: 1em;
    margin-bottom: 0em;
    color: #36768f;
}
h4{
    font-size: 1.25rem;
    margin-top: 0em;
    margin-bottom: 0em;
    color: rgb(73, 142, 173);
}
/* extra colour rgb(54, 104, 128) */
p {
    font-size: 1rem;
    color: #000000;
    font-weight: normal;
    font-size: large;
}
label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: bold;
    color: #0e243b;
}
.form-dropdown {
    width: 90%;
    padding: 0.5em;
    font-size: 1rem;
    height: 3em;
}

.form-group {
    margin-bottom: 1em;
}
/* Flexboxes */
.flex-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.5em;
    flex-wrap: wrap;
    justify-content: left;
    max-width: 100%;
}
.form-label {
    flex: 0 0 30%; /* Fixed width for label column */
    max-width: 200px;
    padding-right: 12px;
    text-align: left;
}
.flex-col {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    justify-content: space-between;
    max-width: 100%;
}
.input-col {
    flex: 1 1 0;
    min-width: 0;
}
button{
    background-color: rgb(51, 82, 110);
    color: #fffefe;
    font-size: 16px;
    padding: 5px 10px;  /* Add padding for bigger button size */
    margin: 2px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
button:hover {
    background-color: #4b778a;
}
button.submit-button {
    background-color: #0e5394;
    color: white;
    padding: 0.75em;
    font-size: 1.15rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
button.submit-button-draft {
    background-color: #24a19b;
    color: white;
    padding: 0.75em;
    font-size: 1.15rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
button.back-button{
    background-color: rgb(201 106 9);
    color: #e6e1e1;
    font-size: 1rem;
    padding: 11px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
a:link.button {
    color: rgb(255, 255, 255);
    background-color: transparent;
    text-decoration: none;
}
a:visited.button {
    color: rgb(255, 255, 255); /* Ensure visited button link color remains the same */
    background-color: transparent;
    text-decoration: none;
}
.submit-button:hover {
    background-color: #0b396b;
}
.submit-button-draft:hover {
    background-color: #0b5e6b;
}
.back-button:hover {
    background-color: #a84f06;
}
.container {
    /* max-width: 800px; */
    margin: 0 auto;
}
#spatial_coverage_name, #spatial_coverage_identifier{
    min-width: 0;
    width: 90%;
    display: block;
    margin-bottom: 10px;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #9d9d9d;
    background-color: #e3e3e3;
}

#spatial_coverage_dropdown {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
input, textarea, select{
    width: 90%;
    padding: 5px;
    border: 1px solid #9d9c9c;
    border-radius: 5px;
    box-sizing: border-box;
    background-color: white;
}
input::placeholder,
textarea::placeholder {
    white-space: normal;
}
textarea {
    height: 70px; /* Set a default height for textareas */
}
select{
    word-wrap: break-word; /* Ensure word wrapping */
    overflow-wrap: break-word; /* Compatibility with other browsers */
    white-space: pre-wrap; /* Allow breaking at whitespace */
}
select option {
    width: 90%;
    white-space: normal; /* Allow text to wrap */
    overflow-wrap: break-word;
    word-wrap: break-word;
    text-overflow: ellipsis; /* For browsers that truncate */
}
input[type="date"]{
    width: 70%;
    margin: 5px;
}
input[type="checkbox"]{
    width: 20px;
    transform: scale(1.4);
}
#selected-keywords-list {
    display: flex;
    flex-direction: column;
    max-width: 90%;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #b7c4d8;
    border-radius: 5px;
    margin-top: 10px;
    padding: 5px;
    background-color: white;    
}
#regions_table {
    width: 90%;
    margin-top: 10px;
    border-collapse: collapse;
    table-layout: fixed;
    overflow: scroll;
    height: 50vh
}
#regions_table th, #regions_table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ccc;
    word-wrap:break-word
}
/* Ensure table cells have normal text styling (not links) */
#regions_table td {
    color: inherit;
    text-decoration: none;
}
/* Only links within the table should be styled as links */
#regions_table td a {
    color: rgb(4 81 95);
    text-decoration: underline;
}
#regions_table td a:hover {
    color: rgb(146, 114, 197);
}
#regions_table tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}
/* Make only a limited number of rows visible and enable scrolling */
#regions_table tbody {
    /* display: block; */
    max-height: 600px; /* Set a fixed height to the table body */
    overflow-y: auto;  /* Enable vertical scrolling */
    height: 400px;     /* You can adjust the height depending on how many rows you want visible */
}
/* Make the header row stay fixed when scrolling */
#regions_table thead, #regions_table tbody {
    display: table;
    width: 90%;
    table-layout: fixed;
}
#regions_table thead {
    background-color: #81b0d6;
}
.required{
    color: red;
}

.hidden { display: none; }
.previous{
    color: grey;
    font-style: italic;
}
.info-circle {
    display: inline-flex;
    color: #007bff;
    font-size: 18px;
    cursor: help;
    margin-left: 5px;
    position: relative;
  }

  /* Tooltip styling */
.info-circle::after {
    content: attr(data-tooltip); /* Use the data-tooltip attribute */
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateY(-50%);
    min-width: 140px;
    max-width: 400px; 
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    z-index: 100;
    white-space: normal;      /* Allow wrapping */
    overflow-wrap: break-word;/* Break long words */
    word-break: break-word;
    pointer-events: none;
  }

.info-circle:hover::after {  /* Show tooltip on hover */
    opacity: 1;
    visibility: visible;
    text-wrap:inherit;
    
  }
  /* Container with 2 rows and 2 columns */
.grid-container {
    display: grid;
    grid-template-rows: repeat(3, 0.1fr);  /* # rows */
    width: 50%;
    grid-template-areas:
        "north east "
        "south west "
        "button .";
    align-items: center;
}
.grid-item {
    text-align: center;
    padding: 1px;
    vertical-align: middle;
}
.remove-btn {
       /* Good default for desktop */
    width: 25%;
    min-width: 60px;
    padding: 5px 10px;
    box-sizing: border-box;
    background-color: #6E4949;
}
.remove-btn:hover {
    background-color: #853535;
}
.checkbox-container {
    max-height: 30vh;
    overflow-y: auto;
    padding-right: 10px;  /* Prevent scrollbar overlap */
    border: 1px solid #8eb7cb54; /* Optional: Add a border to the container */
    background-color: #8eb7cb18; /* Optional: Add background color */
    width: 90%;
    margin-bottom: 20px;
}
.table-scroll {
    overflow-x: auto;
    width: 100%;
    max-height: 50vh;
}
.scrollable-table {
    width: 90%;
    margin-top: 10px;
    border-collapse: collapse;
    table-layout: fixed; /* Keeps columns fixed-width */

}

.scrollable-table th, .scrollable-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ccc;
    word-wrap: break-word; /* Prevents overflow of long words */
}

.scrollable-table thead {
    background-color: #81b0d6;
    position: sticky; /* Keeps the header fixed while scrolling */
    top: 0; /* Ensures the header stays at the top */
    z-index: 1; /* Prevents it from being obscured */
    table-layout: fixed;
}

.scrollable-table tbody {
    /* display: block; Enables scrolling */
    max-height: 400px; /* Limits visible rows */
    overflow-y: auto; /* Adds a scrollbar for additional rows */
    width: 100%; /* Keeps alignment with the table header */
}

.scrollable-table tr {
    display: table; /* Maintains table-row layout */
    width: 100%; /* Ensures proper alignment of cells */
    table-layout: fixed; /* Keeps column widths consistent */
}

.scrollable-table tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}
.scrollable-table col:nth-child(3) {
    width: 20%;
}
#toTopButton {
    position: fixed;
    bottom: 60px; /* Distance from the bottom of the page */
    right: 20px; /* Distance from the right edge of the page */
    background-color: #007bff; /* Button background color */
    color: white; /* Text color */
    border: none; /* Remove border */
    border-radius: 50px; /* Rounded corners */
    padding: 10px 15px; /* Padding for the button */
    cursor: pointer; /* Pointer cursor on hover */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Add a shadow */
    z-index: 1000; /* Ensure it appears above other elements */
    display: none; /* Initially hidden */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Smooth transitions */
    opacity: 0.9;
}

#toTopButton:hover {
    background-color: #0056b3; /* Darker blue on hover */
    opacity: 0.8;
}
#toBottomButton {
    position: fixed;
    bottom: 20px; /* Distance from the bottom of the page */
    right: 20px; /* Distance from the right edge of the page */
    background-color: #007bff; /* Button background color */
    color: white; /* Text color */
    border: none; /* Remove border */
    border-radius: 50px; /* Rounded corners */
    padding: 10px 15px; /* Padding for the button */
    cursor: pointer; /* Pointer cursor on hover */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); /* Add a shadow */
    z-index: 1000; /* Ensure it appears above other elements */
    display: none; /* Initially hidden */
    transition: opacity 0.3s ease, transform 0.3s ease; /* Smooth transitions */
    opacity: 0.9;
}

#toBottomButton:hover {
    background-color: #0056b3; /* Darker blue on hover */
    opacity: 0.8;
}
/* Collapsible sections */
.collapsible-section {
    margin-bottom: 1.5em;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    overflow: hidden;
    transition: all 0.3s ease;
}

.collapsible-header {
    background-color: #e8f4f8;
    padding: 1em 1.5em;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    user-select: none;
}

.collapsible-header:hover {
    background-color: #d1e7f0;
}

.collapsible-header h2,
.collapsible-header h3 {
    margin: 0;
    color: #275e9c;
    font-size: 1.5rem;
}

.collapsible-header h3 {
    font-size: 1.25rem;
    color: #36768f;
}

.collapsible-toggle {
    font-size: 1.2em;
    color: #275e9c;
    transition: transform 0.3s ease;
    font-weight: bold;
}

.collapsible-toggle.expanded {
    transform: rotate(180deg);
}

.collapsible-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: white;
}

.collapsible-content.expanded {
    padding: 1.5em;
    max-height: 80vh; /* Use viewport height for better responsiveness */
    overflow-y: auto; /* Add vertical scrollbar when content overflows */
    overflow-x: hidden; /* Prevent horizontal scrollbar */
}

/* Custom scrollbar styling for collapsible content */
.collapsible-content.expanded::-webkit-scrollbar {
    width: 8px;
}

.collapsible-content.expanded::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.collapsible-content.expanded::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.collapsible-content.expanded::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Firefox scrollbar styling */
.collapsible-content.expanded {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

.collapsible-content .form-group {
    margin-bottom: 1em;
}

/* Ensure form elements inside collapsible sections work properly */
.collapsible-content .flex-row {
    margin-bottom: 1em;
}

/* Nested collapsible sections */
.collapsible-content .collapsible-section {
    margin-bottom: 1em;
    border: 1px solid #e0e0e0;
}

.collapsible-content .collapsible-header {
    background-color: #f0f8ff;
    padding: 0.8em 1em;
}

.collapsible-content .collapsible-header:hover {
    background-color: #e6f3ff;
}

.collapsible-content .collapsible-header h3 {
    font-size: 1.1rem;
    color: #36768f;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    body {
        padding: 10px 5px;
        
    }
    * {
        box-sizing: border-box;}
    .flex-row {
        flex-direction: column;
        align-items: stretch;
    }

    html, body {
            overflow-x: hidden;
    }

    .container, .grid-container, .scrollable-table, #regions_table, .checkbox-container {
            width: 100% !important;
            max-width: 100% !important;
    }
    .container {
        max-width: 100%;
        padding: 0 5px;
        width: 100%;
    }
    input, textarea, select {
        width: 100%;
        font-size: 1em;
        
        vertical-align: top;
    }
    input[type="text"],
    input[type="url"],
    input[type="email"] {
        padding-bottom: 30px
    }
    #spatial_coverage_name,
    #spatial_coverage_identifier {
        min-width: 0;
        width: 100%;
        display: block;
        margin-bottom: 10px;
    }
    .scrollable-table,
    #regions_table, .checkbox-container {
        width: 90%;
        font-size: 0.95em;
    }
    h1, h2, h3, h4 {
        font-size: 1.1em;
    }
    p {
        font-size: 1em;
    }
    td, th {
    word-break: break-all;
    }
    /* Make buttons smaller */
    .remove-btn {
        max-width: 90%;  /* Make it wider on mobile */
    }
    #toTopButton, #toBottomButton {
    right: 10px;
    transform: none;
    }
    /* Stack buttons vertically and shift left a bit */
    #toTopButton {
        bottom: 80px; /* push higher so buttons don't overlap */
    }
    #toBottomButton {
        bottom: 20px;
    }
    
    /* Collapsible sections responsive */
    .collapsible-header {
        padding: 0.8em 1em;
    }
    
    .collapsible-header h2 {
        font-size: 1.2rem;
    }
    
    .collapsible-header h3 {
        font-size: 1.1rem;
    }
    
    .collapsible-content.expanded {
        padding: 1em;
        max-height: 70vh; /* Slightly smaller on mobile */
    }
    
    /* Mobile scrollbar adjustments */
    .collapsible-content.expanded::-webkit-scrollbar {
        width: 6px; /* Thinner scrollbar on mobile */
    }
}