/* Gallery Section Styles - Mobile First & Dazzling */

.gallery-masonry {
    column-count: 3;
    column-gap: 1.5rem;
    padding: 1rem 0;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;

    /* Mobile Pulse Animation */
    animation: pulseGlow 4s infinite ease-in-out;
}

/* Stagger animations for variety */
.gallery-item:nth-child(even) {
    animation-delay: 1s;
}

.gallery-item:nth-child(3n) {
    animation-delay: 2s;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 0 25px rgba(124, 58, 237, 0.4);
        border-color: rgba(124, 58, 237, 0.5);
    }
}

.gallery-item img {
    height: auto;
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
    border-radius: 20px;
    
    /* قص الصور لإخفاء شريط المهام والإطارات */
    object-fit: cover;
    object-position: center center;
    min-height: 300px;
}

/* قص خاص للصور المعيبة (app-*.png) */
.gallery-item a[href*="app-"] img {
    object-fit: cover;
    object-position: center 45%; /* قص من الأعلى والأسفل */
    transform: scale(1.15); /* تكبير خفيف لإخفاء الحواف */
}

/* Auto-Shine Effect Overlay */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-25deg);
    animation: shine 6s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

/* Hover Effects (for Desktop) */
.gallery-item:hover {
    transform: translateY(-5px);
    z-index: 10;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(124, 58, 237, 0.4);
    border-color: var(--accent-color);
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(124, 58, 237, 0.8), rgba(30, 41, 59, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

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

.gallery-overlay i {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
}

/* Holographic Text Utility */
.holographic-text {
    background: linear-gradient(to right, #ffffff, #a5b4fc, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(165, 180, 252, 0.4);
}

.text-glow {
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

/* Responsive Columns */
/* Gallery Section Styles - Mobile First & Dazzling */

.gallery-masonry {
    column-count: 3;
    column-gap: 1.5rem;
    padding: 1rem 0;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;

    /* Mobile Pulse Animation */
    animation: pulseGlow 4s infinite ease-in-out;
}

/* Stagger animations for variety */
.gallery-item:nth-child(even) {
    animation-delay: 1s;
}

.gallery-item:nth-child(3n) {
    animation-delay: 2s;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow: 0 0 25px rgba(124, 58, 237, 0.4);
        border-color: rgba(124, 58, 237, 0.5);
    }
}

.gallery-item img {
    height: auto;
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
    border-radius: 20px;
}

/* Auto-Shine Effect Overlay */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-25deg);
    animation: shine 6s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

/* Hover Effects (for Desktop) */
.gallery-item:hover {
    transform: translateY(-5px);
    z-index: 10;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(124, 58, 237, 0.4);
    border-color: var(--accent-color);
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(124, 58, 237, 0.8), rgba(30, 41, 59, 0.4));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

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

.gallery-overlay i {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
}

/* Holographic Text Utility */
.holographic-text {
    background: linear-gradient(to right, #ffffff, #a5b4fc, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(165, 180, 252, 0.4);
}

.text-glow {
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

/* Responsive Columns */
@media (max-width: 992px) {
    .gallery-masonry {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .gallery-masonry {
        column-count: 1;
    }

    /* Enhance mobile visibility */
    .gallery-item {
        margin-bottom: 1.5rem;
    }
}