@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

:root {
  --primary-color: #8B0000;    
  --primary-hover: #660000;    
  --accent-color: #B22222;     
  --bg-color: #f4f6f8;
  --text-dark: #333;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --card-shadow: 0 4px 15px rgba(139, 0, 0, 0.08);
  --font-main: 'Sarabun', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
  font-family: var(--font-main); 
  background-color: var(--bg-color); 
  color: var(--text-dark); 
  line-height: 1.5;
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-theme { color: var(--primary-color) !important; }
.text-muted { color: var(--text-muted); }
.text-danger { color: #dc3545; }
.text-success { color: #198754; }
.text-warning { color: #ffc107; }
.fw-bold { font-weight: 700; }
.w-100 { width: 100%; }
.cursor-pointer { cursor: pointer; }
.small { font-size: 0.875rem; }
.fs-1 { font-size: 2.5rem; }
.fs-5 { font-size: 1.25rem; }

/* Flexbox Layouts */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Spacing */
.p-2 { padding: 0.5rem; } .p-3 { padding: 1rem; } .p-4 { padding: 1.5rem; }
.m-0 { margin: 0; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; }

/* Components */
.app-container { 
  max-width: 600px; 
  margin: 0 auto; 
  min-height: 100vh; 
  background: white; 
  box-shadow: 0 0 20px rgba(0,0,0,0.05); 
  position: relative; 
}

.app-navbar { 
  background: linear-gradient(135deg, #8B0000 0%, #B22222 100%); 
  color: white; 
  padding: 1rem 1.5rem; 
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Forms & Buttons */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; font-weight: bold; }
.form-control, .form-select { 
  width: 100%; 
  padding: 0.75rem 1rem; 
  border: 1px solid var(--border-color); 
  border-radius: 8px; 
  font-family: inherit; 
  font-size: 1rem;
  transition: border-color 0.2s;
}
.form-control:focus, .form-select:focus { outline: none; border-color: var(--primary-color); }

.btn { 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem; 
  border: none; 
  border-radius: 8px; 
  cursor: pointer; 
  font-family: inherit; 
  font-weight: 700; 
  font-size: 1rem;
  transition: all 0.2s; 
}
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-light { background-color: #f8f9fa; color: var(--text-dark); border: 1px solid var(--border-color); }
.btn-light:hover { background-color: #e2e6ea; }
.btn-outline { background: transparent; border: 1px dashed var(--primary-color); color: var(--primary-color); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }

/* Cards & Badges */
.card-theme { 
  border: 1px solid var(--border-color); 
  border-radius: 12px; 
  background: white; 
  box-shadow: var(--card-shadow); 
  padding: 1rem;
  margin-bottom: 1rem; 
}
.card-highlight { 
  background: linear-gradient(135deg, #8B0000 0%, #A52A2A 100%); 
  color: white; 
  border-radius: 12px; 
  padding: 1.5rem; 
  text-align: center; 
  margin-bottom: 1.5rem; 
}
.badge { 
  padding: 0.25rem 0.75rem; 
  border-radius: 50px; 
  font-size: 0.75rem; 
  font-weight: bold; 
}
.badge-white { background: rgba(255,255,255,0.9); color: var(--text-dark); }
.badge-warning { background: #ffc107; color: #000; }
.badge-success { background: #198754; color: #fff; }
.badge-info { background: #0dcaf0; color: #000; }
.badge-secondary { background: #6c757d; color: #fff; }

/* Modals */
.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: 1000; 
}
.modal-content { 
  background: white; 
  width: 90%; max-width: 500px; 
  border-radius: 12px; 
  overflow: hidden; 
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-header { 
  padding: 1rem 1.5rem; 
  background: var(--primary-color); 
  color: white; 
  display: flex; justify-content: space-between; align-items: center; 
}
.modal-body { padding: 1.5rem; overflow-y: auto; }
.btn-close { background: transparent; border: none; color: white; cursor: pointer; font-size: 1.2rem; }

/* Tabs */
.tabs { display: flex; background: #f1f3f5; border-radius: 50px; padding: 0.25rem; margin-bottom: 1rem; }
.tab-btn { flex: 1; text-align: center; padding: 0.5rem; border: none; background: transparent; border-radius: 50px; cursor: pointer; font-family: inherit; font-weight: bold; color: var(--text-muted); }
.tab-btn.active { background: white; color: var(--primary-color); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.tab-content { display: none; }
.tab-content.active { display: block; }

#loader { 
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  background: rgba(255,255,255,0.95); z-index: 9999; 
  display: flex; flex-direction: column; justify-content: center; align-items: center; 
}