/* Gallery Section */
.gallery.section {
    padding: 100px 0;
    background: #f8f9fa;
}

.section-title {
    text-align: center;
    margin-bottom: 80px;
}

.section-title h2 {
    font-size: 2.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 2px;
}

.section-title p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 30px auto 0;
    line-height: 1.8;
}

/* Gallery Grid */
.agile_gallery_grid {
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.galleryimage {
    display: block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    cursor: pointer;
}

.galleryimage:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    text-decoration: none;
}

.agile_gallery_grid1 {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    height: 300px;
}

.agile_gallery_grid1 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.galleryimage:hover .agile_gallery_grid1 img {
    transform: scale(1.1);
}

/* Overlay */
.w3layouts_gallery_grid1_pos {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px;
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(20px);
}

.galleryimage:hover .w3layouts_gallery_grid1_pos {
    opacity: 1;
    transform: translateY(0);
}

.w3layouts_gallery_grid1_pos h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.w3layouts_gallery_grid1_pos p {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* Enhanced Bootstrap Modal */
.modal-content {
    border-radius: 15px;
    border: none;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 20px 30px;
}

.modal-title {
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

.modal-header .close {
    color: white;
    opacity: 1;
    font-size: 2rem;
    font-weight: 300;
    text-shadow: none;
    transition: all 0.3s ease;
}

.modal-header .close:hover {
    color: #ffd700;
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    background: white;
}

#modalImage {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

#modalImage:hover {
    transform: scale(1.02);
}

.modal-description {
    margin-top: 20px;
}

.modal-description p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transform: scale(0.8);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Loading Spinner */
.modal-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .agile_gallery_grid1 {
        height: 250px;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .agile_gallery_grid1 {
        height: 200px;
    }
    
    .w3layouts_gallery_grid1_pos {
        padding: 20px;
    }
    
    .w3layouts_gallery_grid1_pos h3 {
        font-size: 1.3rem;
    }
}

/* Animation for gallery items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item-animate {
    animation: fadeInUp 0.6s ease forwards;
}