.preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.preview-modal-overlay.show {
    display: flex;
}

.preview-modal-container {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.preview-modal-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 0, 0, 0.9);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    transition: all 0.2s;
    line-height: 1;
}

.preview-modal-close:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.preview-modal-body {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(26, 92, 140, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.2s;
    border-radius: 50%;
}

.preview-modal-nav:hover {
    background: rgba(26, 92, 140, 1);
    transform: translateY(-50%) scale(1.1);
}

.preview-modal-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.preview-modal-nav:disabled {
    background: rgba(100, 100, 100, 0.3);
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.3);
}

.preview-modal-nav.prev {
    left: -10px;
}

.preview-modal-nav.next {
    right: -10px;
}

.preview-modal-img {
    max-width: 100%;
    max-height: 85vh;
    height: auto;
    display: block;
}

.preview-modal-canvas {
    max-width: 100%;
    max-height: 85vh;
    height: auto;
    display: block;
}

.preview-modal-loading {
    color: #666;
    font-size: 14px;
    padding: 20px;
}

.preview-modal-page-info {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.preview-modal-download {
    position: absolute;
    bottom: -30px;
    right: 0;
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(26, 92, 140, 0.8);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
}

.preview-modal-download::before {
    content: "↓";
    margin-right: 4px;
}

@media (max-width: 767px) {
    .preview-modal-container {
        max-width: 95%;
        max-height: 95%;
    }

    .preview-modal-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
        top: -14px;
        right: -14px;
    }

    .preview-modal-nav {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .preview-modal-nav.prev {
        left: 5px;
    }

    .preview-modal-nav.next {
        right: 5px;
    }

    .preview-modal-img, .preview-modal-canvas {
        max-height: 75vh;
    }

    .preview-modal-page-info {
        bottom: -28px;
        font-size: 11px;
    }

    .preview-modal-download {
        bottom: -28px;
        font-size: 10px;
        padding: 2px 8px;
    }
}
