/* ==========================================================
   FONT ELEMENTS
   ========================================================== */

@font-face {
  font-family: "Bai Jamjuree";
  src: url('./fonts/Bai_Jamjuree/BaiJamjuree-Light.ttf')
}

/* ==========================================================
   GLOBAL RESET & BASE STYLES
   ========================================================== */
* {
  box-sizing: border-box;
}

body {
/*  font-family: Arial, sans-serif;*/
  font-family: "Bai Jamjuree", sans-serif;
  font-weight: 300;
  font-style: normal;
  background-color: #f6f8fa;
  margin: 0;
  padding: 0;
  color: #2c3e50;
}

h1, h2, h3, h4 {
  font-family: "Bai Jamjuree", sans-serif;
  font-weight: 700;
  font-style: bold;
  margin: 0 0 10px 0;
}

/* ==========================================================
   COMMON ELEMENTS
   ========================================================== */
.container {
  min-width: 400px;
  margin: 30px auto;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.dialog {
  max-width: 400px;
  margin: 30px auto;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

input, select, button, textarea {
  font-family: "Bai Jamjuree", sans-serif;
  font-weight: 300;
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

button {
  font-family: "Bai Jamjuree", sans-serif;
  font-weight: 300;  
  background-color: #007bff;
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
  padding: 10px 20px;
  border-radius: 5px;
}

button:hover {
  background-color: #0056b3;
}

/* Message alerts */
.alert {
  background-color: #ffdddd;
  border-left: 6px solid #f44336;
  padding: 10px;
  margin-bottom: 15px;
}

.success {
  background-color: #ddffdd;
  border-left: 6px solid #4CAF50;
}

.message {
  text-align: center;
  color: green;
  margin-bottom: 10px;
}

/* ==========================================================
   LINKS
   ========================================================== */
.link {
  text-align: center;
  display: block;
  margin-top: 10px;
}

/* ==========================================================
   DASHBOARD LAYOUT
   ========================================================== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background-color: rgba(128,0,0,1);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-header img {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
}

.sidebar a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: background 0.2s;
}

.sidebar a:hover {
  background-color: rgba(255,255,255,0.1);
}

.sidebar a.active {
  background-color: rgba(255,255,255,0.25);
}

.sidebar-footer {
  text-align: center;
  padding: 15px;
  font-size: 0.85em;
  background-color: rgba(0,0,0,0.2);
}

.main-content {
  flex: 1;
  padding: 30px;
  background-color: #f4f6f9;
}

.top-bar {
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 20px;
  border-bottom: 2px solid #007bff;
  padding-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================
   LOGO SECTION (for login/register pages)
   ========================================================== */
.logo {
  text-align: center;
  margin-bottom: 20px;
}

.logo img {
  width: 120px;
  height: 120px;
}

.logo h1 {
  font-size: 1.4rem;
  margin-top: 10px;
  color: #2c3e50;
}

/* ==========================================================
   PROFILE PAGE - FORM SECTIONS
   ========================================================== */
.section-title {
  font-weight: bold;
  font-size: 1.2em;
  margin-top: 20px;
  margin-bottom: 10px;
  color: #007bff;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
}

/* ==========================================================
   TABS (Profile Info / Change Password)
   ========================================================== */
.tabs {
  display: flex;
  border-bottom: 2px solid #ddd;
  margin-bottom: 15px;
}

.tab-button {
  padding: 10px 20px;
  cursor: pointer;
  background: #f4f4f4;
  border: none;
  border-right: 1px solid #ddd;
  font-weight: bold;
  color: #333;
  transition: background 0.2s;
}

.tab-button:last-child {
  border-right: none;
}

.tab-button.active {
  background: #007bff;
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .main-content {
    padding: 15px;
  }
}

/* ==========================================================
   DARK MODE SUPPORT
   ========================================================== */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode .alert {
    background-color: #331a1a; /* darker red tone for dark mode */
    border-left: 6px solid #f88;
    color: #f5f5f5; /* light text for contrast */
}

body.dark-mode .container,
body.dark-mode .dialog,
body.dark-mode .main-content,
body.dark-mode .card {
  background-color: #1e1e1e;
  color: #e0e0e0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

body.dark-mode .sidebar {
  background-color: rgba(30,30,30,1);
  color: #e0e0e0;
}

body.dark-mode .sidebar a {
  color: #e0e0e0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.dark-mode .sidebar a:hover {
  background-color: rgba(255,255,255,0.1);
}

body.dark-mode .sidebar-footer {
  background-color: rgba(0,0,0,0.5);
}

body.dark-mode .top-bar {
  color: #e0e0e0;
  border-bottom-color: #555;
}

body.dark-mode .section-title {
  color: #66aaff;
  border-bottom: 1px solid #444;
}

body.dark-mode .tab-button {
  background: #333;
  color: #ccc;
  border-right: 1px solid #444;
}

body.dark-mode .tab-button.active {
  background: #007bff;
  color: white;
}

body.dark-mode button {
  background-color: #007bff;
  color: white;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background-color: #2c2c2c;
  color: #e0e0e0;
  border: 1px solid #555;
}

/* ==========================================================
   DARK MODE TOGGLE BUTTON
   ========================================================== */
#darkModeToggle {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  transition: 0.3s;
  font-size: 0.9em;
  width: auto;
}

#darkModeToggle:hover {
  background: #0056b3;
}
/* ==========================================================
    Dashboard cards 
   ========================================================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.dashboard-cards .card { 
    background:white; 
    border-radius:10px; 
    padding:20px; 
    box-shadow:0 2px 6px rgba(0,0,0,0.1); 
    text-align:center;
}
.card h2 { font-size:2rem; margin:0; color:#007bff; }
.card p { margin:5px 0 0; font-weight:bold; }
.card { 
    background:white; 
    border-radius:10px; 
    padding:20px; 
    box-shadow:0 2px 6px rgba(0,0,0,0.1); 
}