/* Enhanced Form Styles con Magical UX */
:root {
  --glow-gold: rgba(240, 180, 41, 0.4);
  --glow-blue: rgba(59, 130, 246, 0.4);
  --glow-green: rgba(16, 185, 129, 0.4);
  --glow-red: rgba(239, 68, 68, 0.4);
}

/* Base form styles con mayor especificidad */
body input,
body select,
body textarea,
body input[type="text"],
body input[type="password"],
body input[type="email"],
body input[type="date"],
body input[type="number"],
body input[type="search"],
body .form-input,
body .fsel {
  background: linear-gradient(135deg, rgba(11, 26, 49, 0.9), rgba(15, 32, 64, 0.8)) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  padding: 12px 16px !important;
  border-radius: 12px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Efecto mágico de hover */
body input:hover,
body select:hover,
body textarea:hover {
  background: linear-gradient(135deg, rgba(15, 32, 64, 0.95), rgba(20, 40, 80, 0.9)) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 25px rgba(240, 180, 41, 0.2) !important;
  transform: translateY(-2px) !important;
}

/* Efecto de focus mágico */
body input:focus,
body select:focus,
body textarea:focus {
  background: linear-gradient(135deg, rgba(15, 32, 64, 1), rgba(25, 50, 100, 0.95)) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 30px rgba(240, 180, 41, 0.3) !important;
  transform: translateY(-2px) scale(1.02) !important;
  outline: none !important;
}

/* Placeholder styling */
body input::placeholder,
body textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
  font-style: italic !important;
  transition: all 0.3s ease !important;
}

body input:focus::placeholder,
body textarea:focus::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
  transform: translateX(4px) !important;
}

/* Select dropdown mejorado */
body select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f0b429'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 20px !important;
  padding-right: 40px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  cursor: pointer !important;
  color-scheme: dark !important;
}

/* Select options styling */
body select option {
  background-color: #0b1a31 !important;
  background: #0b1a31 !important; /* Solid color for better cross-browser compatibility */
  color: #ffffff !important;
  padding: 12px !important;
  border: none !important;
}

/* Labels animados */
body label {
  color: rgba(255, 255, 255, 0.7) !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  margin-bottom: 8px !important;
  display: block !important;
  transition: all 0.3s ease !important;
}

/* Botones de formulario mágicos */
body button[type="submit"],
body .btn-premium,
body input[type="submit"] {
  background: linear-gradient(135deg, var(--gold), #e8a000) !important;
  color: var(--navy) !important;
  border: none !important;
  padding: 14px 28px !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  cursor: pointer !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 4px 15px rgba(240, 180, 41, 0.3) !important;
}

body button[type="submit"]:hover,
body .btn-premium:hover,
body input[type="submit"]:hover {
  background: linear-gradient(135deg, #fcd34d, var(--gold)) !important;
  transform: translateY(-3px) scale(1.05) !important;
  box-shadow: 0 8px 25px rgba(240, 180, 41, 0.5) !important;
}

body button[type="submit"]:active,
body .btn-premium:active,
body input[type="submit"]:active {
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 4px 15px rgba(240, 180, 41, 0.4) !important;
}

/* Campos inválidos con efecto de error */
body input:invalid,
body select:invalid,
body textarea:invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3) !important;
  animation: shake 0.5s ease-in-out !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Efecto de carga mágica */
.loading-input {
  position: relative !important;
}

.loading-input::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 12px;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translateY(-50%);
}

@keyframes spin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body input,
  body select,
  body textarea {
    font-size: 16px !important;
    padding: 14px 18px !important;
  }
  
  body button[type="submit"],
  body .btn-premium {
    padding: 16px 24px !important;
    font-size: 14px !important;
  }
}

/* DataTables override */
.dataTables_wrapper .dataTables_filter input {
  background: linear-gradient(135deg, rgba(11, 26, 49, 0.9), rgba(15, 32, 64, 0.8)) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
  background: linear-gradient(135deg, rgba(15, 32, 64, 1), rgba(25, 50, 100, 0.95)) !important;
  border-color: var(--gold) !important;
  box-shadow: 0 0 20px rgba(240, 180, 41, 0.3) !important;
}
