/* ==========================================================
   Modern Image Preview & Lightbox Styles
   File: css/image-preview.css
   ========================================================== */

/* Preview Trigger styling on cards */
.img-holder,
.project-post-image,
.tt-gallery-1 {
    position: relative;
}

.img-holder .project-post-image,
.tt-gallery-1 .project-post-image {
    position: relative;
    overflow: hidden;
}

/* Dedicated preview icon button on cards */
.preview-badge-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #019bb3;
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    opacity: 0.9;
    transform: scale(0.95);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    outline: none;
    padding: 0;
    margin: 0;
}

.preview-badge-hint svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.preview-badge-hint:hover {
    background: #007d91;
    color: #ffffff;
    transform: scale(1.15) !important;
    box-shadow: 0 0 20px rgba(1, 155, 179, 0.85);
    opacity: 1 !important;
}

.preview-badge-hint:active {
    transform: scale(0.92) !important;
}

/* Modal Overlay */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 25, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
}

.preview-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Top Bar: Counter & Close Button */
.preview-topbar {
    position: absolute;
    top: 22px;
    left: 28px;
    right: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
    pointer-events: none;
}

.preview-counter {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 7px 18px;
    border-radius: 22px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.preview-close-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    outline: none;
    border: none;
}

.preview-close-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s ease;
}

.preview-close-btn:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
}

.preview-close-btn:hover svg {
    transform: rotate(90deg);
}

/* Navigation Buttons (Left & Right) */
.preview-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    outline: none;
}

.preview-nav-btn svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.preview-nav-prev {
    left: 28px;
}

.preview-nav-prev:hover {
    background: #019bb3;
    border-color: #019bb3;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 24px rgba(1, 155, 179, 0.7);
}

.preview-nav-prev:hover svg {
    transform: translateX(-3px);
}

.preview-nav-next {
    right: 28px;
}

.preview-nav-next:hover {
    background: #019bb3;
    border-color: #019bb3;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 24px rgba(1, 155, 179, 0.7);
}

.preview-nav-next:hover svg {
    transform: translateX(3px);
}

/* Image Content Container */
.preview-content {
    max-width: 86vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.preview-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 150px;
}

.preview-image {
    max-width: 84vw;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-image.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Spinner while loading */
.preview-spinner {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 3.5px solid rgba(255, 255, 255, 0.15);
    border-top-color: #019bb3;
    border-radius: 50%;
    animation: preview-spin 0.75s linear infinite;
    display: none;
}

.preview-spinner.active {
    display: block;
}

@keyframes preview-spin {
    to { transform: rotate(360deg); }
}

/* Caption and Action Bar */
.preview-caption-bar {
    margin-top: 16px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 26px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    max-width: 80vw;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    transition: opacity 0.25s ease;
}

.preview-caption-title {
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.preview-caption-link {
    background: #019bb3;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 5px 15px;
    border-radius: 14px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.preview-caption-link:hover {
    background: #02b6d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(1, 155, 179, 0.55);
}

/* Keyboard Hints */
.preview-hints {
    position: absolute;
    bottom: 14px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 10;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .preview-nav-btn {
        width: 44px;
        height: 44px;
    }
    .preview-nav-btn svg {
        width: 22px;
        height: 22px;
    }
    .preview-nav-prev { left: 10px; }
    .preview-nav-next { right: 10px; }
    .preview-topbar { top: 12px; left: 14px; right: 14px; }
    .preview-close-btn { width: 40px; height: 40px; }
    .preview-counter { font-size: 12px; padding: 5px 14px; }
    .preview-image { max-height: 64vh; max-width: 92vw; }
    .preview-caption-bar { font-size: 13px; padding: 8px 16px; max-width: 92vw; }
    .preview-hints { display: none; }
    .preview-badge-hint {
        width: 36px;
        height: 36px;
        bottom: 8px;
        right: 8px;
    }
}
