/* ============================================
   Gallery Grids for Buses and Hotels
   ============================================ */

/* شبكة صور الباصات والفنادق على الموقع */
.gallery-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.gallery-section.hotels {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
}

.gallery-section.buses {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.gallery-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* هيدر المعرض */
.gallery-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.gallery-section .section-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4a9b8e, #5fb3a3);
    color: white;
    padding: 0.6rem 1.8rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 15px rgba(74, 155, 142, 0.3);
    letter-spacing: 0.5px;
}

.gallery-section.hotels .section-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.gallery-header h2 {
    font-size: 2.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.gallery-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #4a9b8e;
    margin-bottom: 1rem;
}

.gallery-section.hotels .gallery-header h3 {
    color: #667eea;
}

.gallery-header p {
    font-size: 1.05rem;
    color: #6c757d;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
}

.gallery-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #4a9b8e, #5fb3a3);
    margin: 1.2rem auto 0;
    border-radius: 2px;
}

.gallery-section.hotels .gallery-divider {
    background: linear-gradient(90deg, #667eea, #764ba2);
}

/* شبكة الصور */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* كرت الصورة */
.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    aspect-ratio: 4 / 3;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* صورة العنصر */
.gallery-item-image {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-item-image img {
    transform: scale(1.1);
}

/* Overlay فوق الصورة */
.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.85) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    background: linear-gradient(to bottom,
        rgba(74, 155, 142, 0.2) 0%,
        rgba(74, 155, 142, 0.4) 50%,
        rgba(44, 62, 80, 0.95) 100%);
}

.gallery-section.hotels .gallery-item:hover .gallery-item-overlay {
    background: linear-gradient(to bottom,
        rgba(102, 126, 234, 0.2) 0%,
        rgba(102, 126, 234, 0.4) 50%,
        rgba(118, 75, 162, 0.95) 100%);
}

/* محتوى النص */
.gallery-item-content {
    color: white;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.gallery-item-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.4rem 0;
    line-height: 1.3;
    color: white;
}

.gallery-item-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 0.8rem 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* زر المعاينة */
.gallery-item-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.gallery-item:hover .gallery-item-action {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item-action i {
    font-size: 0.8rem;
}

/* رسالة فارغة */
.gallery-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.gallery-empty i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.gallery-empty p {
    font-size: 1rem;
    margin: 0;
}

/*Responsive - النص والعناوين */
@media (max-width: 768px) {
    .gallery-section {
        padding: 3rem 0;
    }

    .gallery-header h2 {
        font-size: 1.8rem;
    }

    .gallery-header h3 {
        font-size: 1.2rem;
    }

    .gallery-header p {
        font-size: 0.95rem;
    }

    .gallery-item {
        aspect-ratio: 1 / 1;
    }

    .gallery-item-overlay {
        padding: 1rem;
    }

    .gallery-item-title {
        font-size: 1rem;
    }

    .gallery-item-description {
        font-size: 0.8rem;
    }

    .gallery-item-action {
        opacity: 1;
        transform: translateY(0);
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .gallery-header h2 {
        font-size: 1.4rem;
    }

    .gallery-section .section-badge {
        padding: 0.4rem 1.2rem;
        font-size: 0.75rem;
    }
}

/* ============================================
   Dashboard Gallery Management Styles
   ============================================ */

.gallery-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.gallery-card-admin {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gallery-card-admin:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.gallery-card-admin.inactive {
    opacity: 0.6;
    border-color: #cbd5e0;
}

.gallery-card-admin.inactive .gallery-image-wrapper img {
    filter: grayscale(60%);
}

.gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg);
}

.gallery-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-card-admin:hover .gallery-image-wrapper img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.gallery-overlay-info {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.gallery-card-content {
    padding: 15px;
}

.gallery-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.gallery-card-desc {
    font-size: 13px;
    color: var(--text-light);
    margin: 0 0 12px 0;
    line-height: 1.5;
    min-height: 40px;
}

.gallery-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.gallery-card-actions .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    flex: 1;
    min-width: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .gallery-grid-admin {
        grid-template-columns: 1fr;
    }

    .gallery-image-wrapper {
        height: 200px;
    }
}