/* Gallery Page Styles */

/* Gallery Hero Section */
.gallery-hero {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 20px;
}

.gallery-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0077B6 0%, #00B4D8 100%);
    z-index: -1;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { 
        background: linear-gradient(135deg, #0077B6 0%, #00B4D8 100%);
    }
    50% { 
        background: linear-gradient(135deg, #00B4D8 0%, #0077B6 100%);
    }
}

.gallery-hero-content {
    text-align: center;
    color: white;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out;
}

.gallery-hero h1 {
    font-size: 3.5em;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
}

.gallery-hero p {
    font-size: 1.4em;
    margin: 15px 0 0 0;
    font-weight: 500;
    opacity: 0.95;
}

.hero-underline {
    width: 120px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    margin: 20px auto 0;
    border-radius: 4px;
    animation: scaleIn 0.8s ease-out 0.3s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Gallery Section */
.gallery-section {
    padding: 100px 5%;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f0f4f8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.gallery-container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Filter Buttons */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    color: #000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.filter-btn i {
    font-size: 1.1em;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0077B6 0%, #00B4D8 100%);
    z-index: -1;
    transition: left 0.4s ease;
}

.filter-btn.active {
    border-color: #00B4D8;
    color: #000;
}

.filter-btn.active::before,
.filter-btn:hover::before {
    left: 0;
}

.filter-btn:hover {
    border-color: #00B4D8;
    color: #000;
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 177, 214, 0.3);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 48, 94, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    animation: slideIn 0.6s ease-out;
    animation-fill-mode: backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-item:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 177, 214, 0.15);
    border-color: #00B4D8;
}

.gallery-item.hidden {
    display: none;
    opacity: 0;
    animation: fadeOut 0.3s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Gallery Image Wrapper */
.gallery-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: #f0f0f0;
    overflow: hidden;
}

.gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.12) rotate(2deg);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.85) 0%, rgba(0, 180, 216, 0.85) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 10;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: white;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlay-content h3 {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.overlay-content p {
    font-size: 0.95em;
    margin: 8px 0 0 0;
    opacity: 0.95;
    font-weight: 500;
}

/* View Button */
.view-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 1.4em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.15) rotate(-15deg);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    padding: 20px;
}

.lightbox-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #0077B6;
    margin: 10px 0;
    text-align: center;
    padding: 0 20px;
}

/* Lightbox Buttons */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #0077B6 0%, #00B4D8 100%);
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.lightbox-close:hover {
    transform: rotate(90deg) scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #0077B6 0%, #00B4D8 100%);
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 177, 214, 0.4);
}

.lightbox-prev:hover {
    transform: translateY(-50%) translateX(-5px) scale(1.15);
}

.lightbox-next:hover {
    transform: translateY(-50%) translateX(5px) scale(1.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-hero {
        height: 300px;
    }

    .gallery-hero h1 {
        font-size: 2.2em;
    }

    .gallery-hero p {
        font-size: 1.1em;
    }

    .gallery-section {
        padding: 60px 4%;
        min-height: auto;
    }

    .gallery-container {
        padding: 0 15px;
    }

    .gallery-filters {
        gap: 10px;
        margin-bottom: 40px;
    }

    .filter-btn {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .filter-btn i {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 85vh;
        border-radius: 15px;
    }

    .lightbox-image {
        max-height: 60vh;
        padding: 15px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }

    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .gallery-hero {
        height: 250px;
    }

    .gallery-hero h1 {
        font-size: 1.8em;
    }

    .gallery-hero p {
        font-size: 1em;
    }

    .gallery-section {
        padding: 40px 3%;
        min-height: auto;
    }

    .gallery-container {
        padding: 0 10px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-image-wrapper {
        padding-bottom: 60%;
    }

    .lightbox-prev,
    .lightbox-next {
        display: none;
    }

    .overlay-content h3 {
        font-size: 1.2em;
    }

    .overlay-content p {
        font-size: 0.85em;
    }
}

/* Print Styles */
@media print {
    .gallery-hero,
    .gallery-filters,
    .view-btn,
    header,
    nav {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
