/* assets/css/style.css */

:root {
    --primary-color: #4CAF50; /* เขียว */
    --secondary-color: #81C784; /* เขียวอ่อน */
    --accent-color: #FFC107; /* เหลือง */
    --text-color: #333;
    --border-color: #ddd;
    --background-color: #f9f9f9;
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* เปลี่ยนเป็น flex-start เพื่อให้เนื้อหาอยู่ด้านบน */
    min-height: 100vh;
    padding: 20px 0; /* เพิ่ม padding ด้านบนและล่าง */
    box-sizing: border-box;
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
    box-sizing: border-box;
    animation: fadeIn 1s ease-out; /* Animation on load */
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 2.2em;
    animation: slideInDown 0.8s ease-out;
}

.current-date {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-size: 0.95em;
    animation: fadeIn 1.2s ease-out;
}

.form-group {
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease-out forwards; /* Sequential animation */
    opacity: 0; /* Start hidden for animation */
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--primary-color);
}

label i {
    margin-right: 8px;
    color: var(--secondary-color);
}

input[type="text"],
input[type="tel"],
input[type="email"],
textarea,
select {
    width: calc(100% - 20px);
    padding: 12px 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Sarabun', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    outline: none;
}

textarea {
    resize: vertical;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
}

.btn i {
    margin-right: 8px;
}

.btn-save {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-save:hover {
    background-color: #4CAF50; /* Slightly darker green */
    transform: translateY(-2px);
}

.btn-clear {
    background-color: #f44336; /* Red for clear/reset */
    color: #fff;
}

.btn-clear:hover {
    background-color: #d32f2f; /* Slightly darker red */
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.note {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9em;
    color: #555;
}

.note.important {
    color: var(--error-color);
    font-weight: bold;
    margin-top: 10px;
}

/* Confirmation Page Specific Styles */
.confirmation-page {
    text-align: center;
    padding: 50px 30px;
}

.confirmation-page h1 {
    color: var(--success-color);
}

.confirmation-page h1 i {
    color: var(--success-color);
    margin-right: 10px;
}

.success-message {
    color: var(--success-color);
    font-size: 1.2em;
    margin-bottom: 20px;
    font-weight: bold;
}

.error-message {
    color: var(--error-color);
    font-size: 1.2em;
    margin-bottom: 20px;
    font-weight: bold;
}

.btn-back {
    background-color: #007bff; /* Blue for back button */
    color: #fff;
    margin-top: 30px;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-back:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive Web Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
        max-width: unset; /* Remove max-width on smaller screens */
        width: calc(100% - 20px); /* Adjust width to fit screen */
    }

    h1 {
        font-size: 1.8em;
    }

    .btn {
        width: 100%;
        margin: 10px 0;
    }

    .form-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}