/**
 * RoomCheck - Custom Styles
 * เสริม Tailwind CSS สำหรับ animations และ components ที่ Tailwind ไม่มี
 */

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

/* ============================================================
   FORM ELEMENTS - Mobile optimization
   ============================================================ */

input, select, textarea {
  font-size: 16px !important;  /* ป้องกัน iOS zoom เมื่อ focus */
}

@media (min-width: 640px) {
  input, select, textarea {
    font-size: 14px !important;
  }
}

/* Hide spinners on number inputs */
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;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  body * {
    visibility: hidden;
  }
  #printArea, #printArea * {
    visibility: visible;
  }
  #printArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  header, footer, button, .no-print {
    display: none !important;
  }
}

/* ============================================================
   SCROLLBAR (subtle)
   ============================================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

#lightbox img {
  max-height: 90vh;
  object-fit: contain;
}

/* ============================================================
   FOCUS STYLES (accessibility)
   ============================================================ */

button:focus-visible,
a:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

/* ============================================================
   TABLE responsive
   ============================================================ */

table th, table td {
  white-space: nowrap;
}

@media (max-width: 640px) {
  table th, table td {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

/* ============================================================
   UTILITY: hide on print only
   ============================================================ */

@media print {
  .print\:block { display: block !important; }
  .print\:hidden { display: none !important; }
}
