@tailwind base;
@tailwind components;
@tailwind utilities;

@import "dialog_override.css";
/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/

/* ==========================================================================
   PORTAL PREVIEW MODE - Global Read-Only Styles
   Applied when body has 'preview-mode' class
   ========================================================================== */

/* Preview Mode Banner - Only show CSS pseudo-element if HTML banner is not present */
body.preview-mode:not(:has(.preview-mode-banner))::before {
  content: "PREVIEW MODE - Read Only";
  display: block;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: white;
  text-align: center;
  padding: 10px;
  font-weight: bold;
  font-size: 14px;
  position: sticky;
  top: 0;
  z-index: 99999;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  letter-spacing: 0.5px;
}

/* Disable ALL form inputs */
body.preview-mode input:not([type="hidden"]),
body.preview-mode select,
body.preview-mode textarea,
body.preview-mode button,
body.preview-mode [type="submit"],
body.preview-mode .btn,
body.preview-mode a.btn {
  pointer-events: none !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  user-select: none !important;
}

/* Hide destructive/delete actions */
body.preview-mode a[data-method="delete"],
body.preview-mode button[data-method="delete"],
body.preview-mode [data-turbo-method="delete"],
body.preview-mode form[method="delete"],
body.preview-mode .btn-danger,
body.preview-mode .btn-delete,
body.preview-mode .delete-btn,
body.preview-mode [data-action*="delete"],
body.preview-mode [onclick*="delete"] {
  display: none !important;
}

/* Hide "New" and "Add" buttons */
body.preview-mode a[href*="/new"],
body.preview-mode a[href$="/new"],
body.preview-mode .btn-new,
body.preview-mode .add-btn,
body.preview-mode [data-action*="new"] {
  display: none !important;
}

/* Hide edit buttons */
body.preview-mode a[href*="/edit"],
body.preview-mode a[href$="/edit"],
body.preview-mode .btn-edit,
body.preview-mode .edit-btn {
  display: none !important;
}

/* Disable links that modify data */
body.preview-mode a[data-method],
body.preview-mode a[data-turbo-method] {
  pointer-events: none !important;
  opacity: 0.5 !important;
}

/* Allow navigation links (read-only browsing) */
body.preview-mode a:not([data-method]):not([data-turbo-method]):not([href*="/new"]):not([href*="/edit"]):not(.btn) {
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: pointer !important;
}

/* Disable Stimulus/JS interactive elements */
body.preview-mode [data-controller*="form"],
body.preview-mode [data-controller*="modal"],
body.preview-mode [data-controller*="dropdown"] button {
  pointer-events: none !important;
}

/* Visual indicator on disabled elements */
body.preview-mode input:not([type="hidden"]):hover,
body.preview-mode select:hover,
body.preview-mode textarea:hover {
  outline: 2px dashed #f59e0b !important;
}
/* app/assets/stylesheets/dialog_override.css */

/* Universal Modal System - Compatible with all browsers */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  
  /* Safari-specific fixes */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.modal-overlay.show {
  opacity: 1 !important;
  visibility: visible !important;
}

.modal-content {
  background: white !important;
  border-radius: 0.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.95);
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  z-index: 100000 !important;
  
  /* Safari-specific fixes for modal content */
  position: relative;
  -webkit-transform: scale(0.95);
  -webkit-transition: -webkit-transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.show .modal-content {
  transform: scale(1) !important;
  -webkit-transform: scale(1) !important;
  opacity: 1 !important;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Higher z-index for nested modals */
.modal-overlay.z-50 {
  z-index: 50 !important;
}

.modal-overlay.z-60 {
  z-index: 60 !important;
}

/* Maximum z-index for confirmation dialogs */
#globalDialogCancelOrder,
#globalDialogMarkServed,
#globalConfirmCancelDiscountModal {
  z-index: 2147483646 !important; /* One less than max to allow face verification above */
}

/* Face verification dialog should be above confirmation dialogs */
#dialog-faceid {
  z-index: 2147483647 !important; /* Maximum z-index */
}

/* Ensure MRO dialogs always appear on top of other modals */
#globalDialogRoomMro {
  z-index: 999999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
}

#globalDialogRoomMro.modal-overlay {
  z-index: 999999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Safari-specific fixes for checkout dialogs */
#globalDialogCheckOut,
#globalDialogConfirmCheckout {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Force visibility for checkout dialog with maximum z-index */
#globalDialogCheckOut {
  z-index: 2147483647 !important; /* Maximum 32-bit integer */
}

#globalDialogCheckOut.modal-overlay,
#globalDialogCheckOut.modal-overlay.show {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 2147483647 !important; /* Maximum z-index */
  background-color: rgba(0, 0, 0, 0.5) !important;
  min-height: 100vh !important;
  min-width: 100vw !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

/* Force checkout modal content to be visible */
#globalDialogCheckOut .modal-content {
  display: flex !important;
  flex-direction: column !important;
  min-width: 400px !important;
  min-height: 300px !important;
  max-width: 600px !important;
  opacity: 1 !important;
  transform: scale(1) !important;
  z-index: 2147483647 !important;
  background: white !important;
  border-radius: 0.5rem !important;
  position: relative !important;
}

/* Safari hidden state fix */
@supports (-webkit-appearance: none) {
  .modal-overlay.hidden {
    display: none !important;
  }
  
  .modal-overlay:not(.hidden) {
    display: flex !important;
  }
  
  /* Force visibility for checkout dialogs in Safari */
  #globalDialogCheckOut:not(.hidden),
  #globalDialogConfirmCheckout:not(.hidden) {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99999 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Style the native dialog element - applies to both alert and confirm dialogs */
.alert-dialog {
  padding: 0;
  border: none;
  border-radius: 0.5rem; /* rounded-lg */
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 32rem; /* max-w-lg */
  width: calc(100% - 2rem);
  margin: 0;
  font-family: inherit;
  background: white;
  
  /* Fixed positioning to center exactly in the viewport */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  /* Reset any margins that may affect centering */
  margin: 0;
  
  /* Ensure dialog stays above everything */
  z-index: 9999;
  
  /* Safari-specific fixes */
  -webkit-appearance: none;
  appearance: none;
}

/* Safari-specific dialog positioning fix */
@supports (-webkit-appearance: none) {
  .alert-dialog {
    /* Force hardware acceleration for better performance in Safari */
    -webkit-transform: translate3d(-50%, -50%, 0);
    transform: translate3d(-50%, -50%, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
}

/* Ensure div-based dialogs (Safari fallback) are visible */
div.alert-dialog {
  display: block !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 9999 !important;
  background: white;
}

/* Cross-browser backdrop styling with Safari fallback */
.alert-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

/* Safari fallback backdrop using pseudo-element */
.dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  pointer-events: none;
}

.dialog-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Remove default focus outline and add custom focus styles */
.alert-dialog:focus {
  outline: none;
}

/* Button styling */
.alert-dialog button {
  transition: all 0.2s;
}

/* Button hover effects */
.alert-dialog button.bg-blue-500:hover {
  background-color: #3b82f6 !important;
}

.alert-dialog button.bg-gray-200:hover {
  background-color: #e5e7eb !important;
}

/* Make sure dialog content respects line breaks */
.alert-dialog p {
  white-space: pre-line;
  line-height: 1.5;
}

/* Ensure buttons have proper spacing */
.alert-dialog button + button {
  margin-left: 0.5rem;
}

/* Animation for dialog - modified for centered position */
@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -48%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.alert-dialog[open] {
  animation: fadeIn 0.3s ease-out;
}

/* Confirm dialog specific styles - Checkout Room Modal Layout */
.confirm-dialog {
  /* Override base dialog styles for confirm dialogs */
  display: flex;
  flex-direction: column;
}

/* Header styling */
.confirm-dialog .dialog-header {
  height: 2.5rem; /* h-10 */
  margin: 0;
  padding: 0.5rem; /* p-2 */
  background-color: #1e293b; /* bg-slate-800 */
  color: white;
  border-radius: 0.5rem 0.5rem 0 0; /* rounded-t-lg */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.confirm-dialog .dialog-header h4 {
  font-size: 1rem; /* text-base */
  font-weight: 700; /* font-bold */
  margin: 0;
}

.confirm-dialog .dialog-header .close-button {
  cursor: pointer;
  transition: color 0.2s;
  background: none;
  border: none;
  color: white;
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-dialog .dialog-header .close-button:hover {
  color: #fca5a5; /* hover:text-red-300 */
}

/* Body styling */
.confirm-dialog .dialog-body {
  flex-grow: 1;
  padding: 1.5rem; /* p-6 */
  text-align: center;
}

.confirm-dialog .dialog-icon {
  width: 4rem; /* w-16 */
  height: 4rem; /* h-16 */
  background-color: #fed7aa; /* bg-orange-100 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto; /* mb-4 */
}

.confirm-dialog .dialog-icon svg {
  width: 2rem; /* h-8 w-8 */
  height: 2rem;
  color: #ea580c; /* text-orange-600 */
}

.confirm-dialog .dialog-title {
  font-size: 1.125rem; /* text-lg */
  font-weight: 600; /* font-semibold */
  color: #1e293b; /* text-slate-800 */
  margin-bottom: 0.5rem; /* mb-2 */
}

.confirm-dialog .dialog-message {
  font-size: 0.875rem; /* text-sm */
  color: #475569; /* text-slate-600 */
  margin-bottom: 0.5rem;
}

.confirm-dialog .dialog-confirm-text {
  font-size: 0.875rem; /* text-sm */
  color: #475569; /* text-slate-600 */
  font-weight: 600; /* font-semibold */
}

/* Footer styling */
.confirm-dialog .dialog-footer {
  width: 100%;
  display: flex;
  padding: 1rem; /* p-4 */
  border-top: 1px solid #e2e8f0; /* border-t border-slate-200 */
  justify-content: flex-end;
  margin-top: auto;
  background-color: #f8fafc; /* bg-slate-50 */
  border-radius: 0 0 0.5rem 0.5rem; /* rounded-b-lg */
  gap: 0.75rem; /* space-x-3 */
}

.confirm-dialog .dialog-footer button {
  border-radius: 0.5rem; /* rounded-lg */
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  padding: 0.625rem 1.25rem; /* px-5 py-2.5 */
  transition: all 0.2s; /* transition-colors */
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.confirm-dialog .dialog-footer .cancel-button {
  color: #374151; /* text-slate-700 */
  background-color: white; /* bg-white */
  border: 1px solid #e2e8f0; /* border border-slate-200 */
}

.confirm-dialog .dialog-footer .cancel-button:hover {
  background-color: #f1f5f9; /* hover:bg-slate-100 */
}

.confirm-dialog .dialog-footer .cancel-button:focus {
  outline: 2px solid #e2e8f0; /* focus:ring-2 focus:ring-slate-200 */
  outline-offset: 2px;
}

.confirm-dialog .dialog-footer .confirm-button {
  background-color: #16a34a; /* bg-green-600 */
  color: white;
}

.confirm-dialog .dialog-footer .confirm-button:hover {
  background-color: #15803d; /* hover:bg-green-700 */
}

.confirm-dialog .dialog-footer .confirm-button:focus {
  outline: 2px solid #16a34a; /* focus:ring-2 focus:ring-green-300 */
  outline-offset: 2px;
}

.confirm-dialog .dialog-footer .confirm-button svg {
  width: 1rem; /* h-4 w-4 */
  height: 1rem;
  margin-right: 0.375rem; /* mr-1.5 */
}

/* Legacy button styling for backward compatibility */
#confirm-dialog button.bg-blue-500 {
  background-color: #16a34a !important; /* Use green instead of blue */
}

#confirm-dialog button.bg-blue-500:hover {
  background-color: #15803d !important;
}

#confirm-dialog button.bg-gray-200 {
  background-color: white !important;
  color: #374151 !important;
  border: 1px solid #e2e8f0 !important;
}

#confirm-dialog button.bg-gray-200:hover {
  background-color: #f1f5f9 !important;
}

/* Safari-specific fixes for disabled inputs in cleaning verification modal */
@supports (-webkit-appearance: none) {
  #cleanDoneVerifyModal input[disabled] {
    color: black !important;
    -webkit-text-fill-color: black !important;
    opacity: 1 !important;
    -webkit-opacity: 1 !important;
  }
}

/* Force black text for all disabled inputs in cleaning verification modal */
#cleanDoneVerifyModal input[disabled] {
  color: black !important;
  -webkit-text-fill-color: black !important;
  opacity: 1 !important;
}

/* Media query for mobile */
@media (max-width: 640px) {
  .alert-dialog {
    width: calc(100% - 2rem);
    max-width: 90%;
  }
}
/* Select2-style CSS for vanilla JS searchable select implementation */

.select2-container {
  box-sizing: border-box;
  display: inline-block;
  margin: 0;
  position: relative;
  vertical-align: middle;
  width: 100%;
}

.select2-container .select2-selection--single {
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  height: 38px;
  user-select: none;
  -webkit-user-select: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #fff;
}

.select2-container--default .select2-selection--single {
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

/* Override for transparent background in table headers */
.select2-container.border-0.bg-transparent .select2-selection--single {
  background-color: inherit !important;
  border: 0;
  border-radius: 0;
}

/* Ensure header colors are inherited properly */
thead .select2-container .select2-selection--single {
  background-color: inherit !important;
}

/* Inherit table header text color */
thead .select2-container .select2-selection--single .select2-selection__rendered {
  color: inherit !important;
}

/* Ensure full width in table headers */
.select2-container.border-0.bg-transparent {
  width: 100% !important;
}

/* Make dropdown wider for table header searchable selects */
.select2-container.border-0.bg-transparent .select2-dropdown {
  min-width: 300px;
  width: 300px;
}

/* Wide dropdown for item selection lists */
.select2-container.wide-dropdown .select2-dropdown {
  min-width: 400px !important;
  width: 400px !important;
}

/* MRO category dropdown - width controlled by JS positionDropdown() */
.select2-container.mro-category-dropdown .select2-dropdown {
  box-sizing: border-box !important;
}

.select2-container.mro-category-dropdown .select2-results__options {
  max-height: calc(100vh - 420px);
}

.select2-container.mro-category-dropdown .select2-results__option {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.select2-container.mro-category-dropdown .select2-results__option--group {
  padding: 6px 10px 4px 10px;
  font-size: 0.75rem;
}

.select2-container.mro-category-dropdown .select2-results__option--group-child {
  padding-left: 20px;
}

/* Compact dropdown for MRO form selects (assignee, charge employees) */
.select2-container.charge-employee-select .select2-results__options,
#mro_form_tabs .select2-container.text-sm .select2-results__options {
  max-height: calc(100vh - 420px);
}

.select2-container.charge-employee-select .select2-results__option,
#mro_form_tabs .select2-container.text-sm .select2-results__option {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #374151;
  line-height: 36px;
  padding-left: 12px;
  padding-right: 50px;
  font-size: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #9ca3af;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
  cursor: pointer;
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  background: none;
  border: none;
  z-index: 1;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
  color: #374151;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
  position: absolute;
  top: 1px;
  right: 1px;
  width: 20px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #6b7280 transparent transparent transparent;
  border-style: solid;
  border-width: 5px 4px 0 4px;
  height: 0;
  left: 50%;
  margin-left: -4px;
  margin-top: -2px;
  position: absolute;
  top: 50%;
  width: 0;
}

.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent #6b7280 transparent;
  border-width: 0 4px 5px 4px;
}

.select2-dropdown {
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
  display: block;
  position: absolute;
  left: 0;
  margin-top: 4px;
  width: 100%;
  z-index: 1051;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.select2-dropdown--hidden {
  display: none !important;
}

.select2-search--dropdown {
  display: block;
  padding: 8px;
}

.select2-search--dropdown .select2-search__field {
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #374151;
  font-size: inherit;
  outline: 0;
  padding: 6px 12px;
  width: 100%;
  box-sizing: border-box;
}

.select2-search--dropdown .select2-search__field:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.select2-results {
  display: block;
}

.select2-results__options {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.select2-results__option {
  cursor: pointer;
  padding: 8px 12px;
  user-select: none;
  -webkit-user-select: none;
}

.select2-results__option:hover,
.select2-results__option--highlighted {
  background-color: #f3f4f6;
}

.select2-results__option--selected {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.select2-results__option--group {
  cursor: default;
  padding: 12px 12px 8px 12px;
  font-weight: 600;
  color: #374151;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.select2-results__option--group-child {
  padding-left: 24px;
}

.select2-results__message {
  cursor: default;
  padding: 8px 12px;
  color: #6b7280;
  font-style: italic;
}

.select2-results__option__main {
  font-weight: 500;
  color: #374151;
}

.select2-results__option__desc {
  font-size: 0.66em;
  color: #6b7280;
  margin-top: 2px;
  font-weight: normal;
}

/* Compact height for filter forms */
.select2-container.compact-height .select2-selection--single,
.compact-height .select2-selection--single {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
}

.select2-container.compact-height {
  width: 100% !important;
  max-width: 100% !important;
}

/* Force fixed width for filter containers */
.flex.w-\[140px\] .select2-container.compact-height {
  max-width: 140px !important;
}

.select2-container.compact-height .select2-selection--single .select2-selection__rendered,
.compact-height .select2-selection--single .select2-selection__rendered {
  line-height: 30px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 8px !important;
  padding-right: 50px !important;  /* More space for clear button */
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.select2-container.compact-height .select2-selection--single .select2-selection__arrow,
.compact-height .select2-selection--single .select2-selection__arrow {
  height: 30px !important;
  top: 1px !important;
}

.select2-container.compact-height .select2-selection--single .select2-selection__clear {
  right: 20px !important;  /* Position clear button properly */
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 14px !important;
}

/* Focus states */
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.select2-container--open .select2-dropdown {
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.select2-container--open .select2-selection--single {
  border-bottom-color: transparent;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */


 .custom-select {
    position: relative;
    width: 100%;
  }
  
  .selected-option {
    padding: 10px;
    border: 1px solid #ccc;
    cursor: pointer;
  }
  
  .options-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    z-index: 1000;
  }
  
  .option {
    padding: 10px;
    cursor: pointer;
  }
  
  .option:hover {
    background-color: #f0f0f0;
  }
  
  .option.parent {
    font-weight: bold;
    color: #888;
    cursor: default;
  }
  
  .option.child {
    padding-left: 20px;
  }
  
  .hidden {
    display: none;
  }

  /* ---------------- */

 canvas {
    position: absolute;
    top: 20;
    left: 10;
}

.table-wrp  {
    max-height: 75vh;
    overflow-y: auto;
    display:block;
  }
  thead{
    position:sticky;
    top:0
  }
  
.inputtext {
    font-size: x-small;
    color: blue;
    margin: 1;
    padding: 1;
}

#q_item_id_eq {
    color: blue;
    font-size: x-small;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 1;
    padding-right: 1;
}
#q_location_code_eq {
    color: blue;
    font-size: x-small;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 1;
    padding-right: 1;
}
#q_laundry_type_eq {
    color: blue;
    font-size: x-small;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 1;
    padding-right: 1;
}

#laundry_transaction_source_location_id {
    color: blue;
    font-size: x-small;
}
#laundry_transaction_destination_location_id {
    color: blue;
    font-size: x-small;
}
#laundry_transaction_laundry_type {
    color: blue;
    font-size: x-small;
}
#laundry_transaction_trans_type {
    color: blue;
    font-size: x-small;
}

/* Add this to your application.css */
.notification {
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.notification.opacity-0 {
  opacity: 0;
}

.notification.opacity-100 {
  opacity: 1;
}

.notification.translate-x-0 {
  transform: translateX(0);
}

.notification.translate-x-6 {
  transform: translateX(1.5rem);
}

/* Global styling for disabled and readonly inputs - better readability on tablets and mobile */
input[disabled],
input[readonly],
select[disabled],
select[readonly],
textarea[disabled],
textarea[readonly] {
  color: black !important;
  -webkit-text-fill-color: black !important;
  opacity: 1 !important;
  -webkit-opacity: 1 !important;
}

/* Safari-specific fixes for better compatibility */
@supports (-webkit-appearance: none) {
  input[disabled],
  input[readonly],
  select[disabled],
  select[readonly],
  textarea[disabled],
  textarea[readonly] {
    color: black !important;
    -webkit-text-fill-color: black !important;
    opacity: 1 !important;
    -webkit-opacity: 1 !important;
  }
}

/* Ensure disabled form controls maintain readability */
.form-control:disabled,
.form-control[readonly],
.form-select:disabled,
.form-select[readonly] {
  background-color: #f3f4f6;
  color: black !important;
  -webkit-text-fill-color: black !important;
}

/* Tailwind form inputs */
input:disabled,
input[readonly],
select:disabled,
select[readonly],
textarea:disabled,
textarea[readonly] {
  color: black !important;
  -webkit-text-fill-color: black !important;
}

/* Room icon container centering - ensure animations stay centered */
#icon_room_1, #icon_room_2, #icon_room_3, #icon_room_4, #icon_room_5, #icon_room_6,
#icon_room_7, #icon_room_8, #icon_room_9, #icon_room_10, #icon_room_11, #icon_room_12,
#icon_room_13, #icon_room_14, #icon_room_15, #icon_room_16, #icon_room_17, #icon_room_18,
#icon_room_19, #icon_room_20,
[id^="icon_room_"],
[id^="icon_room"],
[id^="button_room"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Ensure animated icons maintain their center position */
.animate-ping,
.animate-bounce,
.animate-pulse,
.animate-waving {
  display: block;
  transform-origin: center center;
}

/* Waving animation definition (if not provided by Tailwind) */
@keyframes wave {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

.animate-waving {
  animation: wave 2s linear infinite;
  transform-origin: center center;
}

/* Kitchen order alert blink — strong on/off flash that keeps element readable */
@keyframes ping-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.animate-ping-badge {
  animation: ping-badge 1s ease-in-out infinite;
}

/* Camera zoom slider - vertical range input for live camera modals */
.camera-zoom-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 28px;
  height: 120px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0,0,0,0.4);
  border-radius: 14px;
  outline: none;
}
.camera-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Responsive room card icons — scales with viewport */
.room-icon {
  width: 1rem;
  height: 1rem;
}
.room-icon-sm {
  width: 0.75rem;
  height: 0.75rem;
}
.room-icon-badge {
  width: 1.25rem;
  height: 1.25rem;
}
.room-icon-lg {
  width: 1.25rem;
  height: 1.25rem;
}

/* xl screens (1280px+): larger icons */
@media (min-width: 1280px) {
  .room-icon {
    width: 1.5rem;
    height: 1.5rem;
  }
  .room-icon-sm {
    width: 1rem;
    height: 1rem;
  }
  .room-icon-badge {
    width: 1.75rem;
    height: 1.75rem;
  }
  .room-icon-lg {
    width: 2rem;
    height: 2rem;
  }
}
/* Room status flip — plays when a card's event_id changes between renders.
   Driven by the `room-status-flip` Stimulus controller. */
@keyframes room-flip-y {
  0%   { transform: perspective(600px) rotateY(0deg); }
  50%  { transform: perspective(600px) rotateY(90deg); }
  100% { transform: perspective(600px) rotateY(0deg); }
}
.room-flip-animate {
  animation: room-flip-y 500ms ease-in-out;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

@keyframes room-flip-x {
  0%   { transform: perspective(600px) rotateX(0deg); }
  50%  { transform: perspective(600px) rotateX(90deg); }
  100% { transform: perspective(600px) rotateX(0deg); }
}
.room-flip-animate-x {
  animation: room-flip-x 500ms ease-in-out;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
