/* Gallery Section */
.gallery {
    position: relative;
    padding: 100px 0;
    background: linear-gradient(
        135deg,
        var(--black-light) 0%,
        var(--black) 100%
    );
    background-attachment: fixed;
    overflow: hidden;
}

.gallery::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("../logo.png") center/contain no-repeat;
    background-attachment: fixed;
    opacity: 0.03;
    z-index: 0;
}

.gallery .container {
    position: relative;
    z-index: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    min-height: 250px;
    max-height: 400px;
    aspect-ratio: 4/3;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    background: var(--black-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    min-width: 200px;
    min-height: 200px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    z-index: 3;
}

.gallery-overlay span {
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
}

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

.gallery-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(244, 167, 53, 0) 0%,
        rgba(244, 167, 53, 0.3) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.gallery-item:hover {
    transform: scale(1.08) translateY(-5px);
    box-shadow: 0 20px 40px rgba(244, 167, 53, 0.4);
}

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

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        var(--black) 0%,
        var(--black-light) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.gallery-placeholder::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(244, 167, 53, 0.1) 10px,
        rgba(244, 167, 53, 0.1) 20px
    );
    animation: slide 20s linear infinite;
}

@keyframes slide {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.gallery-placeholder span {
    position: relative;
    z-index: 1;
}

/* Gallery Modal/Popup */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    animation: zoomIn 0.3s ease;
}

.gallery-modal-content img {
    width: 100%;
    height: 100%;
    min-width: 300px;
    min-height: 300px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(244, 167, 53, 0.3);
    display: block;
}

.gallery-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--gold);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    border: 2px solid var(--gold);
}

.gallery-modal-close:hover {
    background: var(--gold);
    color: var(--black);
    transform: rotate(90deg);
}

.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--gold);
    border: 2px solid var(--gold);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10001;
}

.gallery-modal-nav:hover {
    background: var(--gold);
    color: var(--black);
    transform: translateY(-50%) scale(1.1);
}

.gallery-modal-prev {
    left: 20px;
}

.gallery-modal-next {
    right: 20px;
}

.gallery-modal-info {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    text-align: center;
    font-size: 1.1rem;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* RTL Support for Gallery Modal */
[dir="rtl"] .gallery-modal-close {
    right: auto;
    left: 0;
}

[dir="rtl"] .gallery-modal-prev {
    left: auto;
    right: 20px;
}

[dir="rtl"] .gallery-modal-next {
    right: auto;
    left: 20px;
}
