/* ============================================
   IMAGE CAROUSEL STYLES
   ============================================ */

.image-carousel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(4px);
}

.carousel-container {
    position: relative;
    width: 90%;
    max-width: 1400px;
    height: 90%;
    margin: 5% auto;
    background: #1a1a1a;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #333;
    background: linear-gradient(to bottom, #222, #1a1a1a);
}

.carousel-header h3 {
    color: #fff;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.carousel-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.carousel-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    gap: 24px;
    position: relative;
    min-height: 0;
}

.carousel-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.carousel-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-out;
    transform-origin: center center;
}

.carousel-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    user-select: none;
    pointer-events: none;
}

/* Scale down high-res PDFs (rendered at 2.5x) to display at larger size */
.carousel-image.pdf-image {
    max-width: none;
    max-height: 90vh;
    width: 70%;
    height: auto;
}

.carousel-image-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10;
}

.carousel-loader p {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.spinner {
    width: 64px;
    height: 64px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.carousel-prev,
.carousel-next {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 16px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 56px;
}

.carousel-prev:hover:not(:disabled),
.carousel-next:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.carousel-prev:active:not(:disabled),
.carousel-next:active:not(:disabled) {
    transform: scale(0.95);
}

.carousel-prev:disabled,
.carousel-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-prev svg,
.carousel-next svg {
    width: 24px;
    height: 24px;
}

.carousel-footer {
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #333;
    background: linear-gradient(to top, #222, #1a1a1a);
}

.carousel-left-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.carousel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 24px;
    border-right: 1px solid #444;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.action-btn:hover {
    background: rgba(14, 165, 233, 0.3);
    /* Blue tint on hover */
    color: #0ea5e9;
    transform: scale(1.05);
}

.action-btn:active {
    transform: scale(0.95);
}

.carousel-zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-level {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.carousel-counter {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-container {
        width: 95%;
        height: 95%;
        margin: 2.5% auto;
    }

    .carousel-header {
        padding: 16px 20px;
    }

    .carousel-header h3 {
        font-size: 16px;
    }

    .carousel-body {
        padding: 16px;
        gap: 12px;
    }

    .carousel-prev,
    .carousel-next {
        min-width: 44px;
        height: 44px;
        padding: 12px;
    }

    .carousel-prev svg,
    .carousel-next svg {
        width: 20px;
        height: 20px;
    }
}