@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300..700&display=swap');
* {
    box-sizing: border-box;
    border-radius: 0% !important;
}

body, h1, h2, h3, p, form, input, button {
    margin: 0;
    padding: 0;
    font-family: "Quicksand", sans-serif;
    transition: all 0.3s;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    font-size: 3rem;
    color: #007bff;
}

.logo i {
    margin-right: 10px;
}

#downloadLink a {
    display: inline-block;
    background-color: #FF5600;
    text-decoration: none;
    font-size: 1.2rem;
    color: #fff;
    padding: 1rem 0;
    width: 100%;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.3s;
}

#downloadLink a:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

body {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: #222;
    color: #e6e6e6;
    margin: 0;
}

.container {
    background: #111;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    padding: 2.5rem;
    border: 10px solid #111;
    border-radius: 20px;
    width: 90%;
    max-width: 850px;
}

.container label {
    color: #f8f8f8 !important;
}

h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 2.8rem;
    color: #f8f8f8;
    position: relative;
}

h1::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    height: 3px;
    width: 60px;
    background-color: #007bff;
    border-radius: 3px;
}

p {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.3rem;
    color: #e6e6e6;
}

.flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.flex-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 1.1rem;
}

.file-wrapper {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.file-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.btn-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    background-color: #444;
    color: #e6e6e6;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: background 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
}

hr {
    border: none;
    height: 3px;
    background: #007bff;
    margin: 20px auto;
    transition: width 0.4s ease;
    width: 60%;
}

.file-wrapper input[type="file"] {
    background-color: transparent;
}

.visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.btn-file:hover {
    background-color: #222;
    border: 1px dashed white;
}

input[type="password"] {
    margin-top: 0;
    display: block;
    width: 100%;
    padding: 1rem;
    padding-left: 40px;
    background-color: #444;
    color: #e6e6e6;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: background 0.3s;
    border: none;
    height: 100%;
}

input[type="password"]::placeholder {
    color: #f8f8f8;
}

input[type="password"]:focus {
    outline: none;
    background-color: #555;
}

.password-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: #f8f8f8;
    font-size: 1.1rem;
    margin-right: 20px;
}

.checkbox-wrapper input[type="checkbox"] {
    margin-right: 10px;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
}

.input-icon-wrapper input[type="text"] {
    padding-left: 40px;
}

button {
    display: block;
    width: 100%;
    padding: 1rem 0;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s;
}

button:active, .btn-file:active, #downloadLink a:active {
    transform: scale(0.95);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#qrcode {
    display: inline-block;
    vertical-align: middle;
    margin-top: 20px;
    animation: fadeIn 0.5s;
}

button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

button:focus {
    outline: none;
}

button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

.error-banner {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    padding: 10px;
    display: none; 
    border-radius: 5px;
    text-align: center;
    margin: 10px 0;
    box-sizing: border-box;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    margin: 0 5px;
    cursor: pointer;
    background-color: #007bff;
    color: #e6e6e6;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.tab-button:hover {
    background-color: #0056b3;
}

#signFormDiv {
    text-align: center;
}

#loginFormDiv, #registerFormDiv, #accountDiv {
    display: none;
    text-align: center;
}

form {
    max-width: 750px;
    margin: 0 auto;
}

input[type="text"], input[type="email"] {
    margin-top: 0;
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: #444;
    color: #e6e6e6;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: background 0.3s;
    border: none;
    height: 100%;
    padding-left: 40px;
}

input[type="text"]::placeholder, input[type="email"]::placeholder, input[type="password"]::placeholder {
    color: #f8f8f8;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus {
    outline: none;
    background-color: #555;
}

button[type="submit"] {
    padding: 10px 20px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: #0056b3;
}

#accountDiv p {
    font-size: 18px;
    margin-bottom: 20px;
}

.username-icon, .email-icon, .password-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
}

.account-content {
    width: 100%;
    max-width: 800px;
    text-align: center;
    padding: 20px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
    background-color: #444;
    border-radius: 10px;
}

#signingHistoryTable th, #signingHistoryTable td {
    padding: 15px;
    text-align: left;
    background-color: #666;
}

#signingHistoryTable th {
    background-color: #007BFF;
    color: #fff;
}

#signingHistoryTable {
    width: 100%;
    margin-top: 20px;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #555;
    border-radius: 20px;
}

#signingHistoryTable thead tr {
    background-color: #007BFF;
    color: #fff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

#signingHistoryTable thead tr th:first-child {
    border-top-left-radius: 20px;
}

#signingHistoryTable thead tr th:last-child {
    border-top-right-radius: 20px;
}

#signingHistoryTable tbody tr:last-child td:first-child {
    border-bottom-left-radius: 20px;
}

#signingHistoryTable tbody tr:last-child td:last-child {
    border-bottom-right-radius: 20px;
}

#logoutBtn{
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 25px;
    transition: background-color 0.3s ease;
    width: 100%;
}

#signoutBtn {
    background-color: #dc3545;
    color: #fff;
}

#logoutBtn:hover, #signoutBtn:hover {
    background-color: #c82333;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}


@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    input[type="password"] {
        padding-left: 45px;
    }

    .username-icon, .email-icon {
        left: 15px;
        color: #e6e6e6;
    }

    input[type="text"], input[type="email"]{
        padding-left: 45px;
    }

    .password-icon {
        left: 15px;
        color: #e6e6e6;
    }
    .logo {
        font-size: 2rem;
    }
    .password-icon, .btn-file i {
        font-size: 1rem;
    }
    h1 {
        font-size: 2rem;
    }
    p {
        font-size: 1rem;
    }
    label, .btn-file, input[type="password"] {
        font-size: 1rem;
        color: #e6e6e6;
    }
    .btn-file, button {
        padding: 0.8rem 1rem;
    }
    .flex-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    #qrcode {
        margin-top: 10px;
        margin-left: 0;
        display: block;
        margin: 10px auto;
    }
    #signingHistoryTable {
        border-radius: 0;
    }
}

@media (max-width: 768px) {
    #signingHistoryTable th, #signingHistoryTable td {
        padding: 8px; /* Smaller padding */
        font-size: 0.8rem; /* Smaller font size */
        border-radius: 0px;
    }

    #signingHistoryTable {
        min-width: 0; /* Removes minimum width constraint */
        border-radius: 0px;
    }

    /* Hide less critical columns on very small screens */
    #signingHistoryTable th:nth-child(2), #signingHistoryTable td:nth-child(2),
    #signingHistoryTable th:nth-child(3), #signingHistoryTable td:nth-child(3) {
        display: none;
    }
    
    #signingHistoryTable thead tr {
        border-top-left-radius: 0px;
        border-top-right-radius: 0px;
    }
    
    #signingHistoryTable thead tr th:first-child {
        border-top-left-radius: 0px;
    }
    
    #signingHistoryTable thead tr th:last-child {
        border-top-right-radius: 0px;
    }
    
    #signingHistoryTable tbody tr:last-child td:first-child {
        border-bottom-left-radius: 0px;
    }
    
    #signingHistoryTable tbody tr:last-child td:last-child {
        border-bottom-right-radius: 0px;
    }
}

@media (max-width: 480px) {
    /* Further adjustments for smaller screens */
    #signingHistoryTable th, #signingHistoryTable td {
        padding: 4px; /* Even smaller padding */
        font-size: 0.7rem; /* Even smaller font size */
    }
}