/* gallery.css */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #1A6FA6;
    --light-color: #f9f9f9;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* تنسيق رأس القسم */
.section-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent-color);
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray-color);
    max-width: 600px;
    margin: 15px auto 0;
}

/* تصميم معرض الصور */
.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.gallery-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 160px;
    gap: 14px;
    padding: 12px;

    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;

    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* إخفاء الاسكرول بار بشكل أنيق */
.gallery-grid::-webkit-scrollbar {
    height: 6px;
}

.gallery-grid::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

/* عنصر الصورة */
.grid-item {
    scroll-snap-align: start;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

/* الصورة نفسها */
.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

/* Hover ناعم واحترافي */
.grid-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.grid-item:hover img {
    transform: scale(1.08);
}

/* العنصر النشط */
.grid-item.active {
    box-shadow: 0 0 0 3px var(--accent-color);
}


.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    height: 140px;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.grid-item.active {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px var(--accent-color), 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.grid-item.active img {
    filter: brightness(1.1);
}

/* تصميم السلايدر */
.gallery-slider {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.slider-container {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-content-gallery {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    color: white;
    padding: 30px;
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.slide.active .slide-content-gallery {
    transform: translateY(0);
}

.slide-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: white;
}

.slide-description {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
    max-width: 800px;
}

/* عناصر التحكم بالسلايدر */
.slider-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    background-color: var(--primary-color);
    color: white;
}

.slider-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.slider-btn:hover {
    background-color: #16a085;
    transform: scale(1.1);
}

.slider-indicators {
    display: flex;
    gap: 10px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.indicator.active {
    background-color: var(--accent-color);
    transform: scale(1.2);
}

.auto-play-btn {
    background-color: transparent;
    color: white;
    border: 2px solid var(--accent-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.auto-play-btn:hover {
    background-color: var(--accent-color);
}

/* تذييل المعلومات */
.gallery-info {
    margin-top: 30px;
    text-align: center;
    padding: 15px;
    background-color: rgba(26, 188, 156, 0.1);
    border-radius: 10px;
    border-right: 4px solid var(--accent-color);
}

.info-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary-color);
    font-size: 1rem;
}

.info-note i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* تصميم متجاوب */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        height: auto;
        min-height: 150px;
    }
    
    .grid-item {
        height: 120px;
    }
    
    .slider-container {
        height: 450px;
    }
    
    .slide-title {
        font-size: 1.6rem;
    }
    
    .slide-description {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .slider-container {
        height: 400px;
    }
    
    .slide-content-gallery {
        padding: 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .slider-controls {
        padding: 10px 20px;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .slider-container {
        height: 350px;
    }
    
    .slide-title {
        font-size: 1.4rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .slider-btn, .auto-play-btn {
        width: 40px;
        height: 40px;
    }
}