:root {
  --color-primary: #4a9b59;
  --color-primary-light: #daf0e3;
}

/* Custom checkbox styling */
input[type="checkbox"]:checked {
  background-color: #4a9b59;
  border-color: #4a9b59;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

/* Custom animations and transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

/* Grid layout for sticky footer */
html,
body {
  height: 100%;
  margin: 0;
}

body {
  background-color: rgb(249 250 251);
}

.grid-layout {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Improved focus styles for accessibility */
:focus {
  outline: 2px solid rgba(74, 155, 89, 0.5);
  outline-offset: 2px;
}

/* Better responsive tables */
@media (max-width: 640px) {
  .responsive-table th,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table th {
    text-align: left;
    padding-bottom: 0;
  }

  .responsive-table td {
    padding-top: 0.5rem;
    padding-bottom: 1rem;
  }
}

/* Custom loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  margin: 25px auto;
  border-radius: 50%;
  border: 3px solid rgba(74, 155, 89, 0.2);
  border-top-color: rgba(74, 155, 89, 1);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Button hover effects */
button {
  transition: transform 0.1s ease;
}

button:active {
  transform: scale(0.98);
}

/* Input focus state */
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 2px rgba(74, 155, 89, 0.25);
}

/* Card hover effect */
.hover-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
/* Special stylesheet for date/time picker overrides with highest specificity */

/* Flowbite datepicker styling */
.datepicker-cell.selected,
.datepicker-cell.selected:hover {
  background-color: #4a9b59 !important;
  color: white !important;
  border-color: #4a9b59 !important;
}

.datepicker-cell.today:not(.selected) {
  border-color: #4a9b59 !important;
}

.datepicker-cell.focused:not(.selected) {
  background-color: rgba(74, 155, 89, 0.1) !important;
}

/* Safari and Chrome */
input::-webkit-datetime-edit {
  color: #374151 !important;
}

input::-webkit-datetime-edit-fields-wrapper {
  background-color: transparent !important;
}

input::-webkit-datetime-edit-text {
  color: #374151 !important;
  padding: 0 0.2em !important;
}

input::-webkit-datetime-edit-month-field,
input::-webkit-datetime-edit-day-field,
input::-webkit-datetime-edit-year-field,
input::-webkit-datetime-edit-hour-field,
input::-webkit-datetime-edit-minute-field,
input::-webkit-datetime-edit-second-field,
input::-webkit-datetime-edit-millisecond-field,
input::-webkit-datetime-edit-meridiem-field {
  padding: 0 0.2em !important;
}

/* Focus state colors */
input::-webkit-datetime-edit-month-field:focus,
input::-webkit-datetime-edit-day-field:focus,
input::-webkit-datetime-edit-year-field:focus,
input::-webkit-datetime-edit-hour-field:focus,
input::-webkit-datetime-edit-minute-field:focus,
input::-webkit-datetime-edit-second-field:focus,
input::-webkit-datetime-edit-millisecond-field:focus,
input::-webkit-datetime-edit-meridiem-field:focus {
  background-color: rgba(74, 155, 89, 0.2) !important;
  color: #4a9b59 !important;
  outline: none !important;
}

/* Calendar icon */
input::-webkit-calendar-picker-indicator {
  filter: hue-rotate(85deg) brightness(1.1) !important;
  cursor: pointer !important;
}

/* Firefox specific styles */
@-moz-document url-prefix() {
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"] {
    color: #374151 !important;
  }

  input[type="date"]:focus,
  input[type="datetime-local"]:focus,
  input[type="time"]:focus {
    color: #4a9b59 !important;
    box-shadow: 0 0 0 2px rgba(74, 155, 89, 0.2) !important;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Ensure all responsive tables get the proper styling */
table {
  @apply responsive-table;
}

/* Custom scrollbar for better UX */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #c7c7c7;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}

/* Add datepicker styling */
.datepicker-cell.selected,
.datepicker-cell.selected:hover {
  background-color: #4a9b59 !important;
  color: white !important;
}

.datepicker-cell.today:not(.selected) {
  border-color: #4a9b59 !important;
}

/* Add stronger styling for native date/time pickers */
::-webkit-calendar-picker-indicator {
  filter: hue-rotate(85deg) brightness(1.1) !important;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: hue-rotate(85deg) brightness(1.1) !important;
}

/* Override browser defaults for date/time inputs */
input[type="datetime-local"],
input[type="date"],
input[type="time"] {
  color-scheme: light !important;
}

/* Style the date/time picker dropdown */
::-webkit-datetime-edit-fields-wrapper {
  color: #374151 !important;
}

::-webkit-datetime-edit-text {
  color: #374151 !important;
}

::-webkit-datetime-edit-hour-field:focus,
::-webkit-datetime-edit-minute-field:focus,
::-webkit-datetime-edit-second-field:focus,
::-webkit-datetime-edit-ampm-field:focus,
::-webkit-datetime-edit-day-field:focus,
::-webkit-datetime-edit-month-field:focus,
::-webkit-datetime-edit-year-field:focus {
  background-color: rgba(74, 155, 89, 0.2) !important;
  color: #4a9b59 !important;
  outline: none !important;
}

/* Force color for selection highlight */
::selection {
  background-color: rgba(74, 155, 89, 0.2) !important;
  color: #4a9b59 !important;
}

/* Override Chrome's blue highlight */
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="time"]:focus {
  --tw-ring-color: #4a9b59 !important;
  --tw-ring-opacity: 1 !important;
  outline-color: #4a9b59 !important;
}

/* Color for highlighted day in calendar */
input::-webkit-datetime-edit-day-field:focus,
input::-webkit-datetime-edit-month-field:focus,
input::-webkit-datetime-edit-year-field:focus,
input::-webkit-datetime-edit-hour-field:focus,
input::-webkit-datetime-edit-minute-field:focus,
input::-webkit-datetime-edit-second-field:focus,
input::-webkit-datetime-edit-ampm-field:focus {
  background-color: rgba(74, 155, 89, 0.2) !important;
  color: #4a9b59 !important;
}
