    /* Modal Styles */
    .modal {
        display: none;
        position: fixed;
        z-index: 10;
        padding-top: 100px;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.9);
    }

    .modal-content {
        margin: auto;
        display: block;
        width: 80%;
        max-width: 700px;
    }

    .close {
        position: absolute;
        top: 3rem;
        right: 22rem;
        color: #f1f1f1;
        font-size: 40px;
        font-weight: bold;
        cursor: pointer;
    }

    .close:hover {
        color: #bbb;
    }

    #caption {
        color: #ccc;
        text-align: center;
        padding: 10px;
        height: 150px;
    }

    @media only screen and (max-width: 700px) {
        .modal-content {
        width: 100%;
        }
    }

    /* Creative Collage Gallery Styles */
    .gallery-item {
        position: relative;
        overflow: hidden;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        transition: all 0.4s ease;
    }

    .gallery-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    }

    .gallery-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, rgba(255,165,0,0.1), rgba(255,69,0,0.1));
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: 1;
    }

    .gallery-item:hover::before {
        opacity: 1;
    }

    .gallery-item img {
        transition: transform 0.5s ease;
    }

    .gallery-item:hover img {
        transform: scale(1.1);
    }

    /* Creative pagination styles */
    .pagination-btn {
        position: relative;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .pagination-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        background: rgba(255,255,255,0.2);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        transition: width 0.3s ease, height 0.3s ease;
    }

    .pagination-btn:hover::before {
        width: 100%;
        height: 100%;
    }

    /* Floating animation for gallery items */
    @keyframes float {
        0%, 100% { transform: translateY(0px); }
        50% { transform: translateY(-10px); }
    }

    .float-animation {
        animation: float 3s ease-in-out infinite;
    }

    .float-animation:nth-child(2) {
        animation-delay: 0.5s;
    }

    .float-animation:nth-child(3) {
        animation-delay: 1s;
    }

    .float-animation:nth-child(4) {
        animation-delay: 1.5s;
    }

    .float-animation:nth-child(5) {
        animation-delay: 2s;
    }

    .float-animation:nth-child(6) {
        animation-delay: 2.5s;
    }

    /* Mobile Responsive Gallery Styles */
    @media (max-width: 640px) {
        .gallery-item {
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.15);
        }

        .gallery-item:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 25px rgba(0,0,0,0.25);
        }

        .gallery-item img {
            transition: transform 0.3s ease;
        }

        .gallery-item:hover img {
            transform: scale(1.05);
        }

        /* Reduce floating animation on mobile for better performance */
        .float-animation {
            animation: float 4s ease-in-out infinite;
        }

        /* Pagination mobile optimization */
        .pagination-btn {
            min-width: 40px;
            min-height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
    }

    /* Tablet Responsive Styles */
    @media (min-width: 641px) and (max-width: 1024px) {
        .gallery-item {
            border-radius: 10px;
        }

        .float-animation {
            animation: float 3.5s ease-in-out infinite;
        }
    }

    /* Ensure gallery is visible on all screen sizes */
    @media (max-width: 480px) {
        #gallery {
            margin: 0 -8px;
        }
        
        #gallery > div {
            padding: 4px;
        }
    }