/* General Styles */
.hidden {
    display: none !important;
}

body {
    background-color: var(--header-bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* Back to Top Button */
a.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: red url("/assets/up-arrow.png") no-repeat center 43%;
    border-radius: 30px;
    text-indent: -9999px;
    display: none;
    z-index: 999;
}

[data-theme="theme-dark"] a.back-to-top {
    background: #27272a url("/assets/up-arrow.png") no-repeat center 43%;
    border: solid 2px #fff;
}

/* Alphabet Section */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    padding: 0;
}

.alphabet-nav li {
    margin: 3px;
}

.alphabet-nav a {
    text-decoration: none;
    color: #2656c8;
    padding: 10px;
    border: 1px solid #2656c8;
    border-radius: 5px;
    font-size: 0.7em;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.alphabet-nav a:hover {
    background-color: green;
    color: #fff;
}

[data-theme="theme-dark"] .alphabet-nav a {
    color: #fff;
    border: 1px solid #fff;
}

@media (max-width: 768px) {
    .alphabet-nav a {
        font-size: 1em;
        padding: 4px;
    }
}

/* Contacts Table */
#contactsTable {
    border: 2px solid #acacac; /* Outer border for the table */
    table-layout: auto;
    text-align: center;
    vertical-align: middle;
    margin: auto; /* Center the table */
    width: max-content; /* Use max-content for desktop */
    max-width: 100%; /* Ensure it doesn't overflow on mobile */
    border-collapse: collapse; /* Ensures borders are properly rendered */
    overflow-x: auto; /* Allow horizontal scrolling on mobile */
}

#contactsTable th {
    background-color: var(--header-bg-color, #f1f1f1);
    text-align: center;
    font-size: x-large;
    color: var(--header-text-color, #000);
    border-bottom: 2px solid #acacac; /* Horizontal border for header cells */
    padding: 10px;
}

#contactsTable tr {
    transition: background-color 0.3s, color 0.3s;
    border-bottom: 1px solid #acacac; /* Horizontal border between rows */
}

#contactsTable tr:last-child {
    border-bottom: none; /* Remove border from the last row */
}

#contactsTable tr:nth-child(even) {
    background-color: var(--row-bg-color, #f9f9f9);
}

#contactsTable tr:nth-child(odd) {
    background-color: var(--row-alt-bg-color, #fff);
}

#contactsTable tr:hover {
    background-color: var(--row-hover-bg-color, #e0e0e0);
}

#contactsTable td {
    padding: 15px 0;
    border: none; /* Remove vertical borders between td elements */
}

#contactsTable .name {
    max-width: 150px;
    padding: 0 5px;
}

[data-theme="theme-dark"] #contactsTable a {
    color: #fff;
}

[data-theme="theme-dark"] #contactsTable tr {
    --row-bg-color: #383838;
    --row-alt-bg-color: #383838;
    --row-hover-bg-color: #c0c0c0;
}

[data-theme="theme-light"] #contactsTable tr:nth-child(even) {
    --row-bg-color: #f9f9f9;
}

[data-theme="theme-light"] #contactsTable tr:nth-child(odd) {
    --row-alt-bg-color: #fff;
}

[data-theme="theme-light"] #contactsTable tr:hover {
    --row-hover-bg-color: #e0e0e0;
}

[data-theme="theme-auto"] #contactsTable tr {
    --row-bg-color: #f9f9f9;
    --row-alt-bg-color: #fff;
    --row-hover-bg-color: #e0e0e0;
}

@media (prefers-color-scheme: dark) {
    [data-theme="theme-dark"] #contactsTable tr {
        --row-bg-color: #383838;
        --row-alt-bg-color: #383838;
        --row-hover-bg-color: #c0c0c0;
    }

    [data-theme="theme-auto"] #contactsTable tr {
        --row-bg-color: #d3d3d3;
        --row-alt-bg-color: #d3d3d3;
        --row-hover-bg-color: #c0c0c0;
    }
}

/* Mobile Adjustments for Contacts Table */
@media (max-width: 768px) {
    #contactsTable {
        width: 100%; /* Full width on mobile */
        font-size: 14px; /* Adjust font size for smaller screens */
    }

    #contactsTable th, #contactsTable td {
        padding: 8px; /* Reduce padding for smaller screens */
    }
}

/* Last Updated */
#lastupdated {
    color: red;
}

/* Logo */
#logo img {
    display: block;
    margin: 20px auto 0;
    max-width: 100%;
    width: 150px;
    height: auto;
}

/* Map Link */
.map-link {
    display: inline-flex;
    align-items: center;
    color: #000;
    font-family: Arial, sans-serif;
    margin-bottom: 10px;
    text-decoration: none;
}

.map-link img {
    width: 75px;
    height: 75px;
    margin-right: 25px;
}

.map-link:hover {
    color: #007BFF;
    text-decoration: underline;
}

/* Set max-height for the image */
.modal-body img.img-fluid {
    max-height: 375px; /* Set maximum height */
    width: auto; /* Maintain aspect ratio */
    display: block; /* Ensure the image is centered */
    margin: 0 auto; /* Center the image horizontally */
}

/* Office Location Table */
#ofclocTable {
    margin: auto;
    padding: 10px;
    width: auto;
}

#ofclocTable th {
    text-align: center;
}

#ofclocTable td.name {
    padding: 2px 15px 2px 2px;
    text-align: left;
    white-space: nowrap;
}

/* Phone Link */
#phone a {
    color: white;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    bottom: 5px;
    left: 5px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px;
    border-radius: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 5px;
}

.theme-switcher .outerroundedborder {
    display: flex;
    gap: 5px;
}

.theme-switcher label {
    display: flex;
    align-items: center;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 25px;
    padding: 3px;
    font-size: 0.875rem;
}

.theme-switcher input[type="radio"]:checked+label {
    background-color: #e4e4e7 !important;
}

.theme-switcher input[type="radio"]:checked+label.dark {
    background-color: #3f3f46 !important;
}

@media (max-width: 768px) {
    .theme-switcher {
        top: 5px;
        right: 1px; /* Closer to right edge */
        bottom: auto;
        left: auto;
        flex-direction: column;
        gap: 20px; /* More space between buttons */
        padding: 2px;
        border-radius: 25px;
        transform: scale(0.75);
    }

    .theme-switcher .outerroundedborder {
        flex-direction: column;
        gap: 15px; /* Match the outer spacing */
    }

    .theme-switcher label {
        padding: 2px;
    }

    .theme-switcher label i {
        font-size: 1.25rem;
    }

    .theme-switcher label span {
        display: none;
    }
}


@media (prefers-color-scheme: dark) {
    .theme-switcher {
        background-color: #27272a;
    }
}

[data-theme="theme-dark"] .theme-switcher {
    background-color: #27272a;
}

[data-theme="theme-light"] .theme-switcher,
[data-theme="theme-auto"] .theme-switcher {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Modal */
.modal-content {
    background-color: var(--modal-bg-color, #fff);
    color: var(--modal-text-color, #000);
}

.modal-header,
.modal-footer {
    border-color: var(--modal-border-color, #dee2e6);
}

@media (prefers-color-scheme: dark) {
    .modal-content {
        --modal-bg-color: #333;
        --modal-text-color: #fff;
    }

    .modal-header,
    .modal-footer {
        --modal-border-color: #444;
    }
}

/* Theme Variables */
:root {
    --header-bg-color: #f1f1f1;
    --text-color: #000;
}

[data-theme="theme-dark"] {
    --header-bg-color: #333;
    --text-color: #fff;
}

[data-theme="theme-light"],
[data-theme="theme-auto"] {
    --header-bg-color: #f1f1f1;
    --text-color: #000;
}

[data-theme="theme-dark"] #contactsTable th {
    --header-bg-color: #333;
    --header-text-color: #fff;
}

[data-theme="theme-light"] #contactsTable th,
[data-theme="theme-auto"] #contactsTable th {
    --header-bg-color: #f1f1f1;
    --header-text-color: #000;
}

[data-theme="theme-dark"] .modal-content {
    --modal-bg-color: #333;
    --modal-text-color: #fff;
}

[data-theme="theme-dark"] .modal-header,
[data-theme="theme-dark"] .modal-footer {
    --modal-border-color: #444;
}

[data-theme="theme-light"] .modal-content,
[data-theme="theme-auto"] .modal-content {
    --modal-bg-color: #fff;
    --modal-text-color: #000;
}

[data-theme="theme-light"] .modal-header,
[data-theme="theme-light"] .modal-footer,
[data-theme="theme-auto"] .modal-header,
[data-theme="theme-auto"] .modal-footer {
    --modal-border-color: #dee2e6;
}

/* Search Input */
input[id="search"] {
    background-color: #fff;
    color: #000;
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 4px;
}

[data-theme="theme-dark"] input[id="search"] {
    background-color: #27272a;
    color: #fff;
    border-color: #444;
}

[data-theme="theme-dark"] input[id="search"]::placeholder {
    color: #bbb;
}