/* ===== BRU Grads – UX Refresh (drop-in) =====
   ใช้ทับสไตล์เดิมได้ทันที ไม่ต้องแก้ PHP/HTML โครงสร้าง
   โทนสี: ม่วง-ทอง ให้เข้ากับ มรภ.บุรีรัมย์
   --------------------------------------------------------- */

/* Base & Layout */
html, body {
  background: #f6f7fb;
  color: #1f2533;
  font: 16px/1.65 "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

/* Links */
a { color: #5c4ab0; text-decoration: none; }
a:hover { color: #3d2ea0; text-decoration: underline; }

/* Headings & Titles */
.title {
  font-weight: 700;
  letter-spacing: .2px;
  color: #3b2a86;
  position: relative;
  display: inline-block;
  margin: 12px 0 10px;
}
.title u, .title U { text-decoration: none; }
.title:after {
  content: "";
  display: block;
  height: 3px;
  width: 56%;
  background: linear-gradient(90deg, #6b50ff, #ffc107);
  border-radius: 2px;
  margin-top: 4px;
}

/* Navbar (ใช้โครงเดิม) */
.nav-container nav {
  background: linear-gradient(90deg, #4a148c, #7b1fa2);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(74,20,140,.2);
  padding: 6px 10px;
  margin-bottom: 18px;
}
.nav-container nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 0; padding: 0;
}
.nav-container nav ul li a {
  color: #fff;
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  transition: all .2s ease;
  font-weight: 600;
}
.nav-container nav ul li a:hover,
.nav-container nav ul li a.selected {
  background: rgba(255,255,255,.18);
  transform: translateY(-1px);
}

/* Buttons (ทับของเดิม) */
button, .submit-button, input[type="submit"] {
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #6b50ff, #8e24aa);
  color: #fff !important;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 8px 18px rgba(107,80,255,.24);
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s;
}
button:hover, .submit-button:hover, input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(107,80,255,.32);
}
button:active, .submit-button:active, input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(107,80,255,.22);
}

/* Inputs */
.text-input, input[type="text"], input[type="search"], select {
  background: #fff;
  border: 1px solid #e5e7ef;
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 280px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.text-input:focus, input[type="text"]:focus, input[type="search"]:focus, select:focus {
  border-color: #6b50ff;
  box-shadow: 0 0 0 4px rgba(107,80,255,.14);
}

/* Cards / Sections helper */
section, .user-info, .debug-info {
  background: #fff;
  border: 1px solid #eceff7;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(39,45,77,.06);
  margin-bottom: 18px;
}
.user-info { border-left: 5px solid #6b50ff; }
.debug-info { background: #fbfbff; }

/* Tables – ใช้กับทุกตารางหน้าเดิม */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(44,51,73,.06);
}
thead th {
  background: #4a148c;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 10px 8px;
  border-bottom: 0;
  white-space: nowrap;
}
tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid #eff2fb;
  vertical-align: middle;
}
tbody tr:nth-child(even) { background: #faf7ff; }
tbody tr:hover { background: #fff8e1; }

/* แถว/คอลัมน์กลางที่ต้องการกึ่งกลาง */
td[align="center"], th[align="center"] { text-align: center; }

/* Badge (เผื่อใช้แทนรูปในอนาคต) */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.badge-success { background: #e6f7ed; color: #0f8a4b; border: 1px solid #b6e5c8; }
.badge-danger  { background: #fff3f0; color: #c0392b; border: 1px solid #ffd6ce; }

/* Marquee strip */
marquee {
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}

/* Images & media */
img { max-width: 100%; height: auto; }
img.avatar { width: 56px; height: 56px; border-radius: 50%; }

/* Popup (ของเดิม) ปรับให้ดูนุ่มขึ้น */
#overlay { background: rgba(0,0,0,.6) !important; }
.popup { padding: 0 12px; }
.cnt223 {
  background: #ffffff;
  border: 1px solid #eceff7;
  box-shadow: 0 16px 40px rgba(23,28,52,.18);
  border-radius: 16px;
}
.cnt223 .x { top: -16px; }

/* Footer */
.center, .center p { text-align: center; }
footer, .center { color: #666a7a; }

/* Utility spacing */
hr { border: 0; height: 1px; background: #eceff7; margin: 18px 0; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* Responsive tweaks */
@media (max-width: 992px) {
  .nav-container nav ul { gap: 4px; }
  .text-input, input[type="text"] { min-width: 180px; }
  thead th, tbody td { padding: 8px; }
}
@media (max-width: 720px) {
  .wrapper { padding: 10px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
  .nav-container nav ul li a { padding: 8px 10px; font-size: 14px; }
  .title:after { width: 72%; }
}

/* ===== CTA Buttons: Login / Survey ===== */
.cta-section { text-align:center; margin: 10px 0 18px; }
.cta-row { 
  display:flex; flex-wrap:wrap; gap:14px; 
  justify-content:center; align-items:center; 
  margin-top:10px;
}
.btn-bru {
  display:inline-block;
  position:relative;
  padding:14px 22px 14px 56px;   /* เผื่อไอคอนด้านซ้าย */
  min-width: 150px;
  border-radius: 14px;
  color:#fff !important;
  font-weight: 700;
  letter-spacing: .2px;
  text-decoration:none;
  box-shadow: 0 10px 22px rgba(0,0,0,.15);
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
  outline: none;
}
.btn-bru:hover { 
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0,0,0,.18);
  text-decoration:none;
}
.btn-bru:active { transform: translateY(0); }

.btn-login {
  background: linear-gradient(90deg, #6b50ff, #8e24aa);
}
.btn-survey {
  background: linear-gradient(90deg, #ffb300, #ffc107);
  color:#3b2a00 !important; /* ตัวอักษรเข้มขึ้นเพื่อคอนทราสต์ */
}

/* ไอคอนแบบ emoji (เบา ไม่ต้องพึ่งไฟล์เพิ่ม) */
.btn-bru:before {
  content: "🔐";              /* default (จะเปลี่ยนแต่ละปุ่มด้านล่าง) */
  position:absolute; left:16px; top:50%; transform: translateY(-50%);
  font-size:22px; line-height:1;
  filter: saturate(1.1);
}
.btn-survey:before { content: "📝"; }

/* ข้อความรอง/บรรทัดสอง (ถ้าอยากใช้) */
.btn-bru small {
  display:block; 
  font-weight:600; 
  opacity:.9; 
  margin-top:2px;
}

/* โหมดเข้าถึง (คีย์บอร์ด) */
.btn-bru:focus {
  box-shadow: 0 0 0 4px rgba(107,80,255,.2), 0 10px 22px rgba(0,0,0,.15);
}

/* Responsive */
@media (max-width:720px){
  .btn-bru { min-width: 88%; }
}

/* ===== Mini CTA Buttons (125x46 / 125x40) – BRU Purple/Gold ===== */
.btn-bru-mini{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center;
  width:125px; height:46px;                /* ขนาดมาตรฐาน */
  border-radius:10px; padding:0 10px 0 28px; box-sizing:border-box;
  font:700 12px/1 "Segoe UI", Tahoma, sans-serif;
  letter-spacing:.2px; text-decoration:none; white-space:nowrap;
  border:0; cursor:pointer; user-select:none; color:#fff !important;
  box-shadow:0 8px 18px rgba(0,0,0,.15);
  transition:transform .15s ease, box-shadow .15s ease, opacity .2s;
}
.btn-bru-mini:hover{ transform:translateY(-1px); box-shadow:0 12px 26px rgba(0,0,0,.20); }
.btn-bru-mini:active{ transform:translateY(0); }

/* โทนสีมหาวิทยาลัย */
.btn-login-mini{  /* ม่วงเข้ม */
  background:linear-gradient(90deg,#4a148c,#6a1b9a);
  color:#fff !important;
}
.btn-survey-mini{ /* ทอง */
  background:linear-gradient(90deg,#f7b500,#ffca28);
  color:#3b2a00 !important;
}

/* เวอร์ชันเตี้ย 40px */
.btn-bru-mini--short{ height:40px; }

/* ไอคอนเล็ก ๆ (ฝัง SVG ด้วย data URI ไม่ต้องลงไฟล์เพิ่ม) */
.btn-bru-mini:before{
  content:""; position:absolute; left:8px; top:50%; transform:translateY(-50%);
  width:14px; height:14px; background-size:14px 14px; background-repeat:no-repeat;
  opacity:.95;
}
/* ไอคอนกุญแจ (ขาว) สำหรับปุ่ม Login */
.ic-lock:before{
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23ffffff" d="M12 2a5 5 0 00-5 5v3H6a2 2 0 00-2 2v8a2 2 0 002 2h12a2 2 0 002-2v-8a2 2 0 00-2-2h-1V7a5 5 0 00-5-5zm-3 8V7a3 3 0 016 0v3H9z"/></svg>');
}
/* ไอคอนดินสอ (น้ำตาลเข้ม) สำหรับปุ่มแบบสอบถาม */
.ic-pencil:before{
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%233b2a00" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>');
}

/* โหมดคีย์บอร์ด/เข้าถึงได้ */
.btn-bru-mini:focus{ outline:none; box-shadow:0 0 0 3px rgba(107,80,255,.22), 0 8px 18px rgba(0,0,0,.15); }

/* วางปุ่มคู่ให้สวย */
.btn-row-mini{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
