/* Look Inside Modal Styles */
.look-inside-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

.look-inside-modal.show {
    opacity: 1;
}

.look-inside-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 2vh auto;
    width: 90%;
    max-width: 1200px;
    height: 96vh;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.look-inside-modal-header {
    background: #fff;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.look-inside-modal-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
}

.look-inside-close {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.look-inside-close:hover,
.look-inside-close:focus {
    background: #e9ecef;
    color: #495057;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    outline: none;
}

.look-inside-close:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.look-inside-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    padding: 0;
}

#pdfContainer {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

.pdf-page {
    display: block;
    margin: 0 auto;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

.page-spacer {
    height: 20px;
}

#loadingMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#errorMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.pdf-nav-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.pdf-nav-btn:hover {
    background: #2980b9;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .look-inside-modal-content {
        margin: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .look-inside-modal-header {
        padding: 12px 15px;
    }

    .look-inside-modal-title {
        font-size: 1.2em;
    }

    #pdfContainer {
        padding: 10px;
    }

    .page-spacer {
        height: 15px;
    }

    .pdf-page {
        border-radius: 2px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    /* Improve touch scrolling */
    .look-inside-content {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    #pdfContainer {
        overscroll-behavior: contain;
        scroll-padding: 10px;
    }

    /* Better tap targets */
    .look-inside-close {
        padding: 8px;
        font-size: 28px;
    }
}

/* Tablet Styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .look-inside-modal-content {
        width: 95%;
        margin: 1vh auto;
        height: 98vh;
    }

    #pdfContainer {
        padding: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .look-inside-modal-content {
        background-color: #1a1a1a;
    }

    .look-inside-modal-header {
        background: #1a1a1a;
        border-bottom-color: #333;
    }

    .look-inside-modal-title {
        color: #fff;
    }

    .look-inside-close {
        color: #999;
    }

    .look-inside-close:hover {
        color: #fff;
    }

    .look-inside-content {
        background: #141414;
    }

    #loadingMessage,
    #errorMessage {
        background: rgba(26, 26, 26, 0.95);
        color: #fff;
    }

    .loading-spinner {
        border-color: #333;
        border-top-color: #3498db;
    }
}

/* Position relative container for the button */
.woocommerce-product-gallery {
    position: relative;
}

.look-inside-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    margin: 0;
    display: inline-block;
    padding: 8px 15px;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.4;
    text-transform: none;
    font-weight: normal;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background-color: #000;
}

.look-inside-button:hover {
    background-color: rgba(44, 51, 56, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.woocommerce-product-gallery__wrapper {
    position: relative;
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    .look-inside-button {
        padding: 6px 12px;
        font-size: 13px;
    }
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 2px;
    border-radius: 3px;
    margin-right: 8px;
}

.zoom-btn {
    background: none;
    border: none;
    color: #333;
    width: 18px;
    height: 18px;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    min-width: unset;
}

.zoom-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

.zoom-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.zoom-btn:active {
    background: rgba(0, 0, 0, 0.2);
}

.zoom-level {
    font-size: 11px;
    color: #666;
    min-width: 32px;
    text-align: center;
    padding: 0 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .zoom-controls {
        background: rgba(255, 255, 255, 0.05);
    }

    .zoom-btn {
        color: #fff;
    }

    .zoom-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .zoom-btn:active {
        background: rgba(255, 255, 255, 0.2);
    }

    .zoom-level {
        color: #999;
    }
}

/* Mobile styles */
@media screen and (max-width: 768px) {
    .modal-controls {
        gap: 10px;
    }

    .zoom-controls {
        padding: 1px;
        gap: 1px;
    }

    .zoom-btn {
        width: 16px;
        height: 16px;
        font-size: 12px;
    }

    .zoom-level {
        font-size: 10px;
        min-width: 28px;
    }
}
