@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #5b2d8b, #1e9b6c);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* moves content toward top */
    justify-content: center;
}


.container {
    margin-top: 30px !important;
    width: 100%;
    max-width: 1200px;
    background: #ffffff;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    margin-top: -30px; /* move container slightly up */
}


h1 {
    font-size: 30px !important;
    text-align: center;
    color: #5b2d8b;
    margin-bottom: 12px;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    background: #5b2d8b;
    color: white;
    padding: 14px;
    font-size: 16px;
}

td {
    padding: 12px;
    text-align: center;
}

/* Bigger Inputs */
input, select {
    width: 100%;
    padding: 12px 10px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #bbb;
}

input:focus, select:focus {
    outline: none;
    border-color: #1e9b6c;
}

/* Buttons */
.typeBtn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    background: #1e9b6c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.typeBtn.lab {
    background: #5b2d8b;
}

/* Result Box */
.result {
    margin-top: 25px;
    background: #f9f9f9;
    color: #5b2d8b;
    text-align: center;
    padding: 18px;
    border: 2px solid #1e9b6c;
    border-radius: 12px;
    font-size: 24px;
    font-weight: bold;
}

/* Header Logo & Titles */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.header img {
    width: 90px;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 22px;
    color: #5b2d8b;
    margin: 5px 0;
}

.header h2 {
    font-size: 18px;
    color: #1e9b6c;
    margin: 0;
}

/* Mobile adjustment for header */
@media (max-width: 650px) {
    .header img {
        width: 70px;
    }

    .header h1 {
        font-size: 20px !important;
    }

    .header h2 {
        font-size: 15px;
    }
}


/* Error */
.error {
    color: red;
    font-size: 13px;
    margin-top: 6px;
}

/* Tablet */
@media (max-width: 900px) {
    th, td {
        font-size: 14px;
        padding: 10px;
    }

    input, select, .typeBtn {
        font-size: 15px;
        padding: 10px;
    }
}

/* Mobile */
@media (max-width: 650px) {
    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tr {
        background: #f4f4f4;
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 10px;
    }

    td {
        text-align: left;
        padding: 8px 0;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 4px;
        color: #5b2d8b;
    }

    .result {
        font-size: 20px;
    }
}


/* Mobile – compact & standard size */
@media (max-width: 650px) {

    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tr {
        background: #f6f6f6;
        margin-bottom: 12px;
        padding: 12px;
        border-radius: 8px;
    }

    td {
        padding: 6px 0;
        text-align: left;
        font-size: 13px;
    }

    input, select {
        padding: 8px;
        font-size: 13px;
        border-radius: 6px;
    }

    .typeBtn {
        padding: 8px;
        font-size: 13px;
        border-radius: 6px;
    }

    .result {
        font-size: 18px;
        padding: 12px;
    }

    .error {
        font-size: 11px;
    }
}


.footer {
    text-align: center;
    margin-top: 25px;
    padding: 10px 10px;
    color: #ffffff;
    background: #5b2d8b;
    border-radius: 8px;
    font-size: 14px;
}

/* Mobile adjustment */
@media (max-width: 650px) {
    .footer {
        font-size: 12px;
        padding: 10px 0;
    }
}

.grade, .gpa {
    font-weight: bold;
    color: #1e9b6c;
}


.visitor-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #5b2d8b;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
}

#closeWindowBtn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

#closeWindowBtn:hover {
    background: #c0392b;
}

