/* ==================== PROJECT IMAGE GALLERY ==================== */
/* Professional gallery with lightbox, filters, and animations */

/* ==================== GALLERY SECTION ==================== */
.projects-gallery {
    padding: 100px 0;
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}

/* ==================== FILTER BUTTONS ==================== */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 30px;
    border: 2px solid #E5E7EB;
    background: white;
    color: #6B7280;
    font-size: 15px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.filter-btn:hover {
    border-color: #0F3057;
    color: #0F3057;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 48, 87, 0.15);
}

.filter-btn.active {
    background: linear-gradient(135deg, #0F3057, #0A2240);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(15, 48, 87, 0.3);
}

/* ==================== GALLERY GRID ==================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== GALLERY ITEM ==================== */
.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 300px;
}

.gallery-item.hidden {
    display: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover img {
    transform: scale(1.15);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ==================== GALLERY OVERLAY ==================== */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.7) 70%,
        rgba(0, 0, 0, 0.9) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-overlay h4 {
    color: white;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
    font-family: 'Poppins', sans-serif;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
}

.gallery-item:hover .gallery-overlay h4 {
    transform: translateY(0);
}

.gallery-overlay p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 15px;
    transform: translateY(20px);
    transition: transform 0.3s ease 0.15s;
}

.gallery-item:hover .gallery-overlay p {
    transform: translateY(0);
}

.view-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #0F3057;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover .view-btn {
    transform: translate(-50%, -50%) scale(1);
}

.view-btn:hover {
    background: #0F3057;
    color: white;
    transform: translate(-50%, -50%) scale(1.1);
}

/* ==================== LIGHTBOX ==================== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-image {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: imageZoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes imageZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================== LIGHTBOX CONTROLS ==================== */
.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:active,
.lightbox-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* ==================== LIGHTBOX CAPTION ==================== */
.lightbox-caption {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 50px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 80%;
    text-align: center;
    animation: captionSlideUp 0.5s ease 0.2s both;
}

@keyframes captionSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ==================== LOADING SKELETON ==================== */
.gallery-item.loading {
    background: linear-gradient(
        90deg,
        #F3F4F6 25%,
        #E5E7EB 50%,
        #F3F4F6 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==================== EMPTY STATE ==================== */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: #9CA3AF;
}

.gallery-empty i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.gallery-empty h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #6B7280;
}

.gallery-empty p {
    font-size: 16px;
}

/* ==================== IMAGE COUNTER ==================== */
.image-counter {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10001;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .gallery-item {
        height: 280px;
    }
}

@media (max-width: 768px) {
    .projects-gallery {
        padding: 60px 0;
    }

    .gallery-filters {
        gap: 10px;
        margin-bottom: 30px;
    }

    .filter-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .gallery-item {
        height: 200px;
        border-radius: 12px;
    }

    .gallery-overlay {
        padding: 15px;
    }

    .gallery-overlay h4 {
        font-size: 16px;
    }

    .gallery-overlay p {
        font-size: 13px;
    }

    .view-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .lightbox-image {
        max-width: 95%;
        max-height: 70vh;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-caption {
        bottom: 20px;
        padding: 12px 20px;
        font-size: 14px;
        max-width: 90%;
    }

    .image-counter {
        top: 15px;
        left: 15px;
        padding: 8px 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-item {
        height: 250px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* ==================== TOUCH GESTURES ==================== */
@media (hover: none) and (pointer: coarse) {
    .gallery-item:hover .gallery-overlay {
        opacity: 0;
    }

    .gallery-item.touch-active .gallery-overlay {
        opacity: 1;
    }

    .view-btn {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }

    .gallery-item:hover .view-btn {
        opacity: 1;
    }
}

/* ==================== ACCESSIBILITY ==================== */
.gallery-item:focus,
.filter-btn:focus,
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 3px solid #D9A441;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-item img,
    .lightbox-image,
    .filter-btn {
        transition: none;
        animation: none;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .gallery-filters,
    .lightbox {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-item {
        page-break-inside: avoid;
    }
}
