/* Container */
.vega-carousel-container {
    position: relative;
    width: 100%;
    padding: 30px 0;
}

/* Wrapper */
.vega-carousel-wrapper {
    display: flex;
    gap: var(--gap, 30px);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Grid Mode */
.grid-mode .vega-carousel-wrapper {
    display: grid;
    grid-template-columns: repeat(var(--columns, 3), 1fr);
    gap: var(--gap, 30px);
}

/* Item */
.vega-item {
    flex: 0 0 calc((100% - (var(--gap, 30px) * (var(--columns, 3) - 1))) / var(--columns, 3));
    position: relative;
}

.grid-mode .vega-item {
    flex: none;
}

/* Item Link */
.vega-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Item Inner */
.vega-item-inner {
    position: relative;
    width: 100%;
    height: var(--height, 500px);
    border-radius: var(--radius, 20px);
    overflow: hidden;
    background: #000;
}

/* Image */
.vega-item-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.4s ease;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.vega-item:hover img {
    transform: scale(1.08);
    filter: brightness(0.7);
}

/* Overlay */
.vega-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0.7) 70%,
        rgba(0, 0, 0, 0.9) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.vega-item:hover .vega-overlay {
    opacity: 1;
}

/* Show text on hover only */
.hover-text .vega-overlay {
    opacity: 0;
}

.hover-text:hover .vega-overlay {
    opacity: 1;
}

/* Content */
.vega-content {
    position: relative;
    z-index: 2;
}

.vega-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 5px 0;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vega-item:hover .vega-content h3 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.vega-content p {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vega-item:hover .vega-content p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.15s;
}

/* Link Icon */
.vega-link {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 3;
    opacity: 0;
    transform: translateY(-10px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vega-item:hover .vega-link {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.2s;
}

.vega-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(0) rotate(45deg) scale(1.1);
}

.vega-link svg {
    transition: transform 0.3s ease;
}

.vega-link:hover svg {
    transform: rotate(-45deg);
}

/* Navigation Arrows */
.vega-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.vega-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-50%) scale(1.1);
}

.vega-prev {
    left: 20px;
}

.vega-next {
    right: 20px;
}

/* ========================================
   MODERN LIGHTBOX
======================================== */

.vega-lightbox-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.vega-lightbox-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Lightbox Container */
.vega-lightbox-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    animation: lightboxEnter 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes lightboxEnter {
    from {
        transform: scale(0.85) translateY(50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Lightbox Header */
.vega-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 20px 0;
    gap: 15px;
}

/* Image Info */
.vega-lightbox-info {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vega-lightbox-info svg {
    opacity: 0.7;
}

/* Button Group */
.vega-lightbox-buttons {
    display: flex;
    gap: 10px;
}

/* Lightbox Buttons */
.vega-lightbox-btn {
    position: relative;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.vega-lightbox-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vega-lightbox-btn:hover::before {
    opacity: 1;
}

.vega-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

/* Download Button Specific */
.vega-lightbox-download {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    border-color: rgba(59, 130, 246, 0.3);
}

.vega-lightbox-download:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(147, 51, 234, 0.3));
    border-color: rgba(59, 130, 246, 0.5);
}

.vega-lightbox-download.downloading {
    pointer-events: none;
    opacity: 0.6;
}

/* Close Button Specific */
.vega-lightbox-close:hover {
    transform: translateY(-2px) rotate(90deg);
}

/* Image Wrapper */
.vega-lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    overflow: hidden;
}

.vega-lightbox-content::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
    border-radius: 16px;
    pointer-events: none;
}

/* Lightbox Image */
.vega-lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    display: block;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Loading Spinner */
.vega-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    display: none;
}

.vega-lightbox-loading.active {
    display: block;
}

.vega-lightbox-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Tooltip */
.vega-lightbox-btn[title]::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.vega-lightbox-btn:hover[title]::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-mode .vega-carousel-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .carousel-mode .vega-item {
        flex: 0 0 calc(50% - 15px);
    }
    
    .vega-content h3 {
        font-size: 20px;
    }
    
    .vega-content p {
        font-size: 13px;
    }
    
    .vega-nav {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .vega-prev {
        left: 10px;
    }
    
    .vega-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .vega-carousel-container {
        padding: 20px 0;
    }
    
    .grid-mode .vega-carousel-wrapper {
        grid-template-columns: 1fr;
    }
    
    .carousel-mode .vega-item {
        flex: 0 0 100%;
    }
    
    .vega-item-inner {
        height: 400px;
    }
    
    .vega-overlay {
        padding: 20px;
    }
    
    .vega-content h3 {
        font-size: 18px;
    }
    
    .vega-content p {
        font-size: 12px;
    }
    
    .vega-link {
        width: 36px;
        height: 36px;
        top: 15px;
        right: 15px;
    }
    
    .vega-link svg {
        width: 16px;
        height: 16px;
    }
    
    .vega-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    /* Mobile Lightbox */
    .vega-lightbox-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .vega-lightbox-info {
        width: 100%;
        font-size: 12px;
        padding: 10px 15px;
    }
    
    .vega-lightbox-buttons {
        width: 100%;
        justify-content: flex-end;
    }
    
    .vega-lightbox-btn {
        width: 44px;
        height: 44px;
    }
    
    .vega-lightbox-content {
        padding: 15px;
    }
    
    .vega-lightbox-content img {
        max-height: 65vh;
    }
}

/* Smooth scrolling */
.carousel-mode .vega-carousel-wrapper {
    cursor: grab;
}

.carousel-mode .vega-carousel-wrapper:active {
    cursor: grabbing;
}

/* Disable text selection during drag */
.carousel-mode .vega-carousel-wrapper * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
