*{
    margin: 0; padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', Arial, Helvetica, sans-serif;
    text-transform: capitalize;
    transition:all .3s cubic-bezier(.34,1.12,.68,1.31);
}

.gallery{
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding-bottom: 100px;
}

.gallery .controls{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding:30px 0;
    list-style: none;
    gap: 15px;
}

.gallery .controls .buttons{
    height:50px;
    min-width: 160px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color:#fffafa;
    font-size: 16px;
    font-weight: 600;
    line-height: 50px;
    cursor: pointer;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-align: center;
    border-radius: 25px;
    padding: 0 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gallery .controls .buttons:hover{
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.gallery .controls .buttons.active{
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

/* Slideshow Button */
.slideshow-btn {
    display: inline-block;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4);
    margin-left: 15px;
    border: none;
}

.slideshow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.6);
}

.slideshow-btn.active {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.gallery .image-container{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.gallery .image-container .image{
    flex: 1 1 320px;
    max-width: 400px;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin: 15px;
    position: relative;
    cursor: pointer;
    min-height: 240px;
}

.gallery .image-container .image::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1;
}

.gallery .image-container .image:hover::before{
    opacity: 1;
}

.gallery .image-container .image img{
    height: 100%;
    width:100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery .image-container .image:hover img{
    transform: scale(1.15);
}

.gallery .image-container .image .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.gallery .image-container .image:hover .overlay {
    opacity: 1;
}

.gallery .image-container .image .overlay h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.gallery .image-container .image .overlay p {
    font-size: 14px;
    opacity: 0.8;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed !important;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0;
    margin: 0;
    overflow: hidden !important;
    border-radius: 0 !important;
    background-color: rgba(0,0,0,0.95) !important;
    animation: fadeIn 0.3s ease;
    transform: none !important;
    transform-style: flat !important;
    opacity: 1 !important;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0 !important;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(102, 126, 234, 0.5);
    transition: transform 0.3s ease;
}

.modal-content.zoomed {
    transform: translate(-50%, -50%) scale(1.5);
    cursor: zoom-out;
}

.modal-content.slide-next {
    animation: modalSlideNext .45s ease;
}

.modal-content.slide-prev {
    animation: modalSlidePrev .45s ease;
}

@keyframes modalSlideNext {
    from { opacity: 0; transform: translate(-50%, -50%) translateX(42px); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes modalSlidePrev {
    from { opacity: 0; transform: translate(-50%, -50%) translateX(-42px); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

.close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
    width: 60px;
    height: 60px;
    line-height: 55px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.close:hover,
.close:focus {
    background: rgba(255,255,255,0.2);
    color: #f5576c;
    transform: rotate(90deg);
}

/* Navigation Buttons - Always Visible */
.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: 60px;
    height: 60px;
    padding: 0;
    line-height: 60px;
    text-align: center;
    color: white !important;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s ease;
    border-radius: 50%;
    border: 2px solid white;
    user-select: none;
    -webkit-user-select: none;
    background: rgba(102, 126, 234, 0.9) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 1 !important;
    visibility: visible !important;
}

.next {
    right: 20px;
}

.prev {
    left: 20px;
}

.prev:hover,
.next:hover {
    background: #f5576c !important;
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(245, 87, 108, 0.5);
}

/* Zoom Buttons */
.zoom-btns {
    position: absolute;
    bottom: 96px;
    left: 50%;
    transform: translateX(-50%);
    display: flex !important;
    gap: 15px;
    z-index: 10000;
    opacity: 1 !important;
    visibility: visible !important;
}

.zoom-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9)) !important;
    color: white !important;
    border: 2px solid white;
    font-size: 24px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    opacity: 1 !important;
    visibility: visible !important;
}

.zoom-btn:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    transform: scale(1.1);
}

/* Caption */
#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-size: 18px;
    font-weight: 500;
    position: absolute;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
}

/* Image Counter */
.image-counter {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 10000;
}

/* Preview Tab Bar */
.pview-bar {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    gap: 0;
    z-index: 10000;
    background: transparent;
    box-shadow: none;
    padding: 0 8px;
    border-radius: 0;
}

.pview-btn {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.8);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    line-height: 42px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.35);
    box-sizing: border-box;
}

.pview-btn:hover {
    background: #f5576c;
    transform: scale(1.12);
}

.pview-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 10001;
    background: linear-gradient(135deg, #d41b3c, #a00f2c);
}

.pview-close:hover {
    background: #ff2b55;
    transform: rotate(90deg) scale(1.12);
}

/* Responsive */
@media (max-width: 900px) {
    .gallery .image-container .image {
        flex: 1 1 260px;
        max-width: 340px;
        min-height: 200px;
        margin: 12px;
    }
}

@media (max-width: 768px) {
    .gallery .image-container .image {
        flex: 1 1 220px;
        max-width: 300px;
        min-height: 190px;
        margin: 10px;
    }
    
    .gallery .controls .buttons {
        height: 40px;
        min-width: 110px;
        font-size: 13px;
        margin: 5px;
        padding: 0 18px;
    }

    .slideshow-btn {
        padding: 10px 18px;
        font-size: 13px;
        margin-left: 5px;
    }
    
    .close {
        top: 15px;
        right: 20px;
        font-size: 35px;
        width: 45px;
        height: 45px;
        line-height: 40px;
    }
    
    .prev, .next {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .prev {
        left: 10px;
    }
    
    .next {
        right: 10px;
    }
    
    .zoom-btns {
        bottom: 20px;
        gap: 12px;
    }

    .pview-btn {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px;
        min-height: 42px;
        max-width: 42px;
        max-height: 42px;
        flex: 0 0 42px;
        line-height: 36px;
    }
    
    .image-counter {
        top: 15px;
        font-size: 14px;
        padding: 8px 15px;
    }

    .modal-content {
        max-width: 94%;
        max-height: 78vh;
    }
}

@media (max-width: 480px) {
    .gallery .image-container .image {
        flex: 1 1 100%;
        max-width: 100%;
        min-height: 200px;
        margin: 10px 0;
    }

    .gallery .controls .buttons {
        height: 36px;
        min-width: 80px;
        font-size: 12px;
        padding: 0 12px;
    }

    .prev, .next {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .prev {
        left: 6px;
    }

    .next {
        right: 6px;
    }

    .close {
        top: 12px;
        right: 14px;
        width: 40px;
        height: 40px;
        line-height: 36px;
        font-size: 30px;
    }

    .zoom-btns {
        bottom: 14px;
        gap: 10px;
    }

    #caption {
        font-size: 14px;
        bottom: 80px;
        width: 90%;
    }
}

/* Filter animation */
.image.hide {
    display: none;
}

.image.show {
    display: block;
    animation: filterFade 0.5s ease;
}

@keyframes filterFade {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fix for Smart Classrooms images - ensure equal sizing */
.navigation-drop-container.school-level.campus {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}

.navigation-drop-container.school-level.campus .navigation-link-block.vertical.campus {
    flex: 1 1 280px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
}

.navigation-drop-container.school-level.campus .menu-thumbnail.big.campus {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .navigation-drop-container.school-level.campus .navigation-link-block.vertical.campus {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .navigation-drop-container.school-level.campus .menu-thumbnail.big.campus {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .navigation-drop-container.school-level.campus .menu-thumbnail.big.campus {
        height: 160px;
    }
}
