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

@layer base {
  html, body {
    word-break: keep-all;
    overflow-wrap: break-word;
    line-break: strict;
  }
  th {
    white-space: nowrap;
  }
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ============================================
   RWD Global Utilities for 9Me.ai
   Mobile-First Responsive Design System
   ============================================ */

/* Responsive Container — Fluid padding + max-width */
.rwd-container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .rwd-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    max-width: 640px;
  }
}
@media (min-width: 768px) {
  .rwd-container {
    max-width: 768px;
  }
}
@media (min-width: 1024px) {
  .rwd-container {
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 1024px;
  }
}
@media (min-width: 1280px) {
  .rwd-container {
    max-width: 1200px;
  }
}

/* Wide Container — For pages that should expand more on desktop */
.rwd-container-wide {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .rwd-container-wide {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .rwd-container-wide {
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 1280px;
  }
}
@media (min-width: 1536px) {
  .rwd-container-wide {
    max-width: 1400px;
  }
}

/* Minimum Touch Target (WCAG 2.5.5 compliance) */
.touch-target {
  min-width: 44px;
  min-height: 44px;
}

/* Custom Red Cluster for Heat Map */
.marker-cluster-red {
  background-color: rgba(254, 202, 202, 0.6); /* red-200 with opacity */
  border-radius: 50%;
}
.marker-cluster-red div {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  margin-top: 5px;
  text-align: center;
  border-radius: 50%;
  font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
  background-color: rgba(220, 38, 38, 0.85); /* red-600 */
  color: white;
  line-height: 30px;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

/* Safe Area Utility for iPhone Home Indicator */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom);
}
.pb-safe-20 {
  padding-bottom: calc(env(safe-area-inset-bottom) + 5rem);
}

/* Responsive Modal — Bottom sheet on mobile, centered on desktop */
@media (min-width: 1024px) {
  .modal-responsive {
    align-items: center !important;
  }
  .modal-responsive > div {
    border-radius: 1.5rem !important;
    max-height: 85vh;
  }
}

/* Responsive Fixed Bottom Bar — Centered on wide screens */
.fixed-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
}
@media (min-width: 1024px) {
  .fixed-bottom-bar {
    left: 50%;
    transform: translateX(-50%);
    max-width: 1024px;
    border-radius: 1rem 1rem 0 0;
  }
}

/* ============================================
   Thermal Receipt Printing (ESC/POS 58mm / 80mm)
   ============================================ */
@media print {
  @page {
    margin: 0;
    size: 80mm auto;
  }
  body {
    margin: 0 !important;
    padding: 6px !important;
    background: #ffffff !important;
    color: #000000 !important;
  }
  header, nav, footer, .no-print {
    display: none !important;
  }
}