/**
 * Frontend Styles for SampleShots Gallery
 */

/* Gallery Wrapper */
.sampleshots-gallery-wrapper {
    margin: 30px 0;
}

/* Gallery Header */
.sampleshots-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.sampleshots-gallery-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.sampleshots-gallery-link {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.sampleshots-gallery-link:hover {
    color: #005177;
    text-decoration: underline;
}

/* Gallery Grid */
.sampleshots-gallery-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, 1fr);
}

.sampleshots-gallery-grid[data-columns="1"] {
    grid-template-columns: repeat(1, 1fr);
}

.sampleshots-gallery-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.sampleshots-gallery-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.sampleshots-gallery-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.sampleshots-gallery-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.sampleshots-gallery-grid[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sampleshots-gallery-grid,
    .sampleshots-gallery-grid[data-columns="2"],
    .sampleshots-gallery-grid[data-columns="3"],
    .sampleshots-gallery-grid[data-columns="4"],
    .sampleshots-gallery-grid[data-columns="5"],
    .sampleshots-gallery-grid[data-columns="6"] {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .sampleshots-gallery-grid,
    .sampleshots-gallery-grid[data-columns="2"],
    .sampleshots-gallery-grid[data-columns="3"],
    .sampleshots-gallery-grid[data-columns="4"],
    .sampleshots-gallery-grid[data-columns="5"],
    .sampleshots-gallery-grid[data-columns="6"] {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .sampleshots-gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Gallery Item */
.sampleshots-gallery-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.sampleshots-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.sampleshots-gallery-link-image {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 5 / 7;
    background: #f0f0f0;
}

.sampleshots-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.sampleshots-gallery-item:hover .sampleshots-gallery-image {
    transform: scale(1.05);
}

/* Gallery Overlay */
.sampleshots-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.sampleshots-gallery-link-image:hover .sampleshots-gallery-overlay {
    opacity: 1;
}

.sampleshots-gallery-zoom-icon {
    font-size: 32px;
    color: white;
}

/* Gallery Caption */
.sampleshots-gallery-caption {
    padding: 12px 15px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.sampleshots-gallery-caption a {
    color: #0073aa;
    text-decoration: none;
}

.sampleshots-gallery-caption a:hover {
    text-decoration: underline;
}

/* View More Button */
.sampleshots-gallery-view-more {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.sampleshots-view-more-btn {
    display: inline-block;
    padding: 14px 32px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sampleshots-view-more-btn:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

/* Error/Empty States */
.sampleshots-gallery-error,
.sampleshots-gallery-empty {
    padding: 40px 20px;
    text-align: center;
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #666;
}

.sampleshots-gallery-error {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* ===========================
   LIGHTBOX MODAL STYLES
   =========================== */

/* Override ALL WordPress layout constraints */
.sampleshots-lightbox,
.is-layout-constrained > .sampleshots-lightbox,
.is-layout-flow > .sampleshots-lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    z-index: 999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    transform: none !important;
}

/* Override WordPress layout constraints for overlay too */
.sampleshots-lightbox-overlay,
.is-layout-constrained > .sampleshots-lightbox > .sampleshots-lightbox-overlay,
.is-layout-flow > .sampleshots-lightbox > .sampleshots-lightbox-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.95);
}

.sampleshots-lightbox-content {
    position: relative !important;
    z-index: 1000000;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    padding: 60px 20px 20px 20px;
    box-sizing: border-box;
}

/* Lightbox Controls */
.sampleshots-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    padding: 10px;
    z-index: 1000001;
    transition: opacity 0.2s;
    border-radius: 4px;
}

.sampleshots-lightbox-close:hover {
    opacity: 0.7;
}

.sampleshots-lightbox-prev,
.sampleshots-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 60px;
    line-height: 1;
    cursor: pointer;
    padding: 20px 15px;
    z-index: 1000001;
    transition: background 0.2s;
    border-radius: 4px;
}

.sampleshots-lightbox-prev:hover,
.sampleshots-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sampleshots-lightbox-prev {
    left: 20px;
}

.sampleshots-lightbox-next {
    right: 20px;
}

/* Image Container */
.sampleshots-lightbox-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.sampleshots-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    transition: opacity 0.3s;
}

.sampleshots-lightbox-image.zoom-fit {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sampleshots-lightbox-image.zoom-actual {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
}

/* Zoom Controls */
.sampleshots-lightbox-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.sampleshots-lightbox-zoom-fit,
.sampleshots-lightbox-zoom-actual {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.sampleshots-lightbox-zoom-fit:hover,
.sampleshots-lightbox-zoom-actual:hover,
.sampleshots-lightbox-zoom-fit.active,
.sampleshots-lightbox-zoom-actual.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Caption */
.sampleshots-lightbox-caption {
    padding: 20px;
    text-align: center;
    color: white;
    font-size: 14px;
}

.sampleshots-lightbox-caption a {
    color: #66b3ff;
    text-decoration: none;
}

.sampleshots-lightbox-caption a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sampleshots-lightbox-content {
        width: 100vw;
        height: 100vh;
    }

    .sampleshots-lightbox-prev,
    .sampleshots-lightbox-next {
        font-size: 40px;
        padding: 15px 10px;
    }

    .sampleshots-lightbox-prev {
        left: 10px;
    }

    .sampleshots-lightbox-next {
        right: 10px;
    }

    .sampleshots-lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }

    .sampleshots-lightbox-controls {
        bottom: 80px;
        right: 50%;
        transform: translateX(50%);
    }

    .sampleshots-lightbox-caption {
        padding: 15px;
        font-size: 13px;
    }
}
