/* ============================================================
   style.css — TUSWA Website
   GitHub Pages version
============================================================ */

/* --- Variables --- */
:root {
  --tu-claret:  #800020;
  --tu-gold:    #D4AF37;
  --slate-gray: #4A4A4A;
  --off-white:  #F9F9F9;
  --text-dark:  #333333;
}

/* --- Base --- */
body {
  font-family: 'Sarabun', sans-serif;
  background-color: var(--off-white);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar { background-color: var(--tu-claret); padding: 1rem 0; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.navbar-brand img { height: 50px; margin-right: 12px; background: white; border-radius: 50%; padding: 2px; }
.navbar-brand-text-main { color: white; font-weight: 700; font-size: 1rem; letter-spacing: .5px; }
.navbar-brand-text-sub  { color: rgba(255,255,255,.7); font-size: .7rem; font-weight: 300; letter-spacing: 1px; }

.nav-link { color: rgba(255,255,255,.85) !important; font-weight: 500; margin-left: 10px; transition: all .3s; }
.nav-link:hover, .nav-link.active { color: var(--tu-gold) !important; }

.dropdown-menu { border: none; border-top: 3px solid var(--tu-gold); box-shadow: 0 10px 30px rgba(0,0,0,.1); border-radius: 0 0 8px 8px; }
.dropdown-item { padding: 10px 20px; color: var(--slate-gray); font-weight: 500; }
.dropdown-item:hover { background-color: rgba(212,175,55,.1); color: var(--tu-claret); }
.navbar-toggler { border-color: rgba(255,255,255,.5); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================================
   HERO CAROUSEL
============================================================ */
.hero-carousel-item { height: 500px; background-size: cover; background-position: center; position: relative; }
.hero-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 60%, rgba(0,0,0,.78) 100%);
}
.hero-content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; color: white;
}
.hero-title    { font-weight: 700; letter-spacing: 2px; text-shadow: 2px 2px 6px rgba(0,0,0,.6); }
.hero-subtitle { color: var(--tu-gold); font-weight: 300; letter-spacing: 3px; text-shadow: 1px 1px 3px rgba(0,0,0,.6); }

/* ============================================================
   BUTTONS
============================================================ */
.btn-gold { background-color: var(--tu-gold); color: white; border: none; transition: .3s; }
.btn-gold:hover { background-color: #bfa03a; color: white; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(212,175,55,.4); }
.btn-outline-gold { border: 2px solid var(--tu-gold); color: var(--tu-gold); background: transparent; font-weight: 600; }
.btn-outline-gold:hover { background-color: var(--tu-gold); color: white; }

/* ============================================================
   CARDS
============================================================ */
.page-title {
  color: var(--tu-claret); font-weight: 700; margin-bottom: 40px;
  padding-bottom: 15px; position: relative; display: inline-block;
}
.page-title::after {
  content: ''; width: 60px; height: 3px;
  background: var(--tu-gold);
  position: absolute; bottom: 0; left: 0;
}
.card-modern {
  border: none; background: white; border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0,0,0,.05); transition: .3s; height: 100%;
}
.card-modern:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,.1); }

.border-top-gold   { border-top:  5px solid var(--tu-gold)   !important; }
.border-top-claret { border-top:  5px solid var(--tu-claret) !important; }
.border-left-gold  { border-left: 5px solid var(--tu-gold)   !important; }
.border-left-claret{ border-left: 5px solid var(--tu-claret) !important; }

/* ============================================================
   COMMITTEE
============================================================ */
.committee-img-container { height: 260px; overflow: hidden; background: #eee; border-radius: 8px 8px 0 0; }
.committee-img-container img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: grayscale(20%); transition: .3s; }
.card-modern:hover .committee-img-container img { filter: grayscale(0%); transform: scale(1.05); }

/* ============================================================
   STAT CARDS
============================================================ */
.stat-card {
  border-radius: 2rem; padding: 2rem; color: white;
  position: relative; overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,.15); transition: transform .3s; border: none; height: 100%;
}
.stat-card:hover { transform: translateY(-10px); }
.stat-bg-red   { background: linear-gradient(135deg,#b91c1c 0%,#7f1d1d 100%); }
.stat-bg-blue  { background: linear-gradient(135deg,#1d4ed8 0%,#1e3a8a 100%); }
.stat-bg-green { background: linear-gradient(135deg,#059669 0%,#064e3b 100%); }
.stat-bg-gold  { background: linear-gradient(135deg,#b7860e 0%,#7c5a08 100%); }

.stat-title  { font-size: .9rem; font-weight: 700; text-transform: uppercase; opacity: .9; letter-spacing: 1px; }
.stat-number { font-size: 3.5rem; font-weight: 800; line-height: 1; margin-top: .5rem; }
.stat-unit   { font-size: 1rem; font-weight: 400; opacity: .85; margin-left: 4px; }
.stat-icon   { position: absolute; right: -10px; bottom: -10px; font-size: 8rem; opacity: .15; transform: rotate(-15deg); }

/* ============================================================
   NEWS
============================================================ */
.news-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}
.news-search-wrap {
  background: white; border-radius: 12px; padding: 1rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06); margin-bottom: 1.5rem;
}
.news-filter-btn {
  border: 1.5px solid #dee2e6; background: transparent; border-radius: 20px;
  padding: 4px 14px; font-size: .82rem; font-family: 'Sarabun', sans-serif;
  cursor: pointer; transition: .2s; color: var(--slate-gray);
}
.news-filter-btn:hover,
.news-filter-btn.active { background: var(--tu-claret); border-color: var(--tu-claret); color: white; }

/* ============================================================
   BACK TO TOP
============================================================ */
#back-to-top {
  position: fixed; bottom: 2rem; right: 1.5rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--tu-claret); color: white; border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s; transform: translateY(10px); z-index: 1050;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
#back-to-top:hover   { background: #9a0026; transform: translateY(-2px); }

/* ============================================================
   LOADING (Branded)
============================================================ */
#loading {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--off-white); z-index: 9999;
  display: flex; justify-content: center; align-items: center; flex-direction: column;
}
.loading-logo {
  width: 80px; height: 80px; border-radius: 50%;
  background: white; padding: 8px;
  box-shadow: 0 4px 20px rgba(128,0,32,.15); margin-bottom: 1.5rem;
  animation: pulse-logo 1.8s ease-in-out infinite;
}
.loading-bar-wrap { width: 200px; height: 3px; background: #e0e0e0; border-radius: 2px; margin-top: 1rem; overflow: hidden; }
.loading-bar { height: 100%; background: linear-gradient(90deg,var(--tu-claret),var(--tu-gold)); border-radius: 2px; animation: loading-progress 1.8s ease-in-out infinite; }

@keyframes pulse-logo {
  0%,100% { transform: scale(1); box-shadow: 0 4px 20px rgba(128,0,32,.15); }
  50%      { transform: scale(1.05); box-shadow: 0 6px 28px rgba(128,0,32,.25); }
}
@keyframes loading-progress {
  0%   { width: 0%;  margin-left: 0; }
  50%  { width: 80%; margin-left: 0; }
  100% { width: 0%;  margin-left: 100%; }
}

/* ============================================================
   MODAL
============================================================ */
#newsModalDesc a       { color: var(--tu-claret); font-weight: bold; text-decoration: underline; }
#newsModalDesc a:hover { color: var(--tu-gold); }

/* ============================================================
   FOOTER
============================================================ */
footer { background-color: var(--slate-gray); }

/* ============================================================
   PAGE TRANSITIONS
============================================================ */
.app-page         { display: none; animation: fadeIn .5s ease-out; }
.app-page.active  { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ============================================================
   HISTORY TIMELINE
============================================================ */
.timeline-line { border-left: 3px solid var(--tu-claret); }
.timeline-dot  {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid white; display: flex; align-items: center; justify-content: center;
  position: absolute; left: -1.15rem;
}
