* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    color: rgb(0, 128, 128);
    text-decoration: none;
}

a:hover {
    color: purple;
}

body {
    font-family: system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    background-color: #8c9570;
}

img {
    max-width: 100%;
    /*height: auto;*/
}

h1 {
    /*font-family: system-ui, sans-serif;*/
    font-size: 24px;
    font-style: Bold;
    line-height: 1.6;
    color: black;
}

h2 {
    /*font-family: system-ui, sans-serif;*/
    font-size: 16px;
    font-style: Bold;
    line-height: 1.6;
    color: black;
}

/* Dropdown Menu */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

nav ul li {
    position: relative;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 8px 0;
    display: block;
}

nav ul li ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: #68811d;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 150px;
    display: none;
}

nav ul li:hover ul {
    display: block;
}

nav ul li ul li a {
    padding: 8px 15px;
    white-space: nowrap;
}

p, .para {
    /*font-family: system-ui, sans-serif;*/
    font-size: 16px;
    line-height: 1.2;
    color: black;
    margin: 1rem 0;
}

table tr th td {
    padding: 6pt;
    vertical-align: top;
    text-align: left;
}

ul {
    margin: 25px;
    line-height: 1.6;
}

html, body {
    height: 100%;
}

/*New on 27/2/26*/
img {
    max-width: 100%;
    height: auto;
}

nav {
    margin-top: 10px;
}

.bold {
    font-weight: bold;
}

.card-wrapper {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap to the next line on small screens */
    gap: 16px;
}

/* Default styles for mobile */
.container {
    width: 100%;
    padding: 15px;
}

/* Styles for tablets and larger screens */
@media (min-width: 768px) {
    .container {
        width: 750px;
        margin: 0 auto;
    }
}

.column, .column-a, .column-b {
    background-color: #ffffff;
    padding: 15px;
    border: 2px solid #ddd;
}

/* Fixed header */
/* Content styling */
.content {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

/* MAIN CONTENT */
.content-wrapper-a {
    display: grid;
    width: 75%;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 25px; /* space for fixed header */
    margin-bottom: 25px; /* space for fixed footer */
    /*
    height: calc(100vh - 190px);
    overflow-y: auto;
    */
}

.content-wrapper-b {
    display: grid;
    width: 66.67%;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 25px; /* space for fixed header */
    margin-bottom: 25px; /* space for fixed footer */
}

.content-wrapper-c {
    display: grid;
    width: 66.67%;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    padding: 20px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 25px; /* space for fixed header */
    margin-bottom: 25px; /* space for fixed footer */
}

.column-b iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.dashboard-container {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.dashboard-menu {
    padding: 20px;
    font-size: 16pt;
    display: flex;
    justify-content: center;
}

.dashboard-tr {
    padding: 20px;
}

.left-align {
    text-align: left;
}

.site-header {
    font-family: system-ui, sans-serif; /*position: fixed;*/
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    height: 150px;
    background: #396139;
    color: white;
    align-items: center;
    padding: 12px 20px;
    z-index: 1000;
    border-bottom: 1px solid #333;
}

.site-footer {
    font-size: 12px;
    text-align: center;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: #396139;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 12px 20px;
    z-index: 1000;
    border-top: 1px solid #333;
}

.site-title {
    font-size: 24px;
    font-weight: bold;
}

.site-logo {
    height: 125px;
    width: auto;
    float: left;
    margin-right: 20px;
}

/* Scrollable main region */
.site-main {
    position: absolute;
    top: 150px; /* equal to header height */
    bottom: 150px; /* equal to footer height */
    left: 0;
    right: 0;
    overflow-y: auto;
    background: #f7f7f7;
    padding: 20px;
}

.surrey-moths-admin-body {
    justify-content: center;
    align-items: center;
}

.surrey-moths-admin-error {
    color: red;
    text-align: center;
}

.surrey-moths-admin-h2 {
    text-align: center;
    margin-bottom: 20px;
}

.surrey-moths-admin-login-form {
    display: flex;
    flex-direction: column;
    width: 300px;
}

.surrey-moths-admin-form-wrapper {
    background-color: white;
    padding: 30px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.surrey-moths-admin-username,
.surrey-moths-admin-password {
    margin-bottom: 5px;
}

.surrey-moths-admin-login-form-input {
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.surrey-moths-admin-login-form-input-2 {
    padding: 8px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.surrey-moths-admin-login-form-button {
    padding: 10px;
    cursor: pointer;
    background-color: #68811d;
    color: white;
    border: none;
    border-radius: 3px;
    font-weight: bold;
}


.column-species {
    width: 66.67%;
    background-color: #ffffff;
    padding: 15px;
    border: 2px solid #ddd;
}

.column-species-family {
    background-color: #f0f0f0;
    font-weight: bold;
    padding: 5px;
    font-family: System-ui, sans-serif;
}

.column-species-family-a {
    background-color: #fafafa;
    font-weight: bold;
    padding: 5px;
    padding-left: 20px;
    font-family: system-ui, sans-serif;
    font-size: 0.95em;
    color: #444;
}

.column-species-family-tr {
    font-size: 10pt;
    font-family: system-ui, sans-serif;
}

.column-species-family-td {
    padding: 10px;
}


.sql-body {
    font-family: system-ui, sans-serif;
    margin: 24px;
}

.sql-h1, .sql-h4, .sql-h5 {
    margin: 0 0 16px;
}

.sql-hint {
    color: #555;
    margin-bottom: 16px;
}

.sql-panel {
    width: 50%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}

.sql-textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.sql-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.sql-button {
    padding: 8px 12px;
    cursor: pointer;
}

.sql-msg {
    margin: 16px 0;
    padding: 12px;
    border-radius: 8px;
}

.sql-error {
    background: #ffecec;
    border: 1px solid #f3b3b3;
    color: #7a1f1f;
}

.sql-ok {
    background: #eef9ee;
    border: 1px solid #b9e0b9;
    color: #1f5a1f;
}

.sql-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.sql-small {
    font-size: 12px;
    color: #666;
}

.sql-nowrap {
    white-space: nowrap;
}

.sql-scroll {
    overflow: auto;
    max-width: 100%;
}

.sql-code {
    font-family: system-ui, sans-serif;
}

label.sql-inline {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

th.sql-th, td.sql-td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: top;
}

th.sql-th {
    background: #f1f1f1;
    text-align: left;
}

.edit-taxon-account-body {
    font-family: System-ui, sans-serif;
    padding: 20px;
}

.edit-taxon-account-textbox-30px-600px {
    height: 30px;
    width: 600px
}

.edit-taxon-account-account {
    height: 300px;
    width: 600px
}

.edit-taxon-account-message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.edit-taxon-account-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.edit-taxon-account-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.edit-taxon-account-form {
    background-color: white;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.edit-taxon-account-label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

/* Accounts page (accounts.php) - extracted inline styles */
/* Table Style replacement for border="1" width="100%" cellpadding="10" */
.accounts-table {
    width: 100%;
    border-collapse: collapse; /* Merges adjacent borders into a single line */
}

.accounts-table td, .accounts-table th {
    border: 1px solid black; /* Equivalent to border="1" */
    padding: 10px; /* Equivalent to cellpadding="10" */
    vertical-align: top;
}

.accounts-search-panel {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.accounts-search-label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.accounts-search-input {
    width: 100%;
    max-width: 400px;
    padding: 8px;
}

.accounts-search-go {
    padding: 8px 15px;
    margin-left: 5px;
    cursor: pointer;
}

.accounts-inner {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.accounts-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.accounts-nav-link {
    background-color: #008CBA;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
}

.accounts-nav-disabled {
    color: #ccc;
    padding: 10px 20px;
}

.accounts-image {
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
    cursor: pointer;
}

.accounts-grades-button {
    background-color: #008CBA;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.accounts-grade-2 {
    color: violet;
}

.accounts-grade-3 {
    color: darkorange;
}

.accounts-grade-4 {
    color: red;
}

.accounts-grade-5 {
    color: darkred;
}

/* Privacy page (privacy.php) - extracted inline styles */
.privacy-policy table td,
.privacy-policy table th {
    padding: 10px;
    vertical-align: top;
}

.privacy-policy ul {
    padding: 10px;
}

.privacy-policy li {
    padding: 10px;
}

/* Recording page (recording.php) - extracted inline styles */
.recording-td-pad {
    padding: 20px;
}

/* Edit Taxon page (edit_taxon.php) - extracted inline styles */
.edit-taxon-account-body {
    font-family: System-ui, sans-serif;
    padding: 20px;
}

.edit-taxon-account-textbox-30px-600px {
    height: 30px;
    width: 600px
}

.edit-taxon-account-account {
    height: 300px;
    width: 600px
}

.edit-taxon-account-message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.edit-taxon-account-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.edit-taxon-account-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.edit-taxon-account-form {
    background-color: white;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.edit-taxon-account-label {
    display: block;
    margin-top: 10px;
    font-weight: bold;
}

.edit-taxon-text-input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    box-sizing: border-box;
}

.edit-taxon-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.edit-taxon-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.edit-taxon-buttons .update {
    background-color: #007bff;
    color: white;
}

.edit-taxon-buttons .delete {
    background-color: #dc3545;
    color: white;
}

.edit-taxon-account-form textarea {
    resize: both;
    min-width: 350px;
    min-height: 25px;
    max-width: 600px;
}

.edit-taxon-flex-center {
    display: flex;
    justify-content: center;
}

.edit-taxon-admin-link {
    font-size: 16pt;
    font-family: system-ui, sans-serif;
}

.edit-taxon-login-info {
    font-size: 11pt;
    font-family: system-ui, sans-serif;
    color: #555;
    margin-top: -10px;
}

.edit-taxon-nav-container {
    display: flex;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto 20px auto;
}

.edit-taxon-nav-link {
    background-color: #008CBA;
    color: white;
    padding: 10px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.edit-taxon-nav-disabled {
    color: #ccc;
    padding: 10px 14px;
    font-size: 14px;
}

/* Edit Macros (edit_macros.php) & Micros (edit_micros.php)  - extracted inline styles */
.edit-macros-container, .edit-micros-container {
    display: flex;
    justify-content: center;
}

.edit-macros-header-row, .edit-micros-header-row {
    font-size: 16pt;
    font-family: system-ui, sans-serif;
}

.edit-macros-header-link, .edit-micros-header-link {
    font-size: 12pt;
    font-family: system-ui, sans-serif;
}

.edit-macros-count, .edit-micros-count {
    text-align: center;
    font-family: system-ui, sans-serif;
    padding-top: 5px;
}

.edit-macros-separator, .edit-micros-separator {
    padding: 20px;
}

.edit-macros-table, .edit-micros-table {
    font-size: 12pt;
    font-family: system-ui, sans-serif;
}

.edit-micros-center {
    text-align: center;
}

/* Edit Micros page (edit_micros.php) - extracted inline styles */
.edit-micros-container {
    display: flex;
    justify-content: center;
}

.edit-micros-header-row {
    font-size: 16pt;
    font-family: system-ui, sans-serif;
}

.edit-micros-header-link {
    font-size: 12pt;
    font-family: system-ui, sans-serif;
}

.edit-micros-count {
    text-align: center;
    font-family: system-ui, sans-serif;
    padding-top: 5px;
}

.edit-micros-separator {
    padding: 20px;
}

.edit-micros-table {
    font-size: 12pt;
    font-family: system-ui, sans-serif;
}

.edit-micros-center {
    text-align: center;
}

/* --- Hamburger Menu Styles --- */

/* Hide toggle button on desktop */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle .hamburger {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #ffffff; /* Changed to white for better contrast */
    transition: all 0.3s ease-in-out;
}

/* Default styling for search form inside nav */
.search-form {
    display: inline-block;
    margin-left: 15px;
}

.search-form input {
    width: 450px;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.search-form button {
    padding: 4px;
    cursor: pointer;
}

/* Mobile Layout */
@media screen and (max-width: 768px) {
    .site-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative; /* Essential for absolute positioning of the button */
    }

    /* Absolutely position the hamburger button to the top right */
    .menu-toggle {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        margin: 0;
        z-index: 1002; /* Ensure it stays clickable */
    }

    /* Hide the navigation by default on mobile */
    #primary-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background-color: #f9f9f9;
        position: absolute;
        top: 180px;
        left: 0;
        z-index: 2000; /* Increased to ensure it covers main content completely */
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    /* Show navigation when active class is applied via JS */
    #primary-menu.is-active {
        display: flex;
    }

    /* Stack list items vertically */
    #primary-menu ul {
        flex-direction: column;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    #primary-menu li {
        width: 100%;
        text-align: center;
        /* border-bottom: 1px solid #344334; */
        background-color: #8c9570;
    }

    /* Make top-level mobile menu links visible against the light background */
    #primary-menu > ul > li > a {
        color: #333;
    }

    /* Adjust sub-menus for mobile */
    #primary-menu li ul {
        display: none; /* Hide submenus by default on mobile */
        position: static; /* Stack them in the normal flow */
        background-color: #586558; /* Slight background difference to distinguish sub-items */
        padding: 0;
    }

    /* Class toggled by JavaScript to show the submenu */
    #primary-menu li ul.submenu-active {
        display: block;
    }

    /* Optional: Indent sub-items slightly on mobile */
    #primary-menu li ul li a {
        padding-left: 20px;
        font-size: 0.9em;
    }

    /* Adjust search form for mobile */
    .search-form {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 15px 0;
        width: 100%;
    }

    .search-form input {
        width: 90%;
        margin-bottom: 10px;
    }

    /* --- Adjust Page Containers for Mobile --- */
    /* Make wrappers full width and stack their grid columns vertically */
    .content-wrapper-a,
    .content-wrapper-b,
    .content-wrapper-c {
        width: 100%;
        grid-template-columns: 1fr; /* 1 column instead of multiple */
        padding: 10px; /* Reduce padding to maximize screen space */
        margin-top: 30px; /* Was 10 */
    }

    /* Make species columns and standard columns full width */
    .column-species,
    .column,
    .column-a,
    .column-b {
        width: 100%;
        padding: 10px;
        box-sizing: border-box; /* Ensures padding doesn't push width over 100% */
    }

    /* Optional: Reduce padding on the main scrollable area for mobile */
    .site-main {
        padding: 10px;
    }
}

.accept-cookies-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-left: 20px;
    cursor: pointer;
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 9999;
}