/* Modal backdrop */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 9999;
  overflow-y: auto;
  padding: 40px 20px;
  animation: fadeIn 0.3s ease-in-out;
  align-items: flex-start;
  justify-content: center;
}

.modal.active {
  display: flex;
}

/* Modal content */
.modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 0;
  width: 100%;
  max-width: 800px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  animation: slideUp 0.4s ease-out;
  position: relative;
  margin: auto;
}

/* Success modal specific width */
#successModal .modal-content {
  max-width: 500px;
}

/* Details modal specific width */
#detailsModal .modal-content {
  max-width: 900px;
}

/* Smooth scrollbar for modal */
.modal-content::-webkit-scrollbar {
  width: 10px;
}

.modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: #2563eb;
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: #1d4ed8;
}

/* ==========================================
   FORM INPUT ENHANCEMENTS
   ========================================== */

/* Enhanced input fields */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: white;
  color: #1f2937;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

/* Success state */
.form-input.success,
.form-select.success,
.form-textarea.success {
  border-color: #10b981;
  background-color: #f0fdf4;
}

/* Error state */
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: #ef4444;
  background-color: #fef2f2;
  animation: shake 0.3s ease-in-out;
}

/* Error message */
.error-message {
  display: none;
  color: #ef4444;
  font-size: 14px;
  margin-top: 6px;
  font-weight: 500;
}

.error-message.show {
  display: block;
  animation: slideDown 0.3s ease-out;
}

/* ==========================================
   ENHANCED CHECKBOX & FILE INPUT
   ========================================== */

/* Custom checkbox */
input[type="checkbox"] {
  cursor: pointer;
  width: 20px;
  height: 20px;
  accent-color: #2563eb;
}

input[type="checkbox"]:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* File input enhancement */
input[type="file"] {
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 10px 20px;
  margin-right: 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ==========================================
   BUTTON ENHANCEMENTS
   ========================================== */

/* Primary buttons */
button[type="submit"],
.btn-primary {
  position: relative;
  overflow: hidden;
}

button[type="submit"]::before,
.btn-primary::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button[type="submit"]:active::before,
.btn-primary:active::before {
  width: 300px;
  height: 300px;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ==========================================
   JOB CARDS ENHANCEMENT
   ========================================== */

.job-card {
  transition: all 0.3s ease;
  background: white;
}

.job-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Benefit cards */
.benefit-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  transition: all 0.3s ease;
}

.benefit-card:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.1);
}

/* ==========================================
   HOVER EFFECTS
   ========================================== */

.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================
   MOBILE OPTIMIZATIONS
   ========================================== */

@media (max-width: 640px) {
  .modal {
    padding: 20px 10px;
    align-items: flex-start;
  }

  .modal-content {
    border-radius: 12px;
    max-height: calc(100vh - 40px);
    margin: 0 auto;
  }

  /* Stack form fields on mobile */
  .grid.md\:grid-cols-2 {
    grid-template-columns: 1fr;
  }

  /* Larger touch targets for mobile */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 14px 16px;
  }

  button[type="submit"],
  button[type="button"] {
    padding: 16px 24px;
    font-size: 16px;
  }

  input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }
}

/* Tablet optimization */
@media (min-width: 641px) and (max-width: 1024px) {
  .modal {
    padding: 30px 20px;
  }

  .modal-content {
    max-width: 700px;
  }
}

/* ==========================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

/* High contrast text */
label,
.text-gray-900 {
  color: #111827;
}

/* Better link contrast */
a {
  text-decoration-skip-ink: auto;
}

a:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================
   LOADING STATES
   ========================================== */

button[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

button[disabled]:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================
   SECTION DIVIDERS
   ========================================== */

.border-b-2 {
  border-bottom-width: 2px;
}

.border-blue-600 {
  border-color: #2563eb;
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
  .modal {
    display: none !important;
  }
}

/* ==========================================
   REDUCED MOTION SUPPORT
   ========================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   GRADIENT TEXT UTILITY
   ========================================== */

.gradient-text {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
