/* ========================================
   Tailwind is loaded via CDN in index.html
   This file contains custom styles only.
   ======================================== */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Fade-in animation for result section */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Custom scrollbar for result JSON */
#resultJson::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#resultJson::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 4px;
}

#resultJson::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

#resultJson::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Drop zone enhanced animations */
#dropZone.drag-over {
  border-color: #2563eb;
  background-color: #eff6ff;
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2);
}

/* Drop zone transition for border style */
#dropZone {
  transition: all 0.3s ease;
}

/* Thumbnail preview styling */
#thumbnailPreview img {
  transition: transform 0.2s ease;
}

#thumbnailPreview:hover img {
  transform: scale(1.05);
}

/* Table row hover and transitions */
#itemsBody tr {
  transition: background-color 0.15s ease, transform 0.1s ease;
}

#itemsBody tr:hover {
  background-color: #f3f4f6;
  transform: scale(1.002);
}

/* Item input focus glow */
#itemsBody input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
  transition: box-shadow 0.2s ease;
}

/* Item remove button enhanced */
.removeItemBtn {
  color: #ef4444;
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.removeItemBtn:hover {
  color: #dc2626;
  background-color: #fef2f2;
}

/* Toast notification styles */
.toast {
  min-width: 300px;
  max-width: 450px;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateX(120%);
  transition: transform 0.3s ease-out, opacity 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-left: 4px solid #047857;
}

.toast.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border-left: 4px solid #b91c1c;
}

.toast.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border-left: 4px solid #b45309;
}

.toast.info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-left: 4px solid #1d4ed8;
}

/* Toast close button */
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

/* Number input spinners removal */
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;
}

/* Better tap highlights on mobile */
@media (hover: none) {
  button:active {
    transform: scale(0.98);
  }
}

/* Print styles for invoice */
@media print {
  header, footer, #dropZone, #ocrBtn, #submitBtn, #addItemBtn {
    display: none;
  }
  
  main {
    width: 100%;
    max-width: none;
  }
}
