/**
 * FHC Mobile Table & Lightbox Zoom Stylesheet
 * chantroituonglai.com
 */

/* Container wrapping desktop and mobile versions */
.fhc-table-responsive-container {
  margin: 32px 0;
  width: 100%;
  clear: both;
}

/* Default Desktop: show HTML table, hide mobile image */
.fhc-table-desktop {
  display: block !important;
  width: 100%;
  overflow-x: auto;
}

.fhc-table-mobile {
  display: none !important;
}

/* Mobile Breakpoint (<= 768px): hide HTML table, show mobile image card */
@media screen and (max-width: 768px) {
  .fhc-table-desktop {
    display: none !important;
  }

  .fhc-table-mobile {
    display: block !important;
    width: 100%;
    margin: 20px 0;
  }

  .fhc-table-mobile-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0284c7;
    margin-bottom: 8px;
    padding-left: 2px;
  }

  .fhc-table-mobile-hint svg {
    flex-shrink: 0;
    stroke: #0284c7;
  }

  .fhc-table-mobile-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
    background: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .fhc-table-mobile-card:active {
    transform: scale(0.985);
  }

  .fhc-table-mobile-card img {
    display: block;
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .fhc-table-mobile-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 5px;
  }
}

/* ==========================================================================
   FHC Table Lightbox Modal (Zoom In / Out / Pan / Pinch-to-zoom)
   ========================================================================== */
.fhc-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(10, 15, 29, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.fhc-lightbox-modal.is-active {
  opacity: 1;
  visibility: visible;
}

/* Lightbox Top Toolbar */
.fhc-lightbox-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
  flex-shrink: 0;
}

.fhc-lightbox-title {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fhc-lightbox-title span {
  color: #38bdf8;
}

.fhc-lightbox-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fhc-lightbox-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s;
}

.fhc-lightbox-btn:hover,
.fhc-lightbox-btn:active {
  background: rgba(255, 255, 255, 0.25);
}

.fhc-lightbox-btn-close {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 20px;
}

/* Lightbox Viewport & Image Container */
.fhc-lightbox-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}

.fhc-lightbox-body:active {
  cursor: grabbing;
}

.fhc-lightbox-img-wrap {
  position: absolute;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  will-change: transform;
}

.fhc-lightbox-img {
  max-width: none;
  display: block;
  pointer-events: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

/* Lightbox Footer Instruction Hint */
.fhc-lightbox-footer {
  height: 40px;
  background: rgba(15, 23, 42, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #94a3b8;
  z-index: 10;
  flex-shrink: 0;
}
