/**
 * IMS Image Styles - Shared Thumbnail Styles
 * Used by: zones.html, jewel_reference_viewer.html
 * Version: 1.0
 * Last Updated: 2025-12-17
 */

/* ========================================================================
   JEWEL THUMBNAILS
   ======================================================================== */

.jewel-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #C5A057;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f8f8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
}

.jewel-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(197, 160, 87, 0.4);
    border-color: #d4af37;
    z-index: 10;
}

.jewel-thumbnail:active {
    transform: scale(1.05);
}

/* Loading state (optional - add 'loading' class while fetching) */
.jewel-thumbnail.loading {
    opacity: 0.6;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

/* ========================================================================
   NO IMAGE PLACEHOLDER
   ======================================================================== */

.no-image-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #999;
    text-align: center;
    border: 2px solid #ddd;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    padding: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
}

/* ========================================================================
   TABLE COLUMN ADJUSTMENTS
   ======================================================================== */

/* Image column should be narrow and centered */
th.image-column,
td.image-column {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: center;
    vertical-align: middle;
    padding: 0.5rem;
}

/* Ensure table doesn't break layout */
th.image-column {
    font-weight: 700;
    background: #f7fafc;
    color: #C5A057;
}

/* ========================================================================
   RESPONSIVE (Mobile)
   ======================================================================== */

@media (max-width: 768px) {
    .jewel-thumbnail,
    .no-image-placeholder {
        width: 50px;
        height: 50px;
    }

    .no-image-placeholder {
        font-size: 8px;
    }

    th.image-column,
    td.image-column {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        padding: 0.25rem;
    }
}

@media (max-width: 480px) {
    .jewel-thumbnail,
    .no-image-placeholder {
        width: 40px;
        height: 40px;
    }

    .no-image-placeholder {
        font-size: 7px;
    }

    th.image-column,
    td.image-column {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
    }
}

/* ========================================================================
   LOADING SKELETON (Optional Enhancement)
   ======================================================================== */

.skeleton-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border: 2px solid #ddd;
    margin: 0 auto;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ========================================================================
   ACCESSIBILITY
   ======================================================================== */

/* Focus states for keyboard navigation */
.jewel-thumbnail:focus,
.jewel-thumbnail:focus-visible {
    outline: 3px solid #C5A057;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .jewel-thumbnail {
        border-width: 3px;
    }

    .no-image-placeholder {
        border-width: 3px;
        font-weight: 700;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .jewel-thumbnail,
    .jewel-thumbnail.loading,
    .skeleton-thumbnail {
        animation: none;
        transition: none;
    }

    .jewel-thumbnail:hover {
        transform: none;
    }
}

/* ========================================================================
   PRINT STYLES
   ======================================================================== */

@media print {
    .jewel-thumbnail,
    .no-image-placeholder {
        border: 1px solid #000;
        box-shadow: none;
    }

    .jewel-thumbnail:hover {
        transform: none;
        box-shadow: none;
    }
}
