/* OR SWU Theme CSS - Green Color Palette */

:root {
  /* Primary Color Palette */
  --primary-green-dark: #328e6e; /* เขียวเข้ม - สำหรับ buttons หลัก, headers */
  --primary-green: #67ae6e; /* เขียวกลาง - สำหรับ navigation, accents */
  --primary-green-light: #90c67c; /* เขียวอ่อน - สำหรับ hover states */
  --primary-green-pale: #e1eebc; /* เขียวอ่อนมาก - สำหรับ backgrounds */

  /* Semantic Colors */
  --success-color: var(--primary-green);
  --success-bg: var(--primary-green-pale);
  --primary-color: var(--primary-green-dark);
  --primary-hover: var(--primary-green-light);
  --background-subtle: var(--primary-green-pale);

  /* Gradients */
  --gradient-primary: linear-gradient(
    135deg,
    var(--primary-green-dark) 0%,
    var(--primary-green) 100%
  );
  --gradient-light: linear-gradient(
    135deg,
    var(--primary-green) 0%,
    var(--primary-green-light) 100%
  );
  --gradient-background: linear-gradient(
    135deg,
    var(--primary-green-pale) 0%,
    #f8fffe 100%
  );

  /* Text Colors */
  --text-on-primary: #ffffff;
  --text-primary: var(--primary-green-dark);
  --text-secondary: #4a5568;
  --text-muted: #718096;

  /* Border Colors */
  --border-primary: var(--primary-green);
  --border-light: var(--primary-green-light);
  --border-subtle: rgba(50, 142, 110, 0.2);
}

/* Background Utilities */
.bg-primary {
  background-color: var(--primary-green-dark) !important;
}
.bg-primary-light {
  background-color: var(--primary-green) !important;
}
.bg-primary-lighter {
  background-color: var(--primary-green-light) !important;
}
.bg-primary-pale {
  background-color: var(--primary-green-pale) !important;
}

.bg-gradient-primary {
  background: var(--gradient-primary) !important;
}
.bg-gradient-light {
  background: var(--gradient-light) !important;
}
.bg-gradient-background {
  background: var(--gradient-background) !important;
}

/* Text Color Utilities */
.text-primary {
  color: var(--primary-green-dark) !important;
}
.text-primary-light {
  color: var(--primary-green) !important;
}
.text-primary-lighter {
  color: var(--primary-green-light) !important;
}
.text-on-primary {
  color: var(--text-on-primary) !important;
}

/* Border Utilities */
.border-primary {
  border-color: var(--primary-green-dark) !important;
}
.border-primary-light {
  border-color: var(--primary-green) !important;
}
.border-primary-lighter {
  border-color: var(--primary-green-light) !important;
}

/* Button Styles */
.btn-primary-theme {
  background: var(--gradient-primary);
  color: var(--text-on-primary);
  border: none;
  padding: 0.375rem 1rem; /* py-1.5 px-4 - ลดขนาดลง */
  border-radius: 6px; /* ลดขนาด border radius */
  font-weight: 600;
  font-size: 0.875rem; /* text-sm */
  line-height: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(50, 142, 110, 0.15);
  width: 100%; /* w-full */
  display: inline-flex; /* เปลี่ยนเป็น inline-flex เพื่อให้ icon กับ text อยู่ในแนวเดียวกัน */
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.btn-primary-theme:hover {
  background: var(--gradient-light);
  transform: translateY(-1px); /* ลด transform */
  box-shadow: 0 4px 8px rgba(50, 142, 110, 0.2);
}

.btn-secondary-theme {
  background: transparent;
  color: var(--primary-green-dark);
  border: 2px solid var(--primary-green);
  padding: 0.375rem 1rem; /* py-1.5 px-4 - ลดขนาดลง */
  border-radius: 6px; /* ลดขนาด border radius */
  font-weight: 600;
  font-size: 0.875rem; /* text-sm */
  line-height: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%; /* w-full */
  display: inline-flex; /* เปลี่ยนเป็น inline-flex */
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.btn-secondary-theme:hover {
  background: var(--primary-green);
  color: var(--text-on-primary);
  border-color: var(--primary-green-dark);
}

.btn-gray-theme {
  background: #6b7280;
  color: #ffffff;
  border: none;
  padding: 0.375rem 1rem; /* py-1.5 px-4 - ลดขนาดลง */
  border-radius: 6px; /* ลดขนาด border radius */
  font-weight: 600;
  font-size: 0.875rem; /* text-sm */
  line-height: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(107, 114, 128, 0.15);
  width: 100%; /* w-full */
  display: inline-flex; /* เปลี่ยนเป็น inline-flex */
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.btn-gray-theme:hover {
  background: #4b5563;
  transform: translateY(-1px); /* ลด transform */
  box-shadow: 0 4px 8px rgba(107, 114, 128, 0.2);
}

/* Input Styles */
.input-theme {
  border: 2px solid rgba(50, 142, 110, 0.2);
  border-radius: 8px;
  padding: 10px 14px 10px 30px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #ffffff;
}

.input-theme:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(50, 142, 110, 0.1);
}

/* Input Icon Container */
.input-icon-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-left: 10px;
  pointer-events: none;
}

/* Card Styles */
.card-theme {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(50, 142, 110, 0.1);
  overflow: hidden;
}

.card-header-theme {
  background: var(--gradient-primary);
  color: var(--text-on-primary);
  padding: 16px;
  text-align: center;
}

.card-body-theme {
  padding: 20px;
}

/* Alert Styles */
.alert-success-theme {
  background: var(--success-bg);
  border: 1px solid var(--primary-green-light);
  color: var(--primary-green-dark);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.alert-info-theme {
  background: rgba(50, 142, 110, 0.05);
  border: 1px solid rgba(50, 142, 110, 0.2);
  color: var(--primary-green-dark);
  padding: 10px 14px;
  font-size: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* Navigation Styles */
.nav-theme {
  background: var(--gradient-primary);
  box-shadow: 0 2px 4px rgba(50, 142, 110, 0.2);
}

.nav-link-theme {
  color: var(--text-on-primary);
  padding: 12px 16px;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s ease;
  margin: 0 4px;
}

.nav-link-theme:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-on-primary);
}

/* Table Styles */
.table-theme {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-theme th {
  background: var(--primary-green-pale);
  color: var(--primary-green-dark);
  padding: 16px;
  text-align: left;
  font-weight: 600;
}

.table-theme td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(50, 142, 110, 0.1);
}

.table-theme tr:hover {
  background: rgba(50, 142, 110, 0.02);
}

/* Utility Classes */
.shadow-theme {
  box-shadow: 0 4px 6px rgba(50, 142, 110, 0.1);
}

.shadow-theme-lg {
  box-shadow: 0 8px 25px rgba(50, 142, 110, 0.15);
}

.rounded-theme {
  border-radius: 8px;
}

.rounded-theme-lg {
  border-radius: 12px;
}

/* Responsive adjustments */
@media (min-width: 640px) {
  .btn-primary-theme,
  .btn-secondary-theme,
  .btn-gray-theme {
    padding: 0.5rem 1rem; /* sm:py-2 px-4 - ลดขนาดลง */
    font-size: 0.875rem; /* เก็บขนาด text-sm */
    line-height: 1.25rem;
  }
}

@media (min-width: 768px) {
  .btn-primary-theme,
  .btn-secondary-theme,
  .btn-gray-theme {
    /* width: auto; /* md:w-auto */ */
  }
}

.form-input-compact {
  max-width: 24rem; /* Adjust as needed - 24rem is max-w-sm */
  width: 100%; /* Ensure it fills its grid cell up to max-width */
}

/* You might also want a slightly wider one for some fields */
.form-input-medium {
  max-width: 32rem; /* Adjust as needed - 32rem is max-w-md */
  width: 100%;
}

/* Ensure textareas also behave well if they need to be constrained,
   though often they are better full-width within their column. 
   If you want to constrain them, you could add this class too. */
textarea.form-input-compact {
  max-width: 24rem;
  width: 100%;
}

textarea.form-input-medium {
  max-width: 32rem;
  width: 100%;
}

/* Staff Color Classes - สีแบคกราวด์สำหรับ Staff แต่ละคน */
.staff-color-0 {
  background-color: #d32f2f;
  color: #ffffff;
} /* อ.ฐิติณัฐ - แดงเข้ม */
.staff-color-1 {
  background-color: #388e3c;
  color: #ffffff;
} /* อ.ภรัณยู - เขียวเข้ม */
.staff-color-2 {
  background-color: #1976d2;
  color: #ffffff;
} /* อ.ชนกันต์ - น้ำเงินเข้ม */
.staff-color-3 {
  background-color: #f57c00;
  color: #ffffff;
} /* อ.วิศิษฐ์ - ส้มเข้ม */
.staff-color-4 {
  background-color: #7b1fa2;
  color: #ffffff;
} /* อ.ยิ่งยง - ม่วงเข้ม */
.staff-color-5 {
  background-color: #00796b;
  color: #ffffff;
} /* อ.ปวริศร - เขียวน้ำใสเข้ม */
.staff-color-6 {
  background-color: #fbc02d;
  color: #000000;
} /* อ.ณัฐกร - เหลืองเข้ม */
.staff-color-7 {
  background-color: #c2185b;
  color: #ffffff;
} /* อ.คมสัน - ชมพูเข้ม */
.staff-color-8 {
  background-color: #0288d1;
  color: #ffffff;
} /* อ.ศุภกิจ - ฟ้าเข้ม */
.staff-color-9 {
  background-color: #689f38;
  color: #ffffff;
} /* อ.ชัชวาลย์ - เขียวใบไม้เข้ม */
.staff-color-10 {
  background-color: #ff8f00;
  color: #ffffff;
} /* อ.ธนา - ส้มทองเข้ม */
.staff-color-11 {
  background-color: #303f9f;
  color: #ffffff;
} /* อ.นิคม - คราม */
.staff-color-12 {
  background-color: #5d4037;
  color: #ffffff;
} /* อ.วิทวัส - น้ำตาลเข้ม */
.staff-color-13 {
  background-color: #455a64;
  color: #ffffff;
} /* อ.ชาญณรงค์ - เทาเข้ม */

/* Staff Color Classes with padding and border radius for better display */
.staff-badge {
  padding: 6px 12px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-block;
  text-align: center;
  min-width: 70px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.staff-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
