* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f4f6f8;
    color: #222;

    overflow-x: hidden;
}


/* ================================
   MAIN CONTAINER
================================ */

.container {
    width: 92%;
    max-width: 900px;
    margin: 50px auto;
}


/* ================================
   HEADINGS
================================ */

h1 {
    text-align: center;
    font-size: 32px;
    margin: 0 0 10px;
    line-height: 1.2;
}

p {
    text-align: center;
    color: #666;
    line-height: 1.5;
}


/* ================================
   SEARCH BOX
================================ */

.search-box {
    background: white;

    padding: 25px;

    border-radius: 12px;

    display: flex;
    gap: 10px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);

    width: 100%;
}


/* ================================
   INPUT / SELECT / BUTTON
================================ */

input,
select,
button {
    min-height: 46px;

    padding: 11px 13px;

    border-radius: 8px;

    border: 1px solid #ccc;

    font-family: inherit;
    font-size: 16px;
}

input {
    flex: 1;
    min-width: 0;
}

select {
    width: 220px;
    background: white;
}

button {
    background: #222;
    color: white;

    cursor: pointer;

    border: none;

    min-width: 100px;

    font-weight: 600;
}

button:hover {
    background: #444;
}

button:active {
    transform: scale(0.98);
}


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

#results {
    width: 100%;
}


/* ================================
   STUDENT CARD
================================ */

.student-card {
    background: white;

    margin-top: 20px;

    padding: 20px;

    border-radius: 12px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);

    width: 100%;

    overflow: hidden;
}

.student-card h2 {
    margin-top: 0;
    margin-bottom: 10px;

    font-size: 24px;

    line-height: 1.3;

    overflow-wrap: anywhere;
}


/* ================================
   DOCUMENT SECTION
================================ */

.documents {
    margin-top: 20px;

    width: 100%;
}

.documents h3 {
    margin-bottom: 10px;

    font-size: 18px;
}


/* ================================
   DOCUMENT ITEM
================================ */

.document-item {
    display: flex;

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

    gap: 12px;

    padding: 12px;

    margin-top: 8px;

    background: #f5f5f5;

    border-radius: 8px;

    width: 100%;

    min-width: 0;
}

.document-item span {
    min-width: 0;

    overflow-wrap: anywhere;

    word-break: break-word;

    line-height: 1.4;
}

.document-item a {
    flex-shrink: 0;

    text-decoration: none;

    background: #222;
    color: white;

    padding: 9px 13px;

    border-radius: 6px;

    font-size: 14px;

    min-height: 40px;

    display: inline-flex;

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

.document-item a:hover {
    background: #444;
}


/* ================================
   PDF VIEWER
================================ */

.document-item iframe {
    display: block;

    width: 100%;

    max-width: 100%;

    height: 600px;

    border: none;

    border-radius: 8px;
}


/* ================================
   IMAGES
================================ */

.document-item img {
    display: block;

    width: 100%;

    max-width: 100%;

    height: auto;

    max-height: 800px;

    object-fit: contain;

    border-radius: 8px;
}


/* ================================
   LOADING BOX
================================ */

.loading-box {
    background: white;

    margin-top: 20px;

    padding: 25px;

    border-radius: 12px;

    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);

    text-align: center;

    width: 100%;
}

.loading-title {
    font-size: 18px;

    font-weight: bold;

    margin-bottom: 15px;
}

.loading-status {
    margin-top: 12px;

    color: #666;

    font-size: 14px;

    line-height: 1.6;
}


/* ================================
   PROGRESS BAR
================================ */

.progress-container {
    width: 100%;

    height: 10px;

    background: #e5e5e5;

    border-radius: 20px;

    overflow: hidden;

    margin-top: 10px;
}

.progress-bar {
    height: 100%;

    width: 0%;

    background: #222;

    border-radius: 20px;

    transition: width 0.35s ease;
}


/* ================================
   IMAGE LOADING
================================ */

.image-loading {
    margin-top: 12px;

    padding: 20px;

    background: #f1f1f1;

    border-radius: 8px;

    text-align: center;

    color: #666;

    font-size: 14px;
}


/* ================================
   LOADING COMPLETE
================================ */

.loading-complete {
    background: #eaf7ee;

    color: #24733a;

    padding: 10px 15px;

    border-radius: 8px;

    margin-top: 20px;

    margin-bottom: 15px;

    text-align: center;

    font-weight: bold;
}


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

@media (max-width: 768px) {

    .container {
        width: 94%;

        margin: 35px auto;
    }

    h1 {
        font-size: 28px;
    }

    .search-box {
        padding: 20px;
    }

    select {
        width: 200px;
    }

    .document-item iframe {
        height: 500px;
    }
}


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

@media (max-width: 600px) {

    html {
        font-size: 16px;
    }

    body {
        width: 100%;
    }

    .container {
        width: calc(100% - 24px);

        margin: 25px auto;
    }


    /* Heading */

    h1 {
        font-size: 25px;

        line-height: 1.25;

        margin-bottom: 8px;
    }

    p {
        font-size: 14px;

        margin-top: 0;
    }


    /* Search */

    .search-box {
        display: flex;

        flex-direction: column;

        gap: 12px;

        padding: 16px;

        border-radius: 12px;
    }

    input,
    select,
    button {
        width: 100%;

        min-height: 48px;

        font-size: 16px;
    }

    input {
        flex: none;
    }

    select {
        width: 100%;
    }

    button {
        width: 100%;

        font-size: 16px;
    }


    /* Student */

    .student-card {
        padding: 16px;

        margin-top: 16px;

        border-radius: 10px;
    }

    .student-card h2 {
        font-size: 21px;
    }


    /* Documents */

    .documents {
        margin-top: 16px;
    }

    .documents h3 {
        font-size: 17px;
    }


    /* Document row */

    .document-item {
        flex-direction: column;

        align-items: stretch;

        gap: 10px;

        padding: 12px;
    }

    .document-item a {
        width: 100%;

        min-height: 44px;

        font-size: 15px;
    }


    /* PDF */

    .document-item iframe {
        width: 100%;

        height: 450px;

        border-radius: 6px;
    }


    /* Images */

    .document-item img {
        width: 100%;

        height: auto;

        max-height: none;

        border-radius: 6px;
    }


    /* Loading */

    .loading-box {
        padding: 20px 16px;

        margin-top: 16px;
    }

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

    .loading-status {
        font-size: 14px;
    }
}


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

@media (max-width: 380px) {

    .container {
        width: calc(100% - 18px);
    }

    h1 {
        font-size: 22px;
    }

    .search-box {
        padding: 13px;
    }

    .student-card {
        padding: 13px;
    }

    .student-card h2 {
        font-size: 19px;
    }

    .document-item iframe {
        height: 400px;
    }
}


/* ================================
   TOUCH DEVICES
================================ */

@media (hover: none) {

    button,
    .document-item a {
        -webkit-tap-highlight-color: transparent;
    }

    button:hover,
    .document-item a:hover {
        background: #222;
    }
}

/* ================================
   LOGIN SCREEN
================================ */

.login-screen {
    position: fixed;

    inset: 0;

    display: flex;

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

    background: #f4f6f8;

    padding: 20px;

    z-index: 9999;
}

.login-box {
    width: 100%;
    max-width: 400px;

    background: white;

    padding: 30px;

    border-radius: 14px;

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

    text-align: center;
}

.login-box h2 {
    margin-top: 0;

    font-size: 26px;
}

.login-box p {
    color: #666;
}

.login-box input {
    width: 100%;

    margin-top: 10px;
}

.login-box button {
    width: 100%;

    margin-top: 12px;
}

.login-error {
    color: #d22 !important;

    min-height: 20px;

    margin-bottom: 0;
}