:root {
  --primary-color: #900C3F;
  /* Dark Red */
  --primary-dark: #581845;
  --secondary-color: #6c757d;
  /* Gray */
  --secondary-light: #e9ecef;
  --text-color: #333;
  --light-bg: #f8f9fa;
  --white: #ffffff;
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

body {
  font-family: 'Prompt', 'Sarabun', sans-serif;
  /* Thai fonts */
  background-color: var(--light-bg);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 5px 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

nav a:hover,
nav a.active {
  color: #ffc107;
  /* Yellowish color for contrast */
  font-weight: 700;
}

main {
  flex-grow: 1;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

footer {
  background-color: var(--primary-dark);
  color: var(--white);
  text-align: center;
  padding: 20px 0;
  margin-top: auto;
}

/* Utilities */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 20px;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1.5rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

/* Responsive Grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

form .form-group {
  margin-bottom: 15px;
}

form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

form input[type="text"],
form input[type="tel"],
form input[type="password"],
form input[type="number"],
form input[type="email"],
form input[type="datetime-local"],
form select,
form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: calc(var(--border-radius) / 2);
  box-sizing: border-box;
  font-family: 'Prompt', sans-serif;
}

form input:focus,
form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(144, 12, 63, 0.25);
}

/* Mobile Navigation */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--white);
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 15px;
    position: relative;
  }

  .menu-toggle {
    display: block;
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  nav.active {
    max-height: 500px;
    /* Sufficient height for all menu items */
  }

  nav ul {
    flex-direction: column;
    gap: 0;
    padding: 10px 0;
  }

  nav ul li {
    width: 100%;
  }

  nav ul li a {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  nav ul li:last-child a {
    border-bottom: none;
  }

  .logo {
    font-size: 1.2rem;
  }
}

/* Toast Notification Styling */
#toast-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  width: auto;
  min-width: 300px;
  max-width: 90%;
}

.toast {
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 12px 25px;
  border-radius: 50px;
  margin-top: 10px;
  font-size: 0.95rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.toast.success {
  background: rgba(40, 167, 69, 0.95);
}

.toast.error {
  background: rgba(220, 53, 69, 0.95);
}

.toast.info {
  background: rgba(23, 162, 184, 0.95);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}