/* ============================================
   GALLERY CSS
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f0f2f8;
    padding: 40px 20px;
    min-height: 100vh;
}

.gallery-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    padding: 8px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.1);
    margin-bottom: 25px;
}

.btn-back:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    transform: translateX(-3px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.gallery-header {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-header h2 {
    color: #1e1b4b;
    font-weight: 800;
    font-size: 32px;
}

.gallery-header h2 i {
    color: #6366f1;
    margin-right: 10px;
}

.gallery-header p {
    color: rgba(0, 0, 0, 0.4);
    font-size: 14px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
    background: #f0f0f0;
    transition: all 0.4s ease;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(139, 92, 246, 0.85));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
    padding: 20px;
    text-align: center;
    color: #ffffff;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    font-size: 40px;
    margin-bottom: 10px;
}

.gallery-overlay h5 {
    font-weight: 700;
    font-size: 16px;
    margin: 0;
}

.gallery-overlay small {
    font-size: 12px;
    opacity: 0.8;
}

.no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(0, 0, 0, 0.3);
}

.no-images i {
    font-size: 60px;
    display: block;
    margin-bottom: 15px;
    color: rgba(0, 0, 0, 0.06);
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 40px;
}

.lightbox-img {
    max-width: 80%;
    max-height: 70%;
    object-fit: contain;
    border-radius: 12px;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-caption {
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    margin-top: 20px;
    text-align: center;
    max-width: 80%;
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 50px;
    color: #ffffff;
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-lightbox:hover {
    transform: rotate(90deg);
    color: #6366f1;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.2);
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

.spinner-border {
    width: 3rem;
    height: 3rem;
}

@media (max-width: 768px) {
    .gallery-wrapper { padding: 20px; }
    .gallery-header h2 { font-size: 24px; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
    .lightbox-prev { left: 10px; font-size: 28px; padding: 15px 10px; }
    .lightbox-next { right: 10px; font-size: 28px; padding: 15px 10px; }
    .close-lightbox { top: 20px; right: 25px; font-size: 35px; }
}

@media (max-width: 480px) {
    .gallery-wrapper { padding: 15px; border-radius: 16px; }
    .gallery-header h2 { font-size: 20px; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .gallery-overlay h5 { font-size: 14px; }
    .gallery-overlay i { font-size: 28px; }
    .lightbox-img { max-width: 95%; max-height: 55%; }
    .lightbox-caption { font-size: 14px; }
}