@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
  --primary-red: #d32f2f;
  --primary-dark: #b71c1c;
  --primary-gradient: linear-gradient(135deg, #e53935 0%, #b71c1c 100%);
  --bg-gradient: radial-gradient(at 0% 0%, #eef5fc 0, transparent 50%), radial-gradient(at 100% 100%, #d8e8f8 0, transparent 50%), #e3effa;
  --surface-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-base: 'Noto Sans Lao', 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-base);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.main-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}

.logo-text h2 {
  color: var(--primary-red);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.logo-text p {
  font-size: 0.75rem;
  color: #0284c7;
  font-weight: 500;
}

.nav-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input {
  border: 1px solid var(--border-color);
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
  width: 160px;
}

.search-input:focus {
  border-color: var(--primary-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
  width: 200px;
}

.social-icons {
  display: flex;
  gap: 6px;
}

.social-icons .icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.social-icons .icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.social-icons .fb { background: #1877f2; }
.social-icons .tw { background: #0ea5e9; }
.social-icons .yt { background: #ff0000; }

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  position: relative;
  padding: 2px 0;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-red);
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: var(--primary-red);
}

.nav-links a:hover::after {
  width: 100%;
}

.main-wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 24px auto;
  padding: 0 20px;
  flex: 1;
}

.top-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
}

.side-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.side-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.side-card h3 {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.side-card .sub-label {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.15);
}

.search-box button {
  width: 100%;
  padding: 10px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
  transition: all 0.2s ease;
}

.search-box button:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 14px rgba(211, 47, 47, 0.4);
  transform: translateY(-1px);
}

.search-box button:active {
  transform: translateY(1px);
}

.side-list {
  list-style: none;
  margin-top: 18px;
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
}

.side-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--border-light);
  color: var(--text-main);
  transition: background-color 0.2s ease;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.side-list li:hover {
  background-color: #f8fafc;
  color: var(--primary-red);
}

.side-list .bullet {
  color: var(--text-muted);
  font-size: 0.6rem;
}

.right-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.banner-placeholder {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  color: #fff;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  gap: 16px;
}

.banner-placeholder::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.banner-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.banner-tel {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.custom-container {
  background: var(--surface-card);
  border: 1px solid rgba(211, 47, 47, 0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.custom-header {
  background: var(--primary-gradient);
  color: #fff;
  text-align: center;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
}

.custom-flag {
  width: 32px;
  height: auto;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.custom-header strong {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.custom-header span {
  font-size: 0.8rem;
  opacity: 0.92;
  font-weight: 400;
}

.custom-numbers {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.custom-numbers div {
  flex: 0 1 54px;
  height: 68px;
  min-width: 44px;
  border: 2px solid #0f172a;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 800;
  color: #0f172a;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), inset 0 -3px 0 rgba(0,0,0,0.08);
  user-select: none;
}

.custom-table {
  width: 90%;
  max-width: 500px;
  margin: 0 auto 24px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.custom-table tr {
  transition: background-color 0.15s ease;
}

.custom-table tr:hover {
  background-color: #f8fafc;
}

.custom-table td {
  padding: 10px 16px;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  text-align: center;
  background: #ffffff;
}

.custom-table td:last-child {
  border-right: none;
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tr td:first-child {
  font-weight: 600;
  width: 50%;
  background: #fdfdfd;
  color: var(--text-main);
}

.custom-table tr td:last-child {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1.05rem;
  letter-spacing: 1px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 28px 0;
}

.news-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  cursor: pointer;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #94a3b8;
}

.news-card .img-box {
  background: #f1f5f9;
  height: 140px; 
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-card .img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}


.news-card:hover .img-box img {
  transform: scale(1.05);
}
.news-card p {
  color: var(--text-main);
  line-height: 1.6;
  font-weight: 500;
}

.history-card {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#history-table {
  width: 100%;
  min-width: 650px;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

#history-table th, 
#history-table td {
  padding: 12px 10px;
  text-align: center;
  font-size: 0.88rem;
}

#history-table th {
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

#history-table th:last-child {
  border-right: none;
}

#history-table td {
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  color: var(--text-main);
  background-color: #fff;
  transition: background-color 0.15s ease;
}

#history-table td:last-child {
  border-right: none;
}

#history-table tbody tr:nth-child(even) td {
  background-color: #f8fafc;
}

#history-table tbody tr:hover td {
  background-color: #edf5fd;
  color: var(--primary-dark);
}

.footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  padding: 24px 0 16px;
  box-shadow: 0 -1px 3px rgba(0,0,0,0.02);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-red);
}

.footer-contact {
  text-align: right;
}

.footer-contact p strong {
  font-size: 1rem;
  color: var(--text-main);
}

.footer-contact p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.copyright {
  width: 100%;
  text-align: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: #94a3b8;
}

@media (max-width: 992px) {
  .top-grid {
    grid-template-columns: 1fr;
  }
  .side-card {
    order: 2;
  }
  .right-content {
    order: 1;
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .nav-right {
    align-items: center;
    width: 100%;
  }
  .top-controls {
    width: 100%;
    justify-content: space-between;
  }
  .search-input {
    flex: 1;
  }
  .nav-links {
    justify-content: center;
    gap: 12px;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  .footer-links {
    justify-content: center;
  }
  .footer-contact {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .main-wrapper {
    padding: 0 12px;
    margin: 14px auto;
  }
  .banner-placeholder {
    flex-direction: column;
    text-align: center;
    padding: 14px;
  }
  .custom-flag {
    position: static;
    transform: none;
    margin-bottom: 4px;
  }
  .custom-header {
    padding: 12px 10px;
  }
  .custom-numbers {
    gap: 6px;
    padding: 16px 8px;
  }
  .custom-numbers div {
    flex: 0 1 42px;
    height: 56px;
    min-width: 36px;
    font-size: 1.5rem;
  }
  .custom-table {
    width: 100%;
  }
  .side-card, .history-card {
    padding: 14px 10px;
  }
}