/* ===========================================
   EASY ALBUM GALLERY - MAIN STYLES
   Includes: Modal, Style 1 (Default)
   =========================================== */

/* ---- Base ---- */
.eag-gallery {
    padding: 20px 0;
}

/* ---- Style 1: Default Grid ---- */
.eag-style-default {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.eag-default-item {
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.eag-default-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.eag-default-image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.eag-default-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.eag-default-item:hover .eag-default-image img {
    transform: scale(1.08);
}

.eag-default-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.88) 0%, rgba(118, 75, 162, 0.88) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.eag-default-item:hover .eag-default-overlay {
    opacity: 1;
}

.eag-default-count {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.eag-default-info {
    padding: 18px 20px;
}

.eag-default-info h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
}

/* ---- Open Modal Button (shared) ---- */
.eag-open-modal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    background: rgba(255, 255, 255, 0.96);
    color: #667eea;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.eag-open-modal:hover {
    background: #fff;
    transform: scale(1.06);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

/* ============================================
   MODAL / LIGHTBOX - PREMIUM DESIGN
   ============================================ */

.eag-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.eag-modal.is-open {
    display: block;
}

.eag-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: eag-fade-in 0.3s ease;
}

@keyframes eag-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.eag-modal-dialog {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
    animation: eag-slide-up 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes eag-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close button */
.eag-modal-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.eag-modal-close:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 1);
    transform: rotate(90deg) scale(1.1);
}

/* Flickity slider inside modal */
.eag-modal-slider {
    width: 100%;
    max-width: 1100px;
    max-height: 80vh;
}

/* Each slide */
.eag-modal-slide {
    width: 100%;
    display: flex;
    align-items: stretch;
    background: rgba(18, 18, 18, 0.98);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    max-height: 80vh;
}

.eag-modal-slide.image-only {
    justify-content: center;
    background: transparent;
    border: none;
    box-shadow: none;
}

.eag-modal-image {
    flex: 1 1 60%;
    min-width: 0;
    overflow: hidden;
}

.eag-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-height: 80vh;
}

.eag-modal-slide.image-only .eag-modal-image img {
    object-fit: contain;
    border-radius: 12px;
}

.eag-modal-info {
    flex: 0 0 340px;
    padding: 40px 36px;
    overflow-y: auto;
    background: linear-gradient(160deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.eag-modal-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 16px;
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.eag-modal-desc {
    font-size: 15px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.82);
}

.eag-modal-desc p {
    margin: 0 0 12px;
}

/* Flickity nav buttons */
.eag-modal-slider .flickity-prev-next-button {
    width: 50px !important;
    height: 50px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease !important;
}

.eag-modal-slider .flickity-prev-next-button:hover {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-color: transparent !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.eag-modal-slider .flickity-prev-next-button .arrow {
    fill: #fff !important;
}

.eag-modal-slider .flickity-prev-next-button.previous {
    left: -70px !important;
}

.eag-modal-slider .flickity-prev-next-button.next {
    right: -70px !important;
}

/* Page dots */
.eag-modal-slider .flickity-page-dots {
    bottom: -36px !important;
}

.eag-modal-slider .flickity-page-dots .dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.35);
    transition: all 0.3s ease;
}

.eag-modal-slider .flickity-page-dots .dot.is-selected {
    background: #818cf8;
    width: 22px;
    border-radius: 4px;
}

/* ---- Responsive Modal ---- */
@media (max-width: 900px) {
    .eag-modal-slide {
        flex-direction: column;
        max-height: 88vh;
        overflow-y: auto;
    }

    .eag-modal-image {
        flex: none;
        height: 50vw;
        max-height: 300px;
    }

    .eag-modal-info {
        flex: none;
        padding: 28px 24px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .eag-modal-slider .flickity-prev-next-button.previous {
        left: 10px !important;
    }

    .eag-modal-slider .flickity-prev-next-button.next {
        right: 10px !important;
    }
}

@media (max-width: 600px) {
    .eag-modal-dialog {
        padding: 55px 10px 50px;
    }

    .eag-modal-image {
        height: 55vw;
    }

    .eag-modal-title {
        font-size: 20px;
    }

    .eag-modal-close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
    }
}

/* ---- Default gallery responsive ---- */
@media (max-width: 768px) {
    .eag-style-default {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .eag-style-default {
        grid-template-columns: 1fr;
    }
}