/* ========================================
   IDL LATAM GROUP - Custom Styles
   ======================================== */

/* --- Transitions & Animations --- */
* {
  transition-property: background-color, border-color, color, opacity, box-shadow, transform;
  transition-duration: 150ms;
  transition-timing-function: ease-in-out;
}

/* Disable transitions for elements that shouldn't animate */
input, textarea, select {
  transition-property: border-color, box-shadow;
}

/* --- Loading Spinner --- */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #1a365d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Slide in from right */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
  animation: slideInRight 0.3s ease-out forwards;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

/* --- Modal Styles --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeInOverlay 0.2s ease-out;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- Table Responsive --- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table {
  min-width: 800px;
}

@media (max-width: 768px) {
  .table-responsive {
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
  }
}

/* --- File Upload Zone --- */
.upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #f8fafc;
}

.upload-zone:hover {
  border-color: #d4a833;
  background-color: #fffbeb;
}

.upload-zone.drag-over {
  border-color: #d4a833;
  background-color: #fef3c7;
  transform: scale(1.01);
}

.upload-zone img {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
  border-radius: 0.5rem;
  margin: 0 auto;
}

/* --- Action Buttons --- */
.btn-primary {
  background-color: #1a365d;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  background-color: #0f1f3a;
}

.btn-gold {
  background-color: #d4a833;
  color: #1a365d;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border: none;
}

.btn-gold:hover {
  background-color: #c49a2e;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border: none;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-secondary {
  background-color: #e5e7eb;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border: none;
}

.btn-secondary:hover {
  background-color: #d1d5db;
}

/* --- Notification Toast --- */
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: 500;
  font-size: 0.875rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  animation: toastSlideIn 0.3s ease-out, toastFadeOut 0.3s ease-in 2.7s;
  animation-fill-mode: forwards;
}

.toast-success { background-color: #16a34a; }
.toast-error { background-color: #dc2626; }
.toast-info { background-color: #2563eb; }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* --- Print Styles --- */
@media print {
  body {
    background: white !important;
  }

  nav, .no-print, button, .btn-primary, .btn-gold, .btn-danger, .btn-secondary {
    display: none !important;
  }

  .shadow, .shadow-lg, .shadow-xl, .shadow-2xl {
    box-shadow: none !important;
  }

  .rounded-xl, .rounded-lg {
    border-radius: 0 !important;
  }

  * {
    color: black !important;
    background: white !important;
  }
}

/* --- Category Checkbox Styles --- */
.category-checkbox input[type="checkbox"] {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #cbd5e1;
  border-radius: 0.25rem;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.category-checkbox input[type="checkbox"]:checked {
  background-color: #1a365d;
  border-color: #1a365d;
}

.category-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* --- Form Focus Ring --- */
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 168, 51, 0.3);
  border-color: #d4a833;
}

/* --- Pagination Active --- */
.pagination-btn.active {
  background-color: #1a365d;
  color: white;
}
