/* ============================================================
   INTERWEATHER WEATHER ARCHIVE
   Responsive CSS
   ============================================================ */


/* ============================================================
   GLOBAL
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 20px;
    background: #f3f5f7;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}


/* ============================================================
   PAGE TITLE
   ============================================================ */

.page-title {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 20px auto;
    padding: 18px 20px;

    background: #1f4e79;
    color: white;

    border-radius: 6px;

    font-size: 28px;
    font-weight: bold;
    text-align: center;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}


/* ============================================================
   SEARCH FORM
   ============================================================ */

form {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 20px auto;

    background: white;

    padding: 20px;

    border-radius: 6px;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}


/* ============================================================
   FORM ROWS
   ============================================================ */

.form-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 15px;
}

.form-row:last-child {
    margin-bottom: 0;
}


/* ============================================================
   LABELS
   ============================================================ */

.form-row label {
    font-weight: bold;
    margin-bottom: 5px;
}


/* ============================================================
   INPUTS
   ============================================================ */

input[type="date"],
select {
    min-height: 38px;

    padding: 7px 10px;

    border: 1px solid #bfc5ca;
    border-radius: 4px;

    background: white;

    font-size: 14px;
}


/* ============================================================
   YEAR
   ============================================================ */

.year-container {
    min-width: 150px;
}


/* ============================================================
   SELECT2
   ============================================================ */

.select2-container {
    min-width: 220px;
}

.select2-container .select2-selection--single {
    height: 38px;

    border: 1px solid #bfc5ca;

    border-radius: 4px;
}

.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    line-height: 36px;
}

.select2-container--default
.select2-selection--single
.select2-selection__arrow {
    height: 36px;
}


/* ============================================================
   BUTTONS
   ============================================================ */

button {
    min-height: 38px;

    padding: 7px 15px;

    border: 0;
    border-radius: 4px;

    background: #1f4e79;
    color: white;

    font-size: 14px;
    font-weight: bold;

    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}


/* ============================================================
   SEARCH BUTTON
   ============================================================ */

button[type="submit"] {
    background: #1f4e79;
}


/* ============================================================
   CLEAR BUTTON
   ============================================================ */

.clear-btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 38px;

    padding: 7px 15px;

    background: #777;
    color: white;

    border-radius: 4px;

    text-decoration: none;

    font-size: 14px;
    font-weight: bold;
}

.clear-btn:hover {
    background: #555;
}


/* ============================================================
   RESULT CONTAINER
   ============================================================ */

.result {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto 20px auto;

    background: white;

    padding: 20px;

    border-radius: 6px;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);

    overflow-x: auto;
}


/* ============================================================
   RESULTS TABLE
   ============================================================ */

.results-table {
    width: 100%;

    border-collapse: collapse;

    table-layout: fixed;
}


/* ============================================================
   TABLE HEADERS
   ============================================================ */

.results-table th {
    background: #1f4e79;
    color: white;

    padding: 11px 10px;

    text-align: left;

    font-weight: bold;

    border: 1px solid #174064;
}


/* ============================================================
   TABLE CELLS
   ============================================================ */

.results-table td {
    padding: 10px;

    border: 1px solid #d5d9dc;

    vertical-align: top;

    word-wrap: break-word;
}


/* ============================================================
   COLUMN WIDTHS
   ============================================================ */

.results-table th:nth-child(1),
.results-table td:nth-child(1) {
    width: 180px;
}

.results-table th:nth-child(2),
.results-table td:nth-child(2) {
    width: 90px;
}

.results-table th:nth-child(3),
.results-table td:nth-child(3) {
    width: 100px;
}

.results-table th:nth-child(4),
.results-table td:nth-child(4) {
    width: auto;
}


/* ============================================================
   TABLE ROW HOVER
   ============================================================ */

.results-table tbody tr:hover {
    background: #f5f8fb;
}


/* ============================================================
   VIEW MESSAGE BUTTON
   ============================================================ */

.view-btn {
    margin-top: 8px;

    padding: 6px 11px;

    min-height: 32px;

    background: #1f4e79;

    color: white;

    border: none;

    border-radius: 4px;

    font-size: 13px;

    cursor: pointer;
}

.view-btn:hover {
    background: #163a5a;
}


/* ============================================================
   PAGINATION
   ============================================================ */

.nav {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto 20px auto;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 20px;

    padding: 15px;

    background: white;

    border-radius: 6px;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.nav a {
    padding: 8px 14px;

    background: #1f4e79;

    color: white;

    border-radius: 4px;

    text-decoration: none;

    font-weight: bold;
}

.nav a:hover {
    background: #163a5a;
}

.nav a.disabled {
    background: #ccc;

    color: #777;

    cursor: default;

    pointer-events: none;
}

.nav strong {
    white-space: nowrap;
}



/* ============================================================
   HORIZONTAL RULE
   ============================================================ */

.modal-content hr {
    border: 0;

    border-top: 1px solid #ddd;

    margin: 15px 0;
}


/* ============================================================
   MOBILE / TABLET
   ============================================================ */

@media (max-width: 900px) {

    body {
        padding: 10px;
    }

    .page-title {
        font-size: 22px;

        padding: 14px;
    }

    form {
        padding: 15px;
    }

    .form-row {
        align-items: stretch;

        flex-direction: column;

        gap: 8px;
    }

    .form-row label {
        margin-top: 5px;
        margin-bottom: 2px;
    }

    .year-container {
        width: 100%;
    }

    input[type="date"],
    select,
    .select2-container {
        width: 100% !important;

        min-width: 0;
    }

    button,
    .clear-btn {
        width: 100%;
    }


    /* Results */

    .result {
        padding: 10px;
    }

    .results-table {
        min-width: 700px;
    }


    /* Pagination */

    .nav {
        flex-wrap: wrap;

        gap: 10px;

        padding: 12px;
    }

    .nav a {
        flex: 1;

        text-align: center;
    }

}


/* ============================================================
   SMALL MOBILE DEVICES
   ============================================================ */

@media (max-width: 600px) {

    body {
        padding: 5px;
    }

    .page-title {
        font-size: 19px;

        padding: 12px 8px;

        margin-bottom: 10px;
    }

    form {
        padding: 12px;

        margin-bottom: 10px;
    }

    .result {
        padding: 5px;

        margin-bottom: 10px;
    }


    /* Modal */

    .modal {
        padding: 10px 5px;
    }

    .modal-content {
        width: 100%;

        margin: 5px auto;

        padding: 12px;

        border-radius: 5px;
    }

    #modalTitle {
        margin-right: 35px;

        font-size: 18px;

        padding: 10px;
    }

    .close {
        top: 8px;

        right: 12px;

        font-size: 28px;
    }

    .modalInfo th {
        width: 85px;

        font-size: 13px;
    }

    .modalInfo td {
        font-size: 13px;
    }

    #modalText {
        max-height: 60vh;

        padding: 10px;

        font-size: 12px;

        line-height: 1.4;
    }

    #copyMessage {
        width: 100%;
    }

}


/* ============================================================
   VERY SMALL PHONES
   ============================================================ */

@media (max-width: 400px) {

    .page-title {
        font-size: 17px;
    }

    .modalInfo th {
        width: 75px;
    }

    #modalTitle {
        font-size: 16px;
    }

    #modalText {
        font-size: 11px;
    }

}


/* ============================================================
   ACCESSIBILITY / FOCUS
   ============================================================ */

button:focus,
select:focus,
input:focus,
a:focus {
    outline: 2px solid #1f4e79;

    outline-offset: 2px;
}


/* ============================================================
   PRINT
   ============================================================ */

@media print {

    body {
        background: white;

        padding: 0;
    }

    .page-title {
        background: white;

        color: black;

        box-shadow: none;

        border-bottom: 2px solid #000;
    }

    form,
    .nav,
    .view-btn,
    .modal,
    .clear-btn {
        display: none !important;
    }

    .result {
        box-shadow: none;

        padding: 0;

        max-width: none;
    }

    .results-table {
        font-size: 11px;
    }

}
/* ============================================================
   WEATHER MESSAGE POPUP
   ============================================================ */

#weatherMessagePopup {
    display: none;
    position: fixed !important;
    z-index: 999999 !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;

    width: 100vw !important;
    height: 100vh !important;

    background: rgba(0, 0, 0, 0.65);

    overflow-y: auto;

    padding: 30px 15px;
}


#weatherMessageBox {
    position: relative;

    width: 95%;
    max-width: 1000px;

    margin: 20px auto;

    background: white;

    border-radius: 7px;

    padding: 20px;

    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
}


/* Close button */

#weatherMessageClose {
    position: absolute;

    top: 8px;
    right: 15px;

    width: auto !important;
    min-height: 0 !important;

    padding: 0 !important;

    background: transparent !important;

    color: #555;

    border: 0;

    font-size: 32px;

    line-height: 32px;

    cursor: pointer;
}

#weatherMessageClose:hover {
    color: #000;
}


/* Mobile */

@media (max-width: 600px) {

    #weatherMessagePopup {
        padding: 10px 5px;
    }

    #weatherMessageBox {
        width: 100%;

        margin: 5px auto;

        padding: 12px;
    }

}
/* ============================================================
   ARCHIVE TITLE AND TOTAL COUNT
   ============================================================ */

.archive-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.archive-count {
    margin-top: 5px;
    font-size: 15px;
    font-weight: 500;
    opacity: 0.95;
}
.year-container {
    display: flex;
    flex-direction: column;
    width: 200px;
    min-width: 150px;
    max-width: 150px;
    margin-right: 10px;
}

.year-container select {
    width: 150px;
    max-width: 150px;
}

.year-note {
    color: #555;
    font-size: 12px;
    margin-top: 3px;
}
/* ============================================================
   MESSAGE PREVIEW / VIEW MESSAGE BUTTON
   ============================================================ */

.message-preview-cell {
    width: auto;
    padding: 8px 10px !important;
}

.message-preview-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 10px;
}

.message-preview-text {
    flex: 1 1 auto;
    min-width: 0;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-preview-wrapper .view-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    margin-left: auto;
}
@media (max-width: 600px) {

    .message-preview-wrapper {
        gap: 6px;
    }

    .message-preview-text {
        font-size: 13px;
    }

    .message-preview-wrapper .view-btn {
        padding: 7px 9px;
        font-size: 12px;
    }

}