/* ============================= */
/* Reset & Base Styles          */
/* ============================= */
body {
    font-family: Arial, sans-serif;
    background-color: lightgray;
    color: #333;
    margin: 0;
    padding: 0;
    padding-top: 80px; /* match your nav height */
}
html { scroll-behavior: smooth; }
#filter-search-container { scroll-margin-top: 12px; }

h2 {
    display: block;
    width: 100%;
    text-align: center;
    margin: 20px 0;
}

button {
    display: block;
    width: 180px;
    margin: 10px auto;
    padding: 8px;
    background-color: #003366;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

button:hover {
    background-color: #002244;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px);
}


/* ============================= */
/* Loader                       */
/* ============================= */
#loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 9999;
}

/* ============================= */
/* Toast Notification           */
/* ============================= */
#toast {
    visibility: hidden;
    min-width: 15%;
    max-height: 5%;
    background-color: navy;
    color: #fff;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    padding: 12px;
    position: fixed;
    z-index: 1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 15px;
    opacity: 0;
    transition: opacity 0.5s;
}

/* ============================= */
/* Table Styles                 */
/* ============================= */
table {
    table-layout: fixed;
    width: 90%;
    margin: 10px auto;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 2px solid #8B0000;
}

th, td {
    border: 3px solid #131010;
    padding: 8px;
    text-align: center;
  word-break: break-word; /* or 'normal' */
    white-space: normal;
}

td {
    font-size: 24px;
}

#checkbox-container {
  display: none;
}

#checkbox-container.show {
  display: block;
}

th {
    background-color: #002244;
    color: white;
    font-weight: bold;
    font-size: 25px;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 3.5em;
}

td[data-field="Lot Number and Community/Neighborhood"] {
    padding: 12px 16px;
    touch-action: manipulation;
    font-size: 20px;
}
td[data-field="Lot Number and Community/Neighborhood"]:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
}
td[data-field="Lot Number and Community/Neighborhood"]:active {
    background-color: #f0f0f0;
    transform: scale(1.05);
    transition: transform 0.1s ease-in-out;
}

td[data-field="b"], .hidden-column {
    display: none !important;
}

/* Hide 3rd column in both tables */
#airtable-data td:nth-child(3),
#airtable-data th:nth-child(3),
#feild-data td:nth-child(3),
#feild-data th:nth-child(3) {
    display: none;
}

/* ============================= */
/* Scrollable Areas             */
/* ============================= */
.scrollable-div {
    overflow-y: auto;
}
.scrollable-div::after {
    content: '';
    display: block;
    height: 40px;
}

/* ============================= */
/* Filter / Search              */
/* ============================= */
#filter-search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#search-input {
    flex: 1;
    padding: 8px;
    font-size: 16px;
    min-width: 200px;
    width: 80%;
    max-width: 500px;
    margin: 0 auto;
    display: block;
    border: 2px solid #8B0000;
    border-radius: 4px;
}

/* ============================= */
/* Filter Checkbox Dropdown     */
/* ============================= */
#menu-toggle {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
}

#menu-toggle:hover {
    background-color: #0056b3;
}

#checkbox-container {
    position: absolute;
    top: 40px;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    display: none;
    z-index: 1000;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    white-space: nowrap;
    width: max-content;
    min-width: 180px;
    max-width: 100%;
}

.checkbox-row {
    display: flex;
    flex-direction: column;
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    font-size: 16px;
    padding: 10px 8px;
    border-radius: 5px;
    transition: background 0.2s;
}
.checkbox-row label:hover {
    background: #f0f0f0;
}
.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* ============================= */
/* Utility & Navigation         */
/* ============================= */
.jump-link {
    display: inline-block;
    margin-left: 10px;
    padding: 8px 12px;
    background-color: #003366;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}
.jump-link:hover {
    background-color: #002244;
}

/* ============================= */
/* Media Query: max-width 950px */
/* ============================= */
@media screen and (max-width: 950px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .nav-link {
        font-size: 12px;
        padding: 6px 12px;
    }

    #search-input {
        width: 100%;
    }

    th, td {
        font-size: 12px;
    }

    button {
        width: 140px;
        font-size: 12px;
    }

    .modal-content {
        width: 95%;
    }
}

/* ============================= */
/* Media Query: max-width 768px */
/* ============================= */
@media screen and (max-width: 768px) {
    .checkbox-container label {
        flex: 1 1 100%;
    }

    .search-container {
        padding: 10px;
    }

    .scrollable-div {
        max-height: none !important;
        overflow: visible !important;
        width: 90% !important;
        margin: 0 auto;
    }

    .scrollable-div::after {
        height: 20px;
    }

    .nav-link {
        font-size: 14px;
        padding: 8px 16px;
    }

    #checkbox-container {
        max-width: 90vw;
    }

    .filter-label {
        font-size: 1rem;
    }

    #search-input {
        font-size: 0.9rem;
        padding: 8px;
    }

    .modal-content {
        width: 90%;
    }
}

/* ============================= */
/* Media Query: max-width 480px */
/* ============================= */
@media screen and (max-width: 480px) {
    .checkbox-container label {
        font-size: 0.9rem;
    }

    #checkbox-container {
        min-width: 80px;
        max-width: 90vw;
    }

    #search-input {
        font-size: 0.8rem;
        padding: 6px;
    }
}

/* ============================= */
/* Media Query: max-width 430px */
/* ============================= */
@media screen and (max-width: 430px) {
    .nav-link {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }

    th, td {
        font-size: 15px;
        padding: 6px;
        max-height: fit-content;
    }

    .modal-content {
        width: 95%;
    }

    #toast {
        font-size: 12px;
        padding: 8px;
    }
}

/* ============================= */
/* Enhanced iPhone/Mobile Styles */
/* ============================= */
@media screen and (max-width: 600px) {
    body {
        font-size: 14px;
        padding: 0 10px;
    }

    h2 {
        font-size: 1.2rem;
        margin: 15px 0;
    }

    button,
    #menu-toggle,
    #clear-filters {
        width: 100%;
        font-size: 14px;
        padding: 10px;
        margin: 6px 0;
    }

    .jump-link {
        width: 50%;
        text-align: center;
        margin: auto;
        display: block;
        font-size: 14px;
    }

    #filter-search-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 0 5px;
    }

    #search-input {
        font-size: 14px;
        width: 40%;
    }

    .scrollable-div {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }

    table {
        font-size: 20px;
        width: 100%;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th, td {
        font-size: 18px;
        padding: 6px;
    }

    .carousel-close,
    .carousel-nav,
    .carousel-delete {
        font-size: 20px;
    }

    .carousel-delete {
        padding: 8px;
    }

    .checkbox-row label {
        font-size: 14px;
        padding: 8px 6px;
    }

    #checkbox-container {
        width: 100%;
        left: 0;
        right: 0;
        max-height: 250px;
    }

    .modal-content {
        width: 95%;
        padding: 10px;
    }

    #toast {
        font-size: 13px;
        padding: 10px;
        max-width: 80%;
        min-width: auto;
    }

    .table-container-padding {
        padding: 0;
    }

    .header,
    .nav-link {
        flex-direction: column;
        align-items: center;
        text-align: center;
        font-size: 14px;
    }
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}