/* ==========================================================================
   Smart Filter Gallery - Core Layout & Grid
   ========================================================================== */

.ea-advanced-gallery {
    width: 100%;
    box-sizing: border-box;
}

/* Filter Navigation */
.ea-gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    align-items: center;
}

.ea-filter-btn {
    border: 1px solid transparent;
    background: #f1f5f9;
    color: #334155;
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition-property: color, background-color, border-color, box-shadow, transform;
    transition-duration: 0.3s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ea-filter-btn i,
.ea-filter-btn svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.ea-filter-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ea-filter-btn.is-active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* ==========================================================================
   Gallery Grid System - Dynamic Repeater Responsive Engine
   ========================================================================== */

.ea-gallery-grid {
    display: grid !important;
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ea-gallery-grid.ea-grid-loaded {
    opacity: 1;
}

/* Gallery Items */
.ea-gallery-item {
    box-sizing: border-box;
    will-change: transform, opacity;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animating Out (Hiding) */
.ea-gallery-item.ea-animating-out {
    opacity: 0 !important;
    transform: scale(0.85) !important;
}

/* Completely Hidden */
.ea-gallery-item.is-hidden {
    display: none !important;
}

/* Animating In (Showing) */
.ea-gallery-item.ea-animating-in {
    animation: eaScaleFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes eaScaleFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.85);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.ea-gallery-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* ==========================================================================
   Aspect Ratio System
   ========================================================================== */

.ea-gallery-item-media {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0f172a;
}

.ea-media-trigger {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: block;
}

.ea-gallery-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ea-ratio-1-1  { aspect-ratio: 1 / 1; }
.ea-ratio-4-3  { aspect-ratio: 4 / 3; }
.ea-ratio-3-2  { aspect-ratio: 3 / 2; }
.ea-ratio-16-9 { aspect-ratio: 16 / 9; }
.ea-ratio-original { height: auto; }

/* Link Wrappers */
.ea-item-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ==========================================================================
   Hover Animation Effects
   ========================================================================== */

/* Zoom In */
.ea-hover-zoom:hover .ea-gallery-item-media img { 
    transform: scale(1.08); 
}

/* Zoom Out */
.ea-hover-zoom-out .ea-gallery-item-media img { 
    transform: scale(1.08); 
}
.ea-hover-zoom-out:hover .ea-gallery-item-media img { 
    transform: scale(1); 
}

/* Lift Up */
.ea-hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ea-hover-lift:hover { 
    transform: translateY(-6px); 
}

/* ==========================================================================
   Video Item & Play Button Overlay
   ========================================================================== */

.ea-video-trigger {
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    cursor: pointer;
    text-align: left;
    position: relative;
    display: block;
    outline: none;
}

.ea-play-icon-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 52px;
    color: #ffffff;
    z-index: 5;
    pointer-events: none;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}

.ea-play-icon-wrapper i,
.ea-play-icon-wrapper svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.ea-video-trigger:hover .ea-play-icon-wrapper {
    transform: translate(-50%, -50%) scale(1.15);
}

/* Item Caption */
.ea-item-caption {
    padding-top: 10px;
    font-size: 14px;
    color: #475569;
    line-height: 1.4;
}

/* ==========================================================================
   Pure Frameless Video / Image Popup Modal
   ========================================================================== */

.ea-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ea-video-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Dark Blurred Overlay */
.ea-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 10, 20, 0.90);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Wrapper for Container + External Bottom Caption */
.ea-modal-wrapper {
    position: relative;
    width: 88%;
    max-width: 960px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Completely Transparent & Frameless Container */
.ea-modal-container {
    position: relative;
    width: 100%;
    background: transparent !important;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none !important;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ea-video-modal.is-open .ea-modal-container {
    transform: scale(1);
}

/* Modern External Close Button */
.ea-modal-close {
    position: fixed;
    top: 25px;
    right: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    padding: 0;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ea-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    transform: scale(1.08);
}

.ea-modal-close:hover svg {
    transform: rotate(90deg);
}

/* Prev / Next Arrow Navigation Controls */
.ea-modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    padding: 0;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ea-modal-prev { left: 30px; }
.ea-modal-next { right: 30px; }

.ea-modal-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

/* Frameless Media Frame */
.ea-modal-content {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: transparent !important;
}

.ea-modal-content.ea-is-image {
    padding-bottom: 0;
    height: auto;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ea-modal-content img.ea-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.ea-modal-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* External Floating Caption Below Modal Box */
.ea-modal-caption-external {
    margin-top: 20px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    max-width: 90%;
}

/* Mobile Adjustments for Lightbox Navigation */
@media (max-width: 767px) {
    .ea-modal-prev { left: 12px; width: 40px; height: 40px; }
    .ea-modal-next { right: 12px; width: 40px; height: 40px; }
    .ea-modal-close { top: 15px; right: 15px; width: 38px; height: 38px; }
}