.panzoom-container {
  position: relative;
  overflow: visible; /* Allow full image to show, no cropping */
  border: 1px solid #ccc;
  touch-action: none;
  cursor: grab;
  background-color: #fff;
  width: 100%;         /* Full width of the parent (.col-md-7) */
  height: auto;        /* Let height adjust based on image */
  max-height: none;    /* Remove height limitation */
}

.panzoom-container img {
  width: 100%;         /* Make image stretch to container width */
  height: auto;        /* Maintain aspect ratio */
  display: block;
  object-fit: contain; /* Keep image fully visible */
  user-select: none;   /* Optional, avoid image selection on drag */
}

.panzoom-controls button:focus { outline: 2px solid #0d6efd; outline-offset: 2px; }


/* Base styles for stage image container */
.panzoom-container-stage {
    position: relative;
    overflow: hidden;
    border: 1px solid #ccc;
    touch-action: none;
    cursor: grab;
    background-color: #fff;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panzoom-container-stage img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Mobile: Natural image size (Bootstrap xs and sm) */
@media (max-width: 767.98px) {
    .panzoom-container-stage {
        height: auto; /* Let image determine height */
        min-height: 300px; /* Minimum height for very small images */
    }
    
    .panzoom-container-stage img {
        width: 100%;
        height: auto;
    }
    
    .table-container {
        height: auto !important; /* Remove fixed height on mobile */
        max-height: 50vh; /* Reasonable max for mobile scrolling */
    }
}

/* Tablet and Desktop: Dynamic height matching (Bootstrap md and up) */
@media (min-width: 768px) {
    .panzoom-container-stage {
        height: 70vh; /* Match table container height */
    }
    
    .table-container {
        height: 70vh;
        max-height: 70vh;
    }
}

/* Large screens: Slightly taller for better visibility */
@media (min-width: 1200px) {
    .panzoom-container-stage {
        height: 75vh;
    }
    
    .table-container {
        height: 75vh;
        max-height: 75vh;
    }
}

/* Stage zoom controls remain consistent */
.panzoom-controls-stage {
    z-index: 10;
}

.panzoom-controls-stage button {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
