/* =====================================================================
   style.css - ธีมหลัก "สภาพนักงาน มหาวิทยาลัยบูรพา"
   โทนสี: ขาว (#FFFFFF) - เหลือง (#F9B233) - เทา (#6C757D)
   ===================================================================== */

:root {
  --buu-yellow: #F9B233;
  --buu-yellow-dark: #D9930F;
  --buu-gray: #6C757D;
  --buu-gray-dark: #343A40;
  --buu-white: #FFFFFF;
  --bg-body: #FAFAFA;
  --bg-card: #FFFFFF;
  --text-main: #212529;
  --text-muted: #6C757D;
  --border-soft: rgba(0,0,0,0.06);
  --shadow-soft: 0 8px 24px rgba(0,0,0,0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --transition-base: all .25s ease;
}

[data-bs-theme="dark"] {
  --bg-body: #14161a;
  --bg-card: #1e2126;
  --text-main: #eaeaea;
  --text-muted: #a0a4ab;
  --border-soft: rgba(255,255,255,0.08);
  --shadow-soft: 0 8px 24px rgba(0,0,0,0.4);
}
[data-bs-theme="dark"] body { background: var(--bg-body); color: var(--text-main); }
[data-bs-theme="dark"] .bg-light-gray { background: #191c21 !important; }
[data-bs-theme="dark"] .news-card,
[data-bs-theme="dark"] .glass-card,
[data-bs-theme="dark"] .card { background: var(--bg-card); color: var(--text-main); }

* { box-sizing: border-box; }

body {
  font-family: 'Sarabun', 'Kanit', sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  transition: var(--transition-base);
}
h1, h2, h3, h4, h5, h6, .fw-bold { font-family: 'Kanit', sans-serif; }

a { text-decoration: none; }

.text-buu-yellow { color: var(--buu-yellow) !important; }
.text-buu-yellow-dark { color: var(--buu-yellow-dark) !important; }
.bg-light-gray { background: #F5F5F6; }
.bg-dark-section { background: var(--buu-gray-dark); }

.btn-primary-buu {
  background: linear-gradient(135deg, var(--buu-yellow) 0%, var(--buu-yellow-dark) 100%);
  border: none;
  color: #212529;
  font-weight: 600;
  border-radius: 50px;
  transition: var(--transition-base);
}
.btn-primary-buu:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249,178,51,0.4);
  color: #212529;
}

.topbar { background: var(--buu-gray-dark); color: #fff; }
.main-navbar { background: var(--bg-card); box-shadow: 0 2px 12px rgba(0,0,0,.06); padding: .6rem 0; }
.main-navbar .nav-link { font-weight: 500; color: var(--text-main); margin: 0 .4rem; position: relative; }
.main-navbar .nav-link:hover { color: var(--buu-yellow-dark); }

/* ---- Hero Section (แบบเดิม เก็บไว้เผื่อใช้ที่อื่น) ---- */
.hero-section {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #2b2f36 0%, #43484f 100%);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,22,26,.5), rgba(20,22,26,.85)); }
.min-vh-hero { min-height: 60vh; }

/* ---- Hero Split Layout (ปัจจุบัน): ข้อความฝั่งซ้าย / ภาพฝั่งขวา ไม่ทับซ้อนกัน ---- */
.hero-split {
  display: flex;
  min-height: 78vh;
  background: linear-gradient(135deg, #2b2f36 0%, #43484f 100%);
  overflow: hidden;
}
.hero-split-text {
  flex: 1 1 46%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 3.5rem;
  min-width: 320px;
}
.hero-split-image {
  flex: 1 1 54%;
  position: relative;
  min-height: 420px;
}
.hero-split-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hero-banner-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(20,22,26,.72); color: #fff;
  padding: .85rem 1.5rem; font-size: .9rem;
}
@media (max-width: 991.98px) {
  .hero-split { flex-direction: column; min-height: auto; }
  .hero-split-text { padding: 2.5rem 1.5rem; text-align: center; }
  .hero-split-text .d-flex { justify-content: center; }
  .hero-split-image { min-height: 280px; }
}

.badge-hero {
  display: inline-block; background: rgba(249,178,51,.15); color: var(--buu-yellow);
  border: 1px solid var(--buu-yellow); padding: .4rem 1rem; border-radius: 50px; font-size: .85rem;
}
.hero-title { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 700; color: #fff; line-height: 1.2; }
.hero-subtitle { color: #d8d8d8; font-size: 1.1rem; max-width: 600px; }

.glass-card {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: var(--transition-base);
}
[data-bs-theme="dark"] .glass-card { background: rgba(30,33,38,0.6); border-color: rgba(255,255,255,.08); }
.glass-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,.14); }

.stat-card, .counter-box { padding: 1.5rem 1rem; text-align: center; }
.stat-icon, .counter-icon { font-size: 2rem; color: var(--buu-yellow-dark); margin-bottom: .5rem; display: block; }
.stat-number, .counter-number { font-size: 2rem; font-weight: 700; font-family: 'Kanit', sans-serif; }
.stat-label, .counter-label { color: var(--text-muted); font-size: .9rem; }

.section-title {
  font-weight: 700; position: relative; padding-bottom: .75rem; margin-bottom: 1.5rem;
}
.section-title::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 60px; height: 4px;
  background: linear-gradient(90deg, var(--buu-yellow), var(--buu-yellow-dark)); border-radius: 4px;
}
.text-center.section-title::after { left: 50%; transform: translateX(-50%); }

.news-card {
  background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-soft); height: 100%; transition: var(--transition-base);
}
.news-card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(0,0,0,.14); }
.news-card-img { position: relative; height: 190px; overflow: hidden; }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.news-card:hover .news-card-img img { transform: scale(1.08); }
.news-badge {
  position: absolute; top: 12px; left: 12px; background: var(--buu-yellow); color: #212529;
  font-size: .75rem; font-weight: 600; padding: .25rem .75rem; border-radius: 50px;
}
.news-card-body { padding: 1.25rem; }
.news-card-title { font-weight: 600; font-size: 1.05rem; margin-bottom: .5rem; line-height: 1.4; }
.news-card-excerpt { color: var(--text-muted); font-size: .9rem; }
.news-read-more { color: var(--buu-yellow-dark); font-weight: 600; font-size: .9rem; }
.news-read-more:hover { text-decoration: underline; }

.team-card { text-align: center; }
.team-photo {
  width: 130px; height: 130px; object-fit: cover; border-radius: 50%;
  border: 4px solid var(--buu-yellow); box-shadow: var(--shadow-soft);
}

.gallery-thumb { display: block; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 1/1; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-thumb:hover img { transform: scale(1.1); }

.quick-link-card {
  display: block; background: var(--bg-card); border-radius: var(--radius-lg); padding: 2rem 1rem;
  box-shadow: var(--shadow-soft); color: var(--text-main); transition: var(--transition-base);
}
.quick-link-card i { font-size: 2.2rem; color: var(--buu-yellow-dark); margin-bottom: .75rem; display: block; }
.quick-link-card:hover { transform: translateY(-5px); color: var(--buu-yellow-dark); }

.video-wrapper { max-width: 800px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-soft); }

.site-footer { background: #1c1f24; color: #d8d8d8; }
.footer-links a { color: #b8b8b8; display: block; margin-bottom: .5rem; }
.footer-links a:hover { color: var(--buu-yellow); }
.social-btn {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); color: #fff; transition: var(--transition-base);
}
.social-btn:hover { background: var(--buu-yellow); color: #212529; }
.footer-bottom { background: #16181c; }

.scroll-top-btn {
  position: fixed; bottom: 90px; right: 24px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--buu-yellow); border: none; color: #212529; box-shadow: var(--shadow-soft);
  display: none; align-items: center; justify-content: center; z-index: 999; transition: var(--transition-base);
}
.scroll-top-btn.show { display: flex; }
.scroll-top-btn:hover { transform: translateY(-3px); }

.ai-chat-toggle {
  position: fixed; bottom: 24px; right: 24px; width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--buu-yellow), var(--buu-yellow-dark)); border: none;
  color: #212529; box-shadow: 0 8px 24px rgba(249,178,51,.5); z-index: 1000; animation: pulse-ai 2.5s infinite;
}
@keyframes pulse-ai { 0%,100%{box-shadow:0 8px 24px rgba(249,178,51,.5);} 50%{box-shadow:0 8px 24px rgba(249,178,51,.9);} }
.ai-chat-box {
  position: fixed; bottom: 92px; right: 24px; width: 340px; max-width: 90vw; height: 440px;
  background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: 0 16px 40px rgba(0,0,0,.25);
  display: flex; flex-direction: column; overflow: hidden; z-index: 1000;
}
.ai-chat-header { background: var(--buu-gray-dark); color: #fff; padding: .9rem 1rem; display: flex; align-items: center; font-weight: 600; }
.ai-chat-messages { flex: 1; padding: 1rem; overflow-y: auto; font-size: .9rem; }
.ai-msg { padding: .6rem .9rem; border-radius: 14px; margin-bottom: .6rem; max-width: 85%; }
.ai-msg-bot { background: #F1F1F2; color: #222; }
[data-bs-theme="dark"] .ai-msg-bot { background: #2a2d33; color: #eee; }
.ai-msg-user { background: var(--buu-yellow); color: #212529; margin-left: auto; }
.ai-chat-input { display: flex; border-top: 1px solid var(--border-soft); }
.ai-chat-input input { flex: 1; border: none; padding: .8rem; outline: none; background: transparent; color: var(--text-main); }
.ai-chat-input button { border: none; background: var(--buu-yellow); color: #212529; padding: 0 1.1rem; }

.login-page { min-height: 100vh; background: linear-gradient(135deg,#2b2f36,#43484f); }
.login-card { width: 400px; max-width: 92vw; padding: 2.5rem; }
.login-logo { width: 60px; }

.admin-body { background: var(--bg-body); }
.admin-topbar { background: var(--bg-card); box-shadow: 0 2px 10px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 100; }
.admin-layout { display: flex; min-height: calc(100vh - 56px); }
.admin-sidebar {
  width: 250px; background: var(--buu-gray-dark); color: #fff; flex-shrink: 0; transition: var(--transition-base);
}
.sidebar-nav .nav-link { color: #c9ccd1; padding: .75rem 1.25rem; display: flex; align-items: center; gap: .6rem; border-left: 3px solid transparent; }
.sidebar-nav .nav-link:hover, .sidebar-nav .nav-link.active { background: rgba(249,178,51,.12); color: var(--buu-yellow); border-left-color: var(--buu-yellow); }
.admin-content { flex: 1; padding: 1.75rem; min-width: 0; }

@media (max-width: 991.98px) {
  .admin-sidebar { position: fixed; left: -260px; top: 56px; bottom: 0; z-index: 200; }
  .admin-sidebar.show { left: 0; }
}

.skeleton { background: linear-gradient(90deg,#eee 25%,#f5f5f5 50%,#eee 75%); background-size: 200% 100%; animation: skeleton-loading 1.4s infinite; border-radius: 8px; }
@keyframes skeleton-loading { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

[data-aos] { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
[data-aos].aos-in { opacity: 1; transform: translateY(0); }

@media (max-width: 767.98px) {
  .hero-title { font-size: 2rem; }
  .admin-content { padding: 1rem; }
}
