/* Navigation Links */
.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  color: #1f2937;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}
.nav-link:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

/* Alert Styles */
.success-alert {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}
.error-alert {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.info-alert {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

/* Form Styles */
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
}
.form-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  padding: 0.75rem 1rem;
  background: #fff;
  font-size: 1rem;
  transition: all 0.15s ease;
}
.form-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.form-input::placeholder {
  color: #94a3b8;
}

/* Card Styles */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.2s ease;
}
.card:hover {
  border-color: #cbd5e1;
}

/* Alpine.js Collapse Animation */
[x-cloak] {
  display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Mobile Touch Improvements */
@media (max-width: 640px) {
  .form-input {
    font-size: 16px; /* Prevent iOS zoom on focus */
    padding: 1rem;
  }
  
  button, a {
    -webkit-tap-highlight-color: transparent;
  }
}

/* RTL Support */
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="number"],
html[dir="rtl"] .dir-ltr {
  direction: ltr;
  text-align: left;
}

/* Progress Bar Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Checkbox/Radio custom styling */
input[type="checkbox"],
input[type="radio"] {
  accent-color: #6366f1;
}

/* Has selector support for modern browsers */
@supports selector(:has(*)) {
  .has-\[\:checked\]\:border-indigo-600:has(:checked) {
    border-color: #4f46e5;
  }
  .has-\[\:checked\]\:bg-indigo-50:has(:checked) {
    background-color: #eef2ff;
  }
}

/* Modal Backdrop */
.modal-backdrop {
  backdrop-filter: blur(4px);
}

/* Line clamp utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Smooth transitions */
* {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Button active state */
button:active:not(:disabled),
a:active {
  transform: scale(0.98);
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
