/* Image Zoom Modal Styles */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-zoom-modal.active {
    opacity: 1;
    visibility: visible;
}

.zoom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.zoom-modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
}

.zoom-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    font-size: 16px;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.zoom-btn:active {
    transform: translateY(0);
}

.zoom-image-container {
    flex: 1;
    overflow: hidden;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 95vw;
    height: 95vh;
    position: relative;
    background: rgba(20, 20, 20, 0.3);
    border-radius: 8px;
}

.zoom-image-container:active {
    cursor: grabbing;
}

.zoom-image {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    transition: transform 0.1s ease, opacity 0.3s ease;
    transform-origin: center;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 1;
    border-radius: 4px;
    display: none;
}

/* Loading indicator */
.zoom-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    color: white;
    font-size: 1rem;
}

.zoom-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #00cc88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.zoom-instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    opacity: 0.8;
}

/* Flowchart Images in Case Studies */
.flowchart-image,
.case-study-image,
.diagram-image,
.case-study img,
.blog img,
.whitepaper img,
.content img,
.single-page .content img,
main.content img {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

.flowchart-image:hover,
.case-study-image:hover,
.diagram-image:hover,
.case-study img:hover,
.blog img:hover,
.whitepaper img:hover,
.content img:hover,
.single-page .content img:hover,
main.content img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Image container for better styling */
.image-container {
    position: relative;
    display: inline-block;
    width: 100%;
    margin: 20px 0;
    text-align: center;
}

.image-container::after {
    content: "🔍 Click to zoom";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.image-container:hover::after {
    opacity: 1;
}

/* Image caption styling */
.image-caption {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-align: center;
    line-height: 1.4;
}

/* Dark mode caption */
@media (prefers-color-scheme: dark) {
    .image-caption {
        color: #ccc;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .zoom-controls {
        top: 10px;
        right: 10px;
        padding: 8px;
        gap: 8px;
    }
    
    .zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .zoom-instructions {
        bottom: 10px;
        font-size: 0.8rem;
        padding: 6px 12px;
        text-align: center;
    }
    
    .zoom-modal-content {
        max-width: 98vw;
        max-height: 98vh;
    }
    
    .zoom-image-container {
        width: 98vw;
        height: 98vh;
    }
    
    .zoom-image {
        width: 100%;
        height: 100%;
    }
    
    .zoom-instructions span {
        display: block;
        line-height: 1.3;
    }
    
    .image-container::after {
        content: "📱 Tap to zoom";
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .zoom-controls {
        top: 5px;
        right: 5px;
        padding: 6px;
        gap: 6px;
    }
    
    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .zoom-instructions {
        bottom: 5px;
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Loading state for images */
.zoom-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zoom-image.loaded {
    opacity: 1;
}

/* Enhanced visual feedback */
.zoom-btn.zoom-in:hover::before {
    content: "Zoom In";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.zoom-btn.zoom-out:hover::before {
    content: "Zoom Out";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.zoom-btn.zoom-reset:hover::before {
    content: "Reset";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
}

.zoom-btn.zoom-close:hover::before {
    content: "Close";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* Custom scrollbar for when content overflows */
.zoom-image-container::-webkit-scrollbar {
    display: none;
}

.zoom-image-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Animation for modal entrance */
@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-zoom-modal.active .zoom-modal-content {
    animation: modalEnter 0.3s ease-out;
}

/* Dark theme compatibility */
@media (prefers-color-scheme: dark) {
    .image-zoom-modal {
        background: rgba(0, 0, 0, 0.98);
    }
    
    .zoom-controls {
        background: rgba(20, 20, 20, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .zoom-btn {
        background: rgba(40, 40, 40, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .zoom-btn:hover {
        background: rgba(60, 60, 60, 0.9);
    }
}