@font-face {
    font-family: 'Barlow Condensed';
    src: url('../fonts/BarlowCondensed-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Barlow Condensed';
    src: url('../fonts/BarlowCondensed-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Barlow Condensed';
    src: url('../fonts/BarlowCondensed-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: 'USSF Unity Bold';
    src: url('../fonts/USSF_UNITY_FONT/USSFUnity-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

:root {
    --header-height: 144px;
    --page-gutter: clamp(16px, 4vw, 24px);
    --content-width: 1200px;
    --form-label-width: clamp(88px, 15vw, 130px);
    --form-field-gap: 16px;
}

html {
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #000d5e;
    color: #ffffff;
    margin: 0;
    padding-top: var(--header-height);
    /* padding-bottom: 80px; */
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #ffffff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: var(--content-width);
    width: 100%;
    padding: 0 var(--page-gutter);
}

.logo-container {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    justify-content: center;
}

.logo-container img {
    display: block;
    height: auto;
    width: auto;
    max-width: min(100%, 460px);
    max-height: calc(var(--header-height) - 32px);
    object-fit: contain;
}

.program-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 2.5rem;
    color: #000d5e;
    margin-left: 20px;
    text-transform: uppercase;
    line-height: 1;
}

main.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, var(--content-width));
    padding: clamp(36px, 6vw, 80px) var(--page-gutter) clamp(48px, 6vw, 80px);
    max-width: var(--content-width);
    margin: 0 auto;
}

h1.main-title {
    font-family: 'USSF Unity Bold', 'Barlow Condensed', Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    line-height: 0.95;
    margin-bottom: 24px;
    text-align: center;
    color: #ffffff;
}

.instruction-text {
    font-family: Arial, sans-serif;
    font-size: clamp(1rem, 2.3vw, 1.5rem);
    font-weight: normal;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 60px;
    max-width: 72rem;
    color: #ffffff;
    margin-left: auto;
    margin-right: auto;
    text-wrap: pretty;
}

.search-form-container {
    width: 100%;
    max-width: 880px;
    margin-bottom: 40px;
}

.search-form {
    display: grid;
    width: min(100%, 760px);
    gap: 16px;
    margin: 0;
}

.form-group {
    display: flex;
    align-items: center;
    gap: var(--form-field-gap);
    margin-bottom: 0;
    width: 100%;
}

.form-group label {
    flex: 0 0 var(--form-label-width);
    text-align: right;
    margin-right: 0;
    font-family: Arial, sans-serif;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: normal;
    color: #ffffff;
}

.form-group input {
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 12px 14px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
}

.button-container {
    display: flex;
    justify-content: center;
    width: calc(100% - var(--form-label-width) - var(--form-field-gap));
    margin-left: calc(var(--form-label-width) + var(--form-field-gap));
    margin-top: 8px;
}

.btn-search {
    background-color: #f20023;
    color: #ffffff;
    border: none;
    min-width: min(100%, 150px);
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: normal;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn-search:hover {
    background-color: #d0001e;
}

.map-container {
    margin-top: clamp(24px, 5vw, 40px);
    width: 100%;
    /* background-color: #ffffff; */
    padding: clamp(8px, 2vw, 12px);
    /* border-radius: 4px; */
}

.map-image {
    width: 100%;
    height: auto;
    display: block;
}

footer {
    background-color: #ffffff;
    color: #130002;
    padding: 30px 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    line-height: 1.5;
    font-weight: normal;
    position: relative;
    width: 100%;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #130002;
    text-decoration: underline;
}

/* Results Popup Overrides */
.results-popup {
    width: 100%;
    margin-top: 30px;
}

.results-popup.hidden,
.hidden {
    display: none !important;
}

.p-screen {
    background-color: #ffffff;
    color: #333333;
    border-radius: 8px;
    padding: 2px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

.p-results {
    max-height: min(70vh, 500px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

#resultsTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 100%;
}

#resultsTable th {
    background-color: #000d5e;
    color: #ffffff;
    padding: 12px 15px;
    text-align: left;
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#resultsTable td {
    padding: 10px 15px;
    border-bottom: 1px solid #eeeeee;
    vertical-align: top;
    word-break: break-word;
}

#resultsTable tr:nth-child(even) {
    background-color: #f8f9fa;
}

#resultsTable tr.alt {
    background-color: #f8f9fa;
}

#resultsTable tr:hover {
    background-color: #f1f1f1;
}

.eye-icon {
    color: #f20023;
    font-size: 1.2rem;
    text-decoration: none;
}

.eye-icon:hover {
    color: #d0001e;
}

.warning {
    background-color: #fff;
    color: #000;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
    word-break: break-word;
}

.warning a {
    color: #f20023;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 991.98px) {
    :root {
        --header-height: 124px;
    }

    .instruction-text {
        max-width: 48rem;
    }
}

@media (max-width: 767.98px) {
    :root {
        --header-height: 104px;
        --page-gutter: 16px;
    }

    header {
        padding: 10px 0;
    }

    .header-content {
        padding: 0 16px;
    }

    .logo-container img {
        max-width: 260px;
        max-height: calc(var(--header-height) - 24px);
    }

    .program-title {
        font-size: 1.5rem;
    }

    h1.main-title {
        font-size: clamp(2rem, 10vw, 3rem);
        margin-bottom: 16px;
    }

    .instruction-text {
        text-align: left;
        margin-bottom: 24px;
    }

    .search-form {
        gap: 12px;
    }

    .form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 0;
    }

    .form-group label {
        flex: none;
        text-align: left;
        margin-right: 0;
        margin-bottom: 0;
    }

    .button-container {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }

    .btn-search {
        width: 100%;
    }

    .map-container {
        /* border-radius: 8px; */
    }

    .p-screen {
        border-radius: 12px;
    }

    #resultsTable,
    #resultsTable tbody,
    #resultsTable tr,
    #resultsTable td {
        display: block;
        width: 100%;
    }

    #resultsTable thead {
        display: none;
    }

    #resultsTable tr {
        padding: 14px 16px;
        border-bottom: 1px solid #e6e6e6;
    }

    #resultsTable tr:last-child {
        border-bottom: none;
    }

    #resultsTable td {
        border: none;
        padding: 6px 0 6px 42%;
        position: relative;
        min-height: 30px;
    }

    #resultsTable td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 6px;
        width: 36%;
        font-size: 0.75rem;
        font-weight: bold;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #000d5e;
    }

    #resultsTable td[data-label="View"] {
        display: flex;
        align-items: center;
        min-height: 42px;
    }

    #resultsTable td[data-label="View"] .eye-icon {
        font-size: 1.35rem;
    }

    footer {
        padding: 24px 16px;
    }
}

@media (max-width: 479.98px) {
    #resultsTable td {
        padding-top: 22px;
        padding-left: 0;
    }

    #resultsTable td::before {
        position: static;
        display: block;
        width: auto;
        margin-bottom: 4px;
    }
}

/* Map.php Specific Styles */
.status-text {
    font-family: Arial, sans-serif;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 5px;
    text-transform: uppercase;
    text-align: center;
    color: #ffffff;
}

.sub-status-text {
    font-family: Arial, sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: normal;
    margin-bottom: 20px;
    text-align: center;
    color: #ffffff;
}

.section-info {
    font-family: Arial, sans-serif;
    font-size: clamp(1.1rem, 2.8vw, 1.6rem);
    font-weight: bold;
    margin-bottom: 30px;
    text-transform: uppercase;
    text-align: center;
    color: #ffffff;
}

.print-icon {
    position: fixed;
    bottom: 120px;
    right: 30px;
    cursor: pointer;
    z-index: 1000;
    background-color: #ffffff;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.print-icon:hover {
    transform: scale(1.1);
}

.print-icon img {
    width: 35px;
    height: auto;
}

@media (max-width: 767.98px) {
    .print-icon {
        bottom: 24px;
        right: 16px;
    }
}

@media print {

    .print-icon,
    header,
    footer {
        display: none !important;
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        padding: 0 !important;
    }

    main.content {
        padding: 20px !important;
    }

    .map-container {
        /* border: 1px solid #ccc !important; */
    }

    .main-title,
    .status-text,
    .sub-status-text,
    .section-info {
        color: #000000 !important;
    }
}
