/* Custom styles that complement Tailwind CSS */

/* Apply Roboto font globally */
html, body {
  font-family: 'Roboto', sans-serif;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}


/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c5c5c5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}


/* Focus styles */
.focus-visible:focus {
  outline: 2px solid #1e40af;
  outline-offset: 2px;
}

/* Status filter button active state */
.status-filter-btn.active-filter {
  border: 2px solid;
  font-weight: 600;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Global Form Styles */

/* Base styles for all form inputs and selects */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Focus state for inputs and selects */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):focus,
textarea:focus {
  border-color: #93c5fd;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Hover state for inputs and selects */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):hover,
textarea:hover {
  border-color: #9ca3af;
}

/* Disabled state for inputs and selects */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):disabled,
textarea:disabled {
  background-color: #f3f4f6;
  opacity: 0.65;
  cursor: not-allowed;
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Fix for input placeholder overlap with icons */
.relative input[type="text"],
.relative input[type="email"],
.relative input[type="password"],
.relative input[type="number"],
.relative input[type="tel"],
.relative input[type="url"],
.relative input[type="search"] {
  padding-left: 2.5rem !important;
}

/* Ensure placeholder doesn't overlap with icon */
.relative input::placeholder {
  color: transparent;
  transition: color 0.2s ease;
}

.relative input:focus::placeholder {
  color: #9ca3af;
}

/* Add padding to the top of inputs with icons to prevent overlap */
.relative .absolute + input,
.relative .absolute + select,
.relative .absolute + textarea {
  padding-top: 0.625rem !important;
  padding-bottom: 0.625rem !important;
}

/* Style for date inputs to prevent overlap */
input[type="date"] {
  padding-left: 0.75rem !important;
  min-height: 42px;
}

/* Specific styling for form inputs with icons in our application */
.relative {
  position: relative;
}

/* Icon positioning in inputs */
.relative .absolute.inset-y-0.left-0.pl-3 {
  display: flex;
  align-items: center;
  pointer-events: none;
  height: 100%;
  padding-left: 0.75rem;
}

/* Ensure icon is visible and properly positioned */
.relative .absolute i {
  color: #9ca3af;
  font-size: 1rem;
  line-height: 1;
}

/* Adjust placeholder text position */
.relative input:not([type="date"]):not([type="checkbox"]):not([type="radio"]) {
  text-indent: 0.5rem;
}

/* Fix for select elements with icons */
.relative select {
  padding-left: 2.5rem !important;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Improved focus states for inputs with icons */
.relative input:focus,
.relative select:focus,
.relative textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  outline: none;
  z-index: 10;
  position: relative;
}

/* Color variations for different sections */
.bg-primary + .p-6 .relative input:focus,
.bg-primary + .p-6 .relative select:focus,
.bg-primary + .p-6 .relative textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.bg-info + .p-6 .relative input:focus,
.bg-info + .p-6 .relative select:focus,
.bg-info + .p-6 .relative textarea:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.bg-success + .p-6 .relative input:focus,
.bg-success + .p-6 .relative select:focus,
.bg-success + .p-6 .relative textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.bg-warning + .p-6 .relative input:focus,
.bg-warning + .p-6 .relative select:focus,
.bg-warning + .p-6 .relative textarea:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.bg-danger + .p-6 .relative input:focus,
.bg-danger + .p-6 .relative select:focus,
.bg-danger + .p-6 .relative textarea:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

/* Enhanced Select Styling */
select {
  display: block !important;
  width: 100% !important;
  padding: 0.5rem 0.75rem !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: #374151 !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center !important;
  background-repeat: no-repeat !important;
  background-size: 1em 1em !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0.375rem !important;
  padding-right: 2.5rem !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-color 0.15s ease-in-out !important;
}

/* Override Tailwind classes for select elements */
select.border-gray-300 {
  border-color: #d1d5db !important;
}

select.rounded-md {
  border-radius: 0.375rem !important;
}

select.focus\:ring-blue-500:focus {
  --tw-ring-color: rgba(59, 130, 246, 0.5) !important;
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;
  border-color: #3b82f6 !important;
}

select.shadow-sm {
  --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow, 0 0 #0000) !important;
}

select.sm\:text-sm {
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
}

select.block {
  display: block !important;
}

select.w-full {
  width: 100% !important;
}

/* Select focus state */
select:focus {
  border-color: #93c5fd !important;
  outline: 0 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

/* Select hover state */
select:hover {
  border-color: #9ca3af !important;
}

/* Select disabled state */
select:disabled {
  background-color: #f3f4f6 !important;
  opacity: 0.65 !important;
  cursor: not-allowed !important;
}

/* Select with multiple attribute */
select[multiple] {
  background-image: none !important;
  padding-right: 0.75rem !important;
  height: auto !important;
}

/* Remove default select arrow in IE10+ */
select::-ms-expand {
  display: none !important;
}

/* Select option styling */
select option {
  padding: 0.5rem !important;
  font-weight: normal !important;
}

/* Select option hover/focus */
select option:hover,
select option:focus {
  background-color: #f3f4f6 !important;
}

/* Select option selected */
select option:checked {
  background-color: #dbeafe !important;
  color: #1e40af !important;
}

/* Form labels */
label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

/* Error state for inputs */
input.input-validation-error,
select.input-validation-error,
textarea.input-validation-error {
  border-color: #ef4444;
}

input.input-validation-error:focus,
select.input-validation-error:focus,
textarea.input-validation-error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

/* Validation error messages */
.field-validation-error {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #ef4444;
}

/* Form groups */
.form-group {
  margin-bottom: 1rem;
}

/* Readonly inputs */
input:read-only,
textarea:read-only {
  background-color: #f9fafb;
  border-color: #e5e7eb;
}

/* Date inputs */
input[type="date"] {
  min-height: 38px;
}

/* Number inputs - hide spinner buttons */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Checkbox and radio custom styling */
input[type="checkbox"],
input[type="radio"] {
  width: 1rem;
  height: 1rem;
  color: #3b82f6;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  accent-color: #3b82f6;
}

input[type="radio"] {
  border-radius: 50%;
}

/* Checkbox and radio labels */
.checkbox-label,
.radio-label {
  display: inline-flex;
  align-items: center;
  margin-right: 1rem;
  cursor: pointer;
}

.checkbox-label input,
.radio-label input {
  margin-right: 0.5rem;
}

/* Loading spinner */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 3px solid #3b82f6;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Animation for grid pattern */
@keyframes patternMove {
  0% { background-position: 0 0; }
  100% { background-position: 100px 100px; }
}

/* Fade in animations */
.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Shadow glow effect */
.shadow-glow {
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  transition: box-shadow 0.3s ease;
}

.shadow-glow:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}