/* General Body Styles */
body {
    font-family: 'Sarabun', 'Kanit', sans-serif; /* ใช้ฟอนต์ไทยที่อ่านง่าย */
    background-color: #f0f2f5; /* สีพื้นหลังอ่อนโยน */
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    background-color: #ffffff;
    padding: 25px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px; /* จำกัดความกว้างสูงสุด */
    margin-bottom: 30px;
}

.container img {
    width: 100px;
}

/* Headings and Text */
h1, h2 {
    color: #2c3e50; /* สีน้ำเงินเข้มหรือเทาเข้ม */
    text-align: center;
    margin-bottom: 10px;
}

h1 {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 15px;
}

h2 {
    font-size: 1.6em;
    font-weight: 500;
    margin-top: 30px; /* เว้นระยะห่างก่อนส่วนแสดงผล */
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.container > p { /* ย่อหน้าแนะนำ */
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.1em;
    color: #555;
}

/* Form Styles */
form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1em;
}

form input[type="text"],
form textarea {
    width: calc(100% - 22px); /* 100% - padding - border */
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Sarabun', 'Kanit', sans-serif;
    transition: border-color 0.3s ease;
}

form input[type="text"]:focus,
form textarea:focus {
    border-color: #4A90E2; /* สีฟ้าเมื่อ focus */
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

form textarea {
    min-height: 120px;
    resize: vertical;
}

form button[type="submit"] {
    background-color: #4A90E2; /* สีฟ้า */
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: block;
    width: 100%;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

form button[type="submit"]:hover {
    background-color: #357ABD; /* สีฟ้าเข้มขึ้นเมื่อ hover */
}

/* Response Message Styling */
#responseMessage {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

#responseMessage.success {
    background-color: #d4edda; /* เขียวอ่อน */
    color: #155724;
    border: 1px solid #c3e6cb;
}

#responseMessage.error {
    background-color: #f8d7da; /* แดงอ่อน */
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Error styling for specific fields (used by JavaScript) */
.input-error {
    border-color: #dc3545 !important; /* สีแดงสำหรับ error */
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2) !important;
}
.error-text {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: -15px; /* ดึงขึ้นมาใกล้ input */
    margin-bottom: 10px;
    display: block; /* ทำให้ margin-bottom ทำงาน */
}


/* Blessings List Styling */
#blessingsList {
    margin-top: 20px;
}

#blessingsList ul {
    list-style-type: none;
    padding: 0;
}

#blessingsList li {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-left: 5px solid #4A90E2; /* แถบสีด้านซ้าย */
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

#blessingsList li strong {
    display: block;
    font-size: 1.1em;
    color: #2c3e50;
}

#blessingsList li p {
    margin: 8px 0;
    color: #555;
    white-space: pre-wrap; /* ให้เคารพการขึ้นบรรทัดใหม่ใน textarea */
}

#blessingsList li small {
    font-size: 0.9em;
    color: #777;
}

/* Horizontal Rule */
hr {
    border: 0;
    height: 1px;
    background-color: #e0e0e0;
    margin: 30px 0;
}

/* Thank you page specific styles */
.thank-you-container {
    text-align: center;
    padding: 40px;
}

.thank-you-container h1 {
    color: #28a745; /* สีเขียวสำหรับความสำเร็จ */
}

.thank-you-container p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.thank-you-container a {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.thank-you-container a:hover {
    background-color: #0056b3;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 1.8em;
    }
    h2 {
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 15px;
    }
    h1 {
        font-size: 1.6em;
    }
    form input[type="text"],
    form textarea {
        font-size: 0.95em;
    }
    form button[type="submit"] {
        font-size: 1em;
        padding: 10px 20px;
    }
}