/* ====== Overall styles ======= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ====== login.html styles ======= */

#login {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 75vh;
}

#login-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.8rem;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    width: 90%;
    max-width: 500px;
}

#login-card form {
    padding: 0px;
    margin: 0px;
    width: 100%;
}

#login-title {
    margin-bottom: 0.5rem;
    font-size: 1.6rem;
}

.login-input {
    display: flex;
    flex-wrap: nowrap;
    margin: 0.7rem 0rem;
    border-style: solid;
    border-radius: 1rem;
    border-color: #a3a3a3;
    color: #a3a3a3;
    width: 100%;
    align-items: center;
    padding-left: 1rem;
}

.login-input .icon {
    padding-right: 0.3rem;
}

.login-input input {
    border: none;
    padding: 1rem 0rem;
    font-size: 1.2rem;
}

.login-input input::placeholder {
    font-size: 1.2rem;
}

.login-input input:focus {
    outline-style: none;
}

#login-submit {
    background-color: #5c95f3;
    color: white;
    width: 100%;
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 1rem;
    border-style: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    font-size: 1.2rem;
}

#login-submit:hover {
    cursor: pointer;
}

#login-remember-me {
    align-self: flex-start;
    font-size: 1rem;
    color: #505050;
    margin: 0.3rem;
    display: flex;
    justify-content: start;
    margin-top: 0.5rem;
}

#login-remember-me input {
    transform: scale(1.4);
    margin-right: 0.5rem;
}

#login-error {
    color: rgb(215, 88, 88);
    align-self: start;
    margin-top: 0.5rem;
    margin-left: 0.4rem;
}

/* ====== index.html styles (and login background) ======= */

/* Body and Background */
#home, #login {
    background-color: #8EC2DF;
    background-image: linear-gradient(#8EC2DF, #DAF4F5);
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    font-family: 'Inter', sans-serif;
}

/* Logo */
#logo {
    display: flex;
    justify-content: center;
    width: 95%;
    max-width: 600px;
}

#logo img {
    width: 50%;
    max-width: 700px;
}

/* Search Bar */
#search-area {
    display: flex;
    align-items: center;
    width: 95%;
    max-width: 600px;
    margin-bottom: 24px;
}

#search-bar {
    display: flex;
    align-items: center;
    max-width: 600px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    padding: 6px 16px;
    margin-bottom: 24px;
    height: auto;
    flex: 1;
    min-width: 0;
    margin-bottom: 0px;
}

#search-bar img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-right: 12px;
}

#search-input {
    flex: 1;
    border: none;
    min-width: 0;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #333;
}

#search-input::placeholder {
    color: #999;
}

#search-bar select {
    flex-shrink: 0;
    border: 1px solid #ccc;
    border-radius: 50px;
    background: #fff;
    padding: 8px 12px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    margin-left: 16px;
}

#search-button {
    border: none;
    background-color: #2196F3;
    color: rgb(230, 230, 230);
    border-radius: 24px;
    height: 45px;
    margin-left: 10px;
    padding: 5px 15px;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#search-button:hover {
    cursor: pointer;
}

#invalid-search {
    color: rgb(215, 88, 88);
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    padding-left: 48px;
    box-sizing: border-box;
}

/* Favorites */
#favorites {
    width: 95%;
    max-width: 600px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 16px;
}

#favorites h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

#favorite-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.favorite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f3e1ef;
    border-radius: 50px;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    padding: 12px 16px;
}

.favorite-item p {
    font-size: 1.15rem;
    font-family: 'Inter', sans-serif;
    text-transform: capitalize;
    color: black;
}

.trash-can {
    padding: 0rem 0.2rem;
    color: black;
}

.search {
    color: rgb(70, 173, 237);
}

.favorite-item button {
    background-color: transparent;
    border: none;
}

.favorite-item button:hover {
    cursor: pointer;
}

/* ====== Loading page styles ======= */
#loading-page {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70vh;
}

#loading-page img {
    width: 50%;
}

/* ====== Result pages styles ======= */

/* Overall Styles */
.result {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    color: #374151;
    line-height: 1.5;
}

.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 1.2rem;
}

@media (min-width: 768px) {
    .container {
        padding: 2.5rem;
    }
}

/* Header Styles */

.header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .header {
        flex-direction: row;
        align-items: center;
    }
}

.header-left {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .header-left {
        margin-bottom: 0;
    }
}

/* Left Header Styles */
.back-button {
    display: inline-flex;
    align-items: center;
    color: #4B5563;
    margin-right: 0.75rem;
    text-decoration: none;
    border: none;
    background-color: transparent;
}

.back-button:hover {
    color: #1F2937;
    cursor: pointer;
}

.back-icon {
    font-size: 1.875rem;
}

.title {
    font-size: 1.875rem;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.star-button {
    margin-left: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #F59E0B;
    display: inline-flex;
    align-items: center;
}

.star-button:hover {
    color: #D97706;
}

.star-icon {
    font-size: 1.875rem;
    color: #F59E0B;
}

/* Navigation Styles */
.nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .nav {
        padding-bottom: 0;
    }
}

.nav-link {
    position: relative;
    text-decoration: none;
    color: #4B5563;
    font-weight: 400;
    margin-right: 1rem;
    white-space: nowrap;
    border: none;
    background-color: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
}

@media (min-width: 640px) {
    .nav-link {
        margin-right: 1.5rem;
    }
}

.nav-link:hover {
    color: #2563EB;
    cursor: pointer;
}

.nav-link.active {
    color: #2563EB;
    font-weight: 500;
}

/* Main Grid Styles */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Left Sidebar */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Right Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Card Styles */
.card {
    background-color: #ffffff;
    border-radius: .8rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.5rem;
}

/* Grid Inside Card Styles */
/* First Card */
.grid-responsive {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .grid-responsive {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .grid-responsive {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Second Card */
.grid-2-responsive {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    column-gap: 1.5rem;
    row-gap: 1rem;
}

@media (min-width: 640px) {
    .grid-2-responsive {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Double Column Span */
.span-2 {
    grid-column: span 2 / span 2;
}

/* Labels inside grid items */
.grid-item .label {
    display: block;
    font-size: 0.875rem;
    color: #6B7280;
}

/* Values inside grid items */
.grid-item .value {
    font-weight: 500;
    color: #1F2937;
    font-size: 1.125rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

/* Details List */
.details-list {
    display: flex;
    flex-direction: column;
}

/* Each row in details-list */
.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.detail-item.border {
    border-bottom: 1px solid #E5E7EB;
}

/* Label in a detail row */
.detail-label {
    color: #4B5563;
}

/* Value in a detail row */
.detail-value {
    font-weight: 500;
    color: #1F2937;
}

/* Activity Overview */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #F9FAFB;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

.activity-label {
    display: flex;
    align-items: center;
}

/* Icons */
.icon {
    margin-right: 0.5rem;
}

.icon.complaints {
    color: #F97316;
}

.icon.violations {
    color: #EF4444;
}

.icon.litigations {
    color: #6366F1;
}

/* Text next to each icon */
.activity-label .text {
    color: #374151;
}

.activity-value {
    font-weight: 600;
    color: #1F2937;
    font-size: 1.125rem;
}

/* Status pills */
.status-pill {
    display: inline-block;
    align-items: center;
    padding: 10px 16px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    word-break: normal;
    flex-shrink: 0;
}

.status-pill--green {
    background-color: #d1fae5;
    color: #065f46;
}

.status-pill--red {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-pill--yellow {
    background-color: #fef3c7;
    color: #92400e;
}

/* ====== maps.html Styles ======= */
iframe {
    width: 100%;
    height: 65vw;
    max-height: 600px;
    min-height: 300px;
    border: none;
    display: block;
    margin: 30px 0px;
    border-radius: .8rem;
}

#map-frames {
    width: 100%;
    padding: 0px;
    box-sizing: border-box;
    margin: 0 auto;
}

#maps .card {
    margin-bottom: 1.5rem;
}

/* ====== documents.html Styles ====== */

/* base: spacing between table “cards” */
#documents .card {
    margin-bottom: 1.5rem;
}

/* base: wrapper scrolls vertically only */
.table-container {
    max-height: 410px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
}

/* base: full-width table, auto columns */
.info-table {
    border-collapse: collapse;
    width: 100%;
    table-layout: auto;
}

/* base: sticky header */
.info-table thead th {
    position: sticky;
    top: 0;
    background: #f1f5f9;
    color: #475569;
    padding: 0.75rem 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 500;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    z-index: 2;
    text-align: left;
}

/* base: body cells wrap */
.info-table tbody td {
    padding: 0.75rem 1rem;
    color: #334155;
    white-space: normal;
    word-break: break-word;
}

/* base: row separators */
.info-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

/* base: expanded-content rows (hidden by default) */
.info-table .expanded-content {
    display: none;
}

.info-table .expanded-content td {
    background: #f9fafb;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: normal;
    word-break: break-word;
}

.info-table tbody tr.expanded+tr.expanded-content {
    display: table-row;
}

/* base: chevron rotation */
.expand-icon {
    transition: transform 0.2s ease-in-out;
}

.info-table tbody tr.expanded .expand-icon {
    transform: rotate(90deg);
}

/* ====== Tablet: 769px – 1024px ====== */
@media (min-width: 769px) and (max-width: 1024px) {

    /* hide table header */
    .info-table thead {
        display: none;
    }

    /* make tbody a flex-wrap grid */
    .info-table tbody {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* each row becomes a card */
    .info-table tr {
        display: flex;
        flex-direction: column;
        flex: 1 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
        margin: 0;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #fff;
    }

    /* expanded content stays attached */
    .info-table tr.expanded {
        margin-bottom: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .info-table tr.expanded+tr.expanded-content {
        display: flex;
        flex-direction: column;
        flex: 1 1 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
        margin: 0;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        border-top: none;
        background: #fff;
        padding: 0;
    }

    /* all cells default stacking order */
    .info-table td {
        padding: 0.75rem 1rem;
        border: none;
        border-bottom: 1px solid #e2e8f0;
        white-space: normal;
        word-break: break-word;
        order: 0;
    }

    .info-table td:last-child {
        border-bottom: none;
    }

    /* label above each cell */
    .info-table td:before {
        content: attr(data-label) ":";
        display: block;
        font-weight: 600;
        color: #475569;
        margin-bottom: 0.25rem;
    }

    /* chevron cell: bottom, divider line, flex for icon+text */
    .info-table td[data-label=""] {
        order: 1;
        padding: 0.75rem 1rem;
        border-top: 1px solid #e2e8f0;
        border-bottom: none;
        display: flex;
        align-items: center;
    }

    .info-table td[data-label=""]::after {
        content: "More info";
        margin-left: 0.5rem;
        font-size: 0.875rem;
        color: #6B7280;
        opacity: 0.7;
    }

    /* everything else goes above the chevron */
    .info-table td:not([data-label=""]) {
        order: -1;
    }

    /* hide the empty-label pseudo-element */
    .info-table td[data-label=""]:before {
        display: none;
    }
}


/* ====== Mobile: up to 768px ====== */
@media (max-width: 768px) {

    /* hide table header */
    .info-table thead {
        display: none;
    }

    /* table and tbody block so wrapper scroll works */
    .info-table,
    .info-table tbody {
        display: block;
        width: 100%;
    }

    /* each row → flex column card */
    .info-table tr {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-bottom: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #fff;
    }

    /* cells default stacking */
    .info-table td {
        padding: 0.75rem 1rem;
        border: none;
        border-bottom: 1px solid #e2e8f0;
        white-space: normal;
        word-break: break-word;
        order: 0;
    }

    .info-table td:last-child {
        border-bottom: none;
    }

    /* label above each cell */
    .info-table td:before {
        content: attr(data-label) ":";
        display: block;
        font-weight: 600;
        color: #475569;
        margin-bottom: 0.25rem;
    }

    /* chevron cell: bottom, divider line, flex for icon+text */
    .info-table td[data-label=""] {
        order: 1;
        padding: 0.75rem 1rem;
        border-top: 1px solid #e2e8f0;
        border-bottom: none;
        display: flex;
        align-items: center;
    }

    .info-table td[data-label=""]::after {
        content: "More info";
        margin-left: 0.5rem;
        font-size: 0.875rem;
        color: #6B7280;
        opacity: 0.7;
    }

    /* everything else above the chevron */
    .info-table td:not([data-label=""]) {
        order: -1;
    }

    /* hide the empty-label pseudo-element */
    .info-table td[data-label=""]:before {
        display: none;
    }

    /* expanded-content as its own block beneath the card */
    .info-table tr.expanded+tr.expanded-content {
        display: block;
        margin: 0 0 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        padding: 1rem;
        background: #f9fafb;
    }
}

/* Certificate of Occupancy Link */
#documents .link {
    text-decoration: none;
    color: black;
}

#documents #link-container {
    margin-bottom: 20px;
}

/* ====== links.html Styles ====== */

#link-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.link {
    position: relative; 
    background-color: #ffffff;
    border-radius: 3rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center; 
    width: 100%;
    margin: 0.5rem 0;
}

.link-icon {
    position: absolute; 
    left: 2rem;          
    height: 2rem;
    margin: 0;           
}

.link-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 100;
    text-align: center;
    margin: 0; 
    margin-left: 1rem;
}

#links .link {
    text-decoration: none;
    color: black;
}

/* ====== Error Pages Styles ====== */

.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: center;
    margin: 1.5rem;
    height: 70vh;
}

.error-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
    text-align: center;
}

.error-image {
    width: 100%;
    max-width: 500px;
}

.error-title {
    margin-bottom: 1.5rem;
    font-size: 4rem;
}

.error-subhead {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 400;
}

.error-message {
    font-size: 1.2rem;
    padding: 0 5rem;
    margin-bottom: 1.5rem;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    .error-container {
        flex-wrap: wrap-reverse;
    }

    .error-title {
        font-size: 2.5rem;
    }

    .error-subhead {
        font-size: 1.5rem;
    }

    .error-message {
        font-size: 1rem;
        padding: 0 2rem;
    }

    .error-container {
        height: auto;
        margin: 1rem;
    }
}

/* ====== Result Errors Styles ====== */

.info-error, .hpd-error {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    background-color: #fee2e2;
    color: #610606;
    padding: 1rem;
    border-radius: .8rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    width: 100%;
}

.info-error-icon, .hpd-error {
    margin-right: 1rem;
}

.info-error a, .hpd-error a {
    color: #4b8efb;
}

.hpd-error {
    background-color: #fedbb9;
    color: #522806;
}

/* ====== Tab Panes ======= */
.hidden {
    display: none;
}

/* ====== Permits ======= */
#permit-map {
    width: 100%;
    height: 700px;
}

/* Legend */
#permit-legend {
    display: none;
    background: white;
    padding: 10px;
    margin: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#permit-legend h3 {
    margin: 0 0 5px;
    font-size: 1rem;
}

#permit-legend .legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    vertical-align: middle;
}