/* FILE: style.css (Complete version) */

/* --- General & Fonts --- */
body {
    font-family: 'Sarabun', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-size: 16px;
}

main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 15px;
    width: 100%;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.content-wrapper {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* --- Header & Navigation --- */
header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.07);
    padding: 0 15px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
}

.nav-brand {
    font-size: 24px;
    font-weight: 700;
    color: #0056b3;
    text-decoration: none;

    /* === เพิ่มโค้ด 3 บรรทัดนี้เพื่อจัดไอคอน === */
    display: flex; /* ทำให้ไอคอนและข้อความเรียงตัวกัน */
    align-items: center; /* จัดให้อยู่กึ่งกลางแนวตั้ง */
    gap: 8px; /* สร้างระยะห่างระหว่างไอคอนกับข้อความ */
}

.nav-links a {
    margin-left: 25px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* --- Footer --- */
footer {
    width: 100%;
    background-color: #343a40;
    color: #f8f9fa;
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
}

/* --- Form & Results Styles --- */
h1 {
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 10px;
}

p {
    color: #605f5f;
    margin-bottom: 30px;
    line-height: 1.6;
}

.date-form {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* เปลี่ยนเป็น flex-start เพื่อให้ label ชิดบน */
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.form-group {
    text-align: left;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    display: block;
}

input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    min-width: 220px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
input[type="date"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

button[type="submit"] {
    padding: 12px 30px;
    background: linear-gradient(to right, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 30px; /* เพิ่ม margin-top ให้ปุ่มอยู่ในระดับเดียวกับช่อง input */
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

/* --- เพิ่มเติม: สไตล์สำหรับแสดงปี พ.ศ. ใต้ช่องเลือกวันที่ --- */
.be-year-display {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    color: #0056b3;
    font-weight: 600;
    height: 16px; /* จองพื้นที่ไว้เล็กน้อยกัน layout กระโดด */
}


/* --- Notification Boxes --- */
.results-box, .error-box, .info-box {
    margin-top: 30px;
    padding: 20px;
    border-left-width: 5px;
    border-left-style: solid;
    text-align: left;
    border-radius: 8px;
}

.results-box {
    background-color: #e9f5ff;
    border-color: #007bff;
}
.results-box h2 { margin-top: 0; color: #0056b3; }
.results-box ul { list-style-type: none; padding: 0; }
.results-box li { background-color: #ffffff; margin-bottom: 10px; padding: 15px; border-radius: 5px; border: 1px solid #dbe9f5; }

.error-box {
    background-color: #ffebee;
    border-color: #c62828;
    color: #c62828;
}

.info-box {
    background-color: #f0f0f0;
    border-color: #6c757d;
}
.year-converter {
    background-color: #f8f9fa; /* สีพื้นหลังอ่อนๆ */
    border: 1px solid #e9ecef; /* เส้นขอบสีเทาอ่อน */
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px; /* ระยะห่างจากฟอร์มหลัก */
    text-align: left;
}

.year-converter h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #343a40; /* สีเทาเข้ม */
    text-align: center;
}

.converter-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px; /* ระยะห่างระหว่าง element */
    flex-wrap: wrap;
}

.converter-form label {
    font-weight: 600;
}

.converter-form input[type="number"] {
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    width: 120px;
    font-size: 16px;
    text-align: center;
}

.converter-result {
    font-size: 16px;
}

.converter-result strong {
    font-size: 20px;
    color: #dc3545; /* สีแดงเด่น */
    font-weight: 700;
    min-width: 50px;
    display: inline-block;
    text-align: center;
}
.main-footer { /* เปลี่ยนจาก footer เป็น .main-footer เพื่อความเฉพาะเจาะจง */
    width: 100%;
    background-color: #343a40; /* สีพื้นหลังเทาเข้ม */
    color: #ffffff; /* เปลี่ยนเป็นสีขาวล้วนเพื่อความคมชัดสูงสุด */
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
}

.main-footer p {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* ทำให้ขึ้นบรรทัดใหม่ได้บนจอเล็ก */
    gap: 15px;
}

/* สไตล์สำหรับลิงก์ Admin ใน Footer */
.admin-link {
    color: #adb5bd; /* สีเทาอ่อน ทำให้ดูไม่เด่นเท่าข้อความหลัก */
    text-decoration: none;
    font-weight: 600;
    padding: 5px 10px;
    border: 1px solid #6c757d; /* เส้นขอบสีเทา */
    border-radius: 5px;
    transition: all 0.3s ease;
}

.admin-link:hover {
    color: #ffffff; /* เมื่อเมาส์ชี้ สีข้อความจะสว่างขึ้น */
    background-color: #495057; /* เปลี่ยนสีพื้นหลังเล็กน้อย */
    border-color: #adb5bd; /* เส้นขอบสว่างขึ้น */
}