/* นำเข้าฟอนต์ "Prompt" สำหรับเนื้อหา และ "Sriracha" สำหรับเมนู */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;700&family=Sriracha&display=swap');

/* ✅ สไตล์พื้นฐานของทั้งเว็บ ✅ */
body {
    font-family: 'Prompt', 'Arial', sans-serif;
    background-image: url('bg.jpg'); 
    background-size: cover; 
    background-position: center; 
    background-attachment: fixed; 
    color: #333; 
    display: flex; 
    justify-content: center; 
    align-items: flex-start;
    min-height: 100vh; 
    margin: 0;
    /* 🚨 ล็อกระยะห่างด้านบนไว้ 120px เพื่อไม่ให้เนื้อหาล้นไปซ้อนกับ Navbar เด็ดขาด 🚨 */
    padding-top: 120px; 
}

/* ✅ สไตล์แถบเมนู (Navbar) ✅ */
.navbar {
    background-color: rgba(255, 255, 255, 0.95); /* พื้นหลังสีขาวสวยๆ */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); 
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 85px; /* 🚨 ล็อกความสูง Navbar ไว้ที่ 85px 🚨 */
    z-index: 1000;
    display: flex;
    justify-content: center;
}

/* คอนเทนเนอร์จัดระเบียบ Navbar (ซ้าย-กลาง-ขวา) */
.navbar-container {
    width: 98%;
    max-width: 1400px; /* ขยายความกว้างเพื่อให้อยู่บรรทัดเดียวกันได้ */
    height: 100%;
    display: flex;
    justify-content: space-between; /* กระจาย ซ้าย กลาง ขวา */
    align-items: center;
}

/* 📌 ส่วนที่ 1: เมนูด้านซ้าย */
.nav-links {
    flex: 1; /* กินพื้นที่ฝั่งซ้าย */
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 5px;
    white-space: nowrap; /* ห้ามตกบรรทัด */
}

/* 📌 ส่วนที่ 2: โลโก้ตรงกลาง */
.nav-logo {
    flex: 0 0 auto; /* ไม่ขยาย ไม่หด */
    display: flex;
    justify-content: center;
    align-items: center;
}
.nav-logo img {
    height: 100px; /* ล็อกความสูงโลโก้ให้อยู่พอดีในแถบเมนู */
    object-fit: contain;
    transition: transform 0.3s;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.nav-logo img:hover { transform: scale(1.05); }

/* 📌 ส่วนที่ 3: ข้อมูล User ด้านขวา */
.nav-user {
    flex: 1; /* กินพื้นที่ฝั่งขวา */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px; /* ระยะห่างระหว่าง พ้อยท์, ชื่อ, ปุ่มออก */
    white-space: nowrap; /* ห้ามตกบรรทัด */
    font-family: 'Prompt', sans-serif;
}

/* สไตล์ปุ่มเมนู (ใช้ฟอนต์ Sriracha) */
.nav-links a {
    font-family: 'Sriracha', 'Prompt', cursive; 
    font-size: 19px; 
    color: #444; 
    font-weight: bold;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 25px;
    transition: all 0.3s ease;
}
.nav-links a:hover, .nav-links a.active {
    background-color: #FF69B4; 
    color: white;
    box-shadow: 0 4px 8px rgba(255, 105, 180, 0.3);
    transform: translateY(-2px); 
}

/* ป้ายพ้อยท์ และ ข้อความทักทาย */
.nav-points {
    background-color: #fff3cd; color: #856404; padding: 5px 15px; 
    border-radius: 20px; font-weight: bold; border: 1px solid #ffeeba;
}
.nav-greeting { color: #6A5ACD; font-weight: bold; }

.btn-logout {
    background-color: #ff4757; color: white; padding: 8px 20px;
    border-radius: 25px; text-decoration: none; transition: 0.3s; font-weight: bold;
}
.btn-logout:hover { background-color: #ff6b81; }


/* ✅ กล่องคอนเทนเนอร์เนื้อหาทั่วไป ✅ */
.container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); 
    width: 400px; 
    text-align: center; 
    margin-bottom: 50px;
}

h2 { color: #FF7F50; margin-top: 0; font-size: 28px; }
h3 { color: #6A5ACD; }
a { color: #6A5ACD; text-decoration: none; }
a:hover { text-decoration: underline; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"], select {
    width: 100%; padding: 12px; margin-bottom: 15px; border: 2px solid #ddd;
    border-radius: 10px; box-sizing: border-box; font-family: 'Prompt', sans-serif; font-size: 16px;
}
input:focus, select:focus { border-color: #87CEEB; outline: none; }

button {
    background-color: #FF69B4; color: white; border: none; padding: 12px 25px;
    font-size: 18px; border-radius: 20px; cursor: pointer; font-family: 'Prompt', sans-serif;
    font-weight: bold; box-shadow: 0 5px 15px rgba(255, 105, 180, 0.3); transition: 0.2s; 
}
button:hover { background-color: #FF1493; transform: translateY(-2px); }

.message { padding: 12px; margin-bottom: 20px; border-radius: 10px; font-weight: bold; text-align: center;}
.message-success { background-color: #D4EDDA; color: #155724; border: 1px solid #C3E6CB; }
.message-error { background-color: #F8D7DA; color: #721C24; border: 1px solid #F5C6CB; }

table { width: 100%; border-collapse: collapse; background-color: white; margin-top: 20px; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
th, td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; }
th { background-color: #F4F4F4; color: #333; font-weight: bold; }
tr:last-child td { border-bottom: none; }
tr:hover { background-color: #F8F8F8; }