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

:root {
  /* Light Mode (Chinese Minimalist Pop) */
  --primary-color: #E62429; /* Chinese Red */
  --primary-hover: #C51F24;
  --bg-color: #FAFAFA; /* Clean White */
  --surface-color: #FFFFFF;
  --text-primary: #212121;
  --text-secondary: #757575;
  --border-color: #EEEEEE;
  --shadow-sm: 0 2px 8px rgba(230, 36, 41, 0.08);
  --shadow-md: 0 4px 16px rgba(230, 36, 41, 0.12);
  --gold-accent: #F4B400; /* Subtle gold accent for Chinese vibe */
}

[data-theme="dark"] {
  /* Dark Mode (Modern Clean with Red Accent) */
  --bg-color: #121212;
  --surface-color: #1E1E1E;
  --text-primary: #F5F5F5;
  --text-secondary: #AAAAAA;
  --border-color: #333333;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Prompt', sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: 'Sarabun', sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-color);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  word-break: break-word;
  overflow-wrap: break-word;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  padding-top: 4px; /* Prevent Thai upper vowels from being cut off */
}

p, span, div {
  overflow-wrap: break-word;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 8px 22px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* Footer Styles */
.footer {
  background-color: #F8E6E5;
  margin-top: auto;
  border-top: 2px solid var(--primary-color);
}

[data-theme="dark"] .footer {
  background-color: #1a1010;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1.2fr;
  gap: 30px;
  padding: 60px 20px 40px;
}

.footer-brand p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 300px;
}

[data-theme="dark"] .footer-brand p,
[data-theme="dark"] .footer-contact p {
  color: #aaa;
}

.footer-links h3, .footer-contact h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: #555;
  font-size: 0.95rem;
  transition: color 0.2s;
}

[data-theme="dark"] .footer-links a {
  color: #aaa;
}

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

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary-color);
  font-size: 1.2rem;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .social-links a {
  background: var(--surface-color);
}

.social-links a:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-3px);
}

.footer-bottom {
  background: rgba(0,0,0,0.05);
  padding: 20px 0;
  text-align: center;
  color: #777;
  font-size: 0.85rem;
  font-weight: 500;
}

[data-theme="dark"] .footer-bottom {
  background: rgba(0,0,0,0.2);
  color: #888;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* Custom Validation Modal Styles (Global) */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.custom-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.custom-modal {
  background: var(--surface-color);
  width: 90%;
  max-width: 400px;
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  transform: translateY(-20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid var(--border-color);
}

.custom-modal-overlay.show .custom-modal {
  transform: translateY(0);
}

.modal-icon {
  font-size: 3.5rem;
  color: #ff4757;
  margin-bottom: 20px;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
}

.modal-title {
  color: var(--text-primary);
  font-size: 1.4rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.modal-message {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 25px;
  line-height: 1.5;
}

.modal-close-btn {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  font-size: 1.05rem;
  cursor: pointer;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-weight: 600;
  transition: background 0.3s ease;
}

.modal-close-btn:hover {
  background: #c01e23;
}

/* SweetAlert2 Dark Mode Override */
[data-theme="dark"] .swal2-popup {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
[data-theme="dark"] .swal2-title, 
[data-theme="dark"] .swal2-html-container {
    color: var(--text-primary);
}
[data-theme="dark"] .swal2-success-circular-line-left,
[data-theme="dark"] .swal2-success-circular-line-right,
[data-theme="dark"] .swal2-success-fix {
    background-color: var(--surface-color) !important;
}
[data-theme="dark"] .swal2-confirm.swal2-styled {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}
[data-theme="dark"] .swal2-cancel.swal2-styled {
    background-color: var(--surface-color) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}