:root {
    --primary-color: #007BFF;
    --primary-hover-color: #0056b3;
    --success-color: #28a745;
    --success-hover-color: #218838;
    --font-family-main: 'Sukhumvit Set', sans-serif;
    --font-family-thai: 'Sarabun', sans-serif;
    --base-font-size: 1rem;
    --error-color: #ff0000; /* Added red color variable */
}

body {
    font-family: var(--font-family-main);
    background-color: #f7f7f7;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-size: var(--base-font-size);
}

body.thai {
    font-family: var(--font-family-thai);
}

.container {
    background-color: #ffffff;
    padding: 200px 50px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.language-switch {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    margin-top: 60px;
}

.lang-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 10px;
    padding: 5px 10px;
    color: #999;
    transition: all 0.3s ease;
}

.lang-btn.active {
    border-color: #000;
    color: #000;
    font-weight: bold;
}

h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 20px;
}

#bannerImage {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

p {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.checkbox-container {
    margin-bottom: 20px;
}

.checkbox-container label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
}

.learn-more {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 5px;
}
/* Add this new class for success messages */
.success-text {
    color: green;
}
.fail-text {
    color: red;
}
.learn-more:hover {
    text-decoration: underline;
}

#vinInputContainer {
    display: none; /* Hidden by default */
    flex-direction: column;
    align-items: flex-start; /* Align items to the left */
}

#vinInput {
    padding: 10px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 300px;
}

/* CSS for invalid input */
#vinInput.invalid {
    border-color: red;
}

/* CSS for warning message */
.warning {
    color: red;
    font-size: 12px;
    margin-top: 5px;
    text-align: left; /* Ensure text is aligned to the left */
}
#vinWarning {
    text-align: left;
}
#checkVinButton {
    padding: 10px 18px;
    font-size: 0.9rem;
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#checkVinButton:hover {
    background-color: var(--success-hover-color);
}

.result-text {
    font-size: 0.9rem;
    margin-top: 20px;
    white-space: pre-wrap; /* Ensures that line breaks are preserved */
    word-wrap: break-word; /* Ensures long words break onto the next line */
    padding: 10px;
    box-sizing: border-box;
    width: calc(100% - 20px); /* Ensure it fits within the container with padding */
    text-align: left;
    overflow-wrap: break-word; /* Break long words */
    border: 1px solid #ccc; /* Add border to visualize the container */
    background-color: #f9f9f9; /* Light background to distinguish the message */
}

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 600px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    text-align: left; /* Align text to the left */
    line-height: 1.6;
}

.modal-content p {
    margin: 10px 0;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer; /* Ensure the cursor changes to a pointer */
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Center the buttons within the modal */
.modal-content .modal-buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#pncRegister, #continue {
    font-size: 0.9rem;
    color: white;
    background-color: var(--primary-color);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    margin: 0 10px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

#pncRegister:hover {
    background-color: var(--primary-hover-color);
}

#continue {
    font-size: 0.9rem;
    color: var(--success-color);
    background-color: white;
    border: 2px solid var(--success-color);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    margin: 0 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
    cursor: pointer;
}

#continue:hover {
    background-color: var(--success-color);
    color: white;
}

/* Align left class for resultFail */
.align-left {
    text-align: left;
}

/* Red text class */
.red-text {
    color: var(--error-color);
    text-align: left;
    display: block;
    margin-top: 10px;
}

@media (max-width: 600px) {
    body {
        font-size: 0.9rem;
    }
    .container {
        padding: 10px;
    }
    .lang-btn {
        font-size: 0.8rem;
    }
    h1 {
        font-size: 1.2rem;
    }
    p, .checkbox-container label, .learn-more, #vinInput, #checkVinButton, .result-text {
        font-size: 0.8rem;
    }
    .modal-content {
        width: 90%; /* Adjust modal width for smaller screens */
        padding: 10px; /* Adjust padding for smaller screens */
    }
    #modalText .align-left p {
        margin: 1px 0; /* Adjust spacing for smaller screens */
        line-height: 1.2; /* Adjust line height */
    }
}
