/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Admin Portal Navigation Enhancements */
.admin-nav-item {
  @apply transition-all duration-200 ease-in-out;
}

.admin-nav-item:hover {
  @apply transform translate-x-1;
}

.admin-nav-section-header {
  @apply transition-colors duration-150 ease-in-out text-left cursor-pointer;
}

.admin-nav-section-header:hover {
  @apply bg-gray-50 rounded-lg;
}

.admin-nav-section-header span {
  @apply text-left;
}

/* Active state indicator animation */
.admin-nav-active-indicator {
  @apply transition-all duration-300 ease-in-out;
}

/* Smooth scrollbar for navigation */
.nav-scrollable::-webkit-scrollbar {
  width: 4px;
}

.nav-scrollable::-webkit-scrollbar-track {
  @apply bg-transparent;
}

.nav-scrollable::-webkit-scrollbar-thumb {
  @apply bg-gray-300 rounded-full;
}

.nav-scrollable::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-400;
}

/* Collapsible section animations */
.collapsible-content {
  @apply transition-all duration-300 ease-in-out;
}

.collapsible-icon {
  @apply transition-transform duration-200 ease-in-out;
}

/* Enhanced caret animation for collapsible sections */
[data-collapsible-target="icon"] {
  @apply transition-all duration-200 ease-in-out transform text-gray-400;
}

[data-collapsible-target="icon"].rotate-180 {
  @apply rotate-180 text-gray-600;
}

/* Enhanced focus states for accessibility */
.admin-nav-item:focus {
  @apply outline-none ring-2 ring-v-green-500 ring-offset-2;
}

.admin-nav-section-header:focus {
  @apply outline-none ring-2 ring-v-green-500 ring-offset-2;
}

/* Loading states */
.nav-loading {
  @apply animate-pulse;
}

/* Main content area styling */
.admin-main-content {
  @apply p-6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .admin-nav-item:hover {
    @apply transform-none;
  }
}

/* Pagy series_nav styling to match admin portal pagination buttons */
nav .pagy.series-nav,
.pagy.series-nav,
nav .series-nav,
.series-nav {
  display: flex;
  gap: 0.25rem;
  border: none;
  background: transparent;
  padding: 0;
}

nav .pagy.series-nav a,
.pagy.series-nav a,
nav .series-nav a,
.series-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition-property: color, background-color, border-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
  text-decoration: none;
}

nav .pagy.series-nav a:hover,
.pagy.series-nav a:hover,
nav .series-nav a:hover,
.series-nav a:hover {
  background-color: #f9fafb;
}

nav .pagy.series-nav a[aria-current="page"],
.pagy.series-nav a[aria-current="page"],
nav .series-nav a[aria-current="page"],
.series-nav a[aria-current="page"] {
  font-weight: 600;
  color: white;
  background-color: #267558;
  border-color: transparent;
}

nav .pagy.series-nav a:not([href]),
.pagy.series-nav a:not([href]),
nav .series-nav a:not([href]),
.series-nav a:not([href]) {
  color: #9ca3af;
  cursor: not-allowed;
  pointer-events: none;
}

/* Replace the raw < and > with labels */
nav .pagy.series-nav a[aria-label="Previous"],
.pagy.series-nav a[aria-label="Previous"],
nav .series-nav a[aria-label="Previous"],
.series-nav a[aria-label="Previous"] {
  font-size: 0;
  line-height: 0;
}

nav .pagy.series-nav a[aria-label="Previous"]::before,
.pagy.series-nav a[aria-label="Previous"]::before,
nav .series-nav a[aria-label="Previous"]::before,
.series-nav a[aria-label="Previous"]::before {
  content: "‹ Previous";
  font-size: 0.875rem;
  line-height: normal;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

nav .pagy.series-nav a[aria-label="Next"],
.pagy.series-nav a[aria-label="Next"],
nav .series-nav a[aria-label="Next"],
.series-nav a[aria-label="Next"] {
  font-size: 0;
  line-height: 0;
}

nav .pagy.series-nav a[aria-label="Next"]::before,
.pagy.series-nav a[aria-label="Next"]::before,
nav .series-nav a[aria-label="Next"]::before,
.series-nav a[aria-label="Next"]::before {
  content: "Next ›";
  font-size: 0.875rem;
  line-height: normal;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Village Green Checkbox Styling */
input[type="checkbox"] {
  accent-color: #267558;
  cursor: pointer;
}

/* For better cross-browser support */
input[type="checkbox"]:checked {
  background-color: #267558;
  border-color: #267558;
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(38, 117, 88, 0.1);
}

input[type="checkbox"]:hover {
  border-color: #267558;
}

/* Custom Date Picker Styling */
input[type="date"] {
  position: relative;
  cursor: pointer;
}

/* Style the calendar icon */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.5rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 2V6M14 2V6M3 10H17M5 4H15C16.1046 4 17 4.89543 17 6V16C17 17.1046 16.1046 18 15 18H5C3.89543 18 3 17.1046 3 16V6C3 4.89543 3.89543 4 5 4Z' stroke='%23267558' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  width: 2rem;
  height: 2rem;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background-color: #f3f4f6;
  border-radius: 0.375rem;
}

/* Focus state for calendar icon */
input[type="date"]:focus::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* Remove default inner spin button for date input */
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
  display: none;
}

/* Enhanced placeholder styling */
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  color: #374151;
  padding: 0 0.125rem;
}

/* Placeholder when empty */
input[type="date"]:invalid::-webkit-datetime-edit {
  color: #9ca3af;
}

/* Date input with value (not empty) */
input[type="date"]:not(:invalid) {
  color: #111827;
}

/* Hover state for entire input */
input[type="date"]:hover {
  border-color: #9ca3af;
  transition: border-color 0.2s ease;
}

/* Active/Selected state */
input[type="date"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(38, 117, 88, 0.1);
}