/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Gallery Styles with Glassmorphism */
.facilities-gallery-section {
    padding: 80px 0;
    background: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

.facilities-gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(0,53,141,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(0,53,141,0.03)"/><circle cx="50" cy="10" r="0.5" fill="rgba(0,53,141,0.04)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Gallery Header */
.gallery-header {
    text-align: center;
    margin-bottom: 60px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(0, 53, 141, 0.1);
    border: 1px solid rgba(0, 53, 141, 0.2);
    border-radius: 24px;
    padding: 40px;
    box-shadow:
        0 8px 32px rgba(0, 53, 141, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: fadeInUp 0.8s ease-out;
}

.gallery-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00358d 0%, #0066cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.gallery-description {
    font-size: 1.2rem;
    color: rgba(0, 53, 141, 0.8);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Tabs */
.gallery-filter-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
    gap: 8px;
    flex-wrap: wrap;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 53, 141, 0.15);
    border-radius: 20px;
    padding: 12px;
    box-shadow:
        0 8px 32px rgba(0, 53, 141, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.filter-tab {
    background: transparent;
    border: none;
    padding: 12px 24px;
    border-radius: 14px;
    color: rgba(0, 53, 141, 0.7);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 53, 141, 0.1) 0%, rgba(0, 53, 141, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 14px;
}

.filter-tab:hover::before {
    opacity: 1;
}

.filter-tab:hover {
    color: #00358d;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 53, 141, 0.15);
}

.filter-tab.active {
    background: linear-gradient(135deg, #00358d 0%, #0066cc 100%);
    color: #ffffff;
    box-shadow:
        0 4px 20px rgba(0, 53, 141, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Gallery Content */
.gallery-content {
    position: relative;
}

.gallery-category {
    display: none;
    animation: fadeIn 0.6s ease-out;
}

.gallery-category.active {
    display: block;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.facility-preview {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 53, 141, 0.2);
    box-shadow:
        0 8px 32px rgba(0, 53, 141, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: fadeInUp 0.8s ease-out;
}

.facility-preview:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(0, 53, 141, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.preview-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.facility-preview:hover .preview-image img {
    transform: scale(1.1);
}

.preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(0, 53, 141, 0.3) 40%,
            rgba(0, 53, 141, 0.9) 100%);
    padding: 30px 24px 24px;
    color: white;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.preview-overlay h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    color: white;
}

.preview-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 16px;
    display: none;
}

.location-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.location-link a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Facility Info */
.facility-info {
    text-align: center;
    margin-bottom: 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 53, 141, 0.2);
    border-radius: 20px;
    padding: 32px;
    box-shadow:
        0 8px 32px rgba(0, 53, 141, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.8s ease-out;
}

.facility-info h3 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #00358d;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.facility-info p {
    font-size: 1.1rem;
    color: rgba(0, 53, 141, 0.8);
    margin-bottom: 20px;
    line-height: 1.5;
}

.location-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #00358d 0%, #0066cc 100%);
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 16px;
    font-weight: 500;
    border: 1px solid rgba(0, 53, 141, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 53, 141, 0.2);
}

.location-btn:hover {
    background: linear-gradient(135deg, #0066cc 0%, #00358d 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 53, 141, 0.3);
    color: #ffffff;
    text-decoration: none;
}

/* Facility Info */
.facility-info {
    text-align: center;
    margin-bottom: 40px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 53, 141, 0.2);
    border-radius: 20px;
    padding: 32px;
    box-shadow:
        0 8px 32px rgba(0, 53, 141, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.8s ease-out;
}

.facility-info h3 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #00358d;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.facility-info p {
    font-size: 1.1rem;
    color: rgba(0, 53, 141, 0.8);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Facility Actions Container */
.facility-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Location Button */
.location-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #00358d 0%, #0066cc 100%);
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 16px;
    font-weight: 500;
    border: 1px solid rgba(0, 53, 141, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 53, 141, 0.2);
}

.location-btn:hover {
    background: linear-gradient(135deg, #0066cc 0%, #00358d 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 53, 141, 0.3);
    color: #ffffff;
    text-decoration: none;
}

/* QR Button for Facility Info */
.qr-btn-facility {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 53, 141, 0.1);
    color: #00358d;
    border: 2px solid rgba(0, 53, 141, 0.2);
    padding: 12px 20px;
    border-radius: 16px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 53, 141, 0.1);
    font-size: 1rem;
}

.qr-btn-facility:hover {
    background: linear-gradient(135deg, #00358d 0%, #0066cc 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 53, 141, 0.3);
    border-color: rgba(0, 53, 141, 0.4);
}

.qr-btn-facility i {
    font-size: 1rem;
}

/* QR Modal Styles (same as before) */
.qr-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.qr-modal.show {
    display: block;
}

.qr-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qr-modal.show .qr-modal-content {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.qr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid rgba(0, 53, 141, 0.1);
    margin-bottom: 24px;
}

.qr-modal-header h3 {
    margin: 0;
    color: #00358d;
    font-size: 1.3rem;
    font-weight: 600;
}

.qr-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.qr-modal-close:hover {
    background: rgba(0, 53, 141, 0.1);
    color: #00358d;
}

.qr-modal-body {
    padding: 0 24px 24px 24px;
    text-align: center;
}

.qr-instruction {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.qr-code-large {
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-code-large img {
    border: 1px solid rgba(0, 53, 141, 0.15);
    border-radius: 12px;
    padding: 12px;
    background: white;
    box-shadow: 0 4px 16px rgba(0, 53, 141, 0.1);
}

/* Responsive Design */
@media (max-width: 600px) {
    .facility-actions {
        flex-direction: column;
        gap: 12px;
    }

    .location-btn,
    .qr-btn-facility {
        width: 100%;
        justify-content: center;
        max-width: 280px;
    }

    .facility-info h3 {
        font-size: 1.8rem;
    }

    .facility-info p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .facility-info {
        padding: 24px 20px;
    }

    .qr-modal-content {
        width: 95%;
        max-width: none;
    }

    .qr-code-large img {
        width: 180px;
        height: 180px;
    }
}


/* Image Carousel */
.image-carousel {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 53, 141, 0.15);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 53, 141, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.carousel-container {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.carousel-slide.active img {
    transform: scale(1.02);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 53, 141, 0.3);
    color: #00358d;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    box-shadow: 0 4px 20px rgba(0, 53, 141, 0.2);
}

.carousel-btn:hover {
    background: #00358d;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 53, 141, 0.3);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.195);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.indicator.active {
    background: #ffffff;
    border-color: #ffffff;
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(0, 53, 141, 0.5);
}

.indicator:hover {
    border-color: #ffffff;
    transform: scale(1.1);
}

/* Facility Cards (for the new HTML structure) */
.facilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.facility-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 53, 141, 0.2);
    box-shadow:
        0 8px 32px rgba(0, 53, 141, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: fadeInUp 0.8s ease-out;
}

.facility-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(0, 53, 141, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.card-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.facility-card:hover .card-image img {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(0, 53, 141, 0.3) 40%,
            rgba(0, 53, 141, 0.9) 100%);
    height: 100%;
    pointer-events: none;
}

.card-content {
    padding: 24px;
    background: rgba(255, 255, 255, 0.95);
}

.facility-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #00358d;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.facility-description {
    font-size: 0.95rem;
    color: rgba(0, 53, 141, 0.7);
    margin-bottom: 16px;
    line-height: 1.5;
}

.facility-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-count {
    font-size: 0.85rem;
    color: rgba(0, 53, 141, 0.6);
    font-weight: 500;
}

.location-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #00358d 0%, #0066cc 100%);
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 53, 141, 0.2);
}

.location-btn:hover {
    background: linear-gradient(135deg, #0066cc 0%, #00358d 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 53, 141, 0.3);
    color: #ffffff;
    text-decoration: none;
}

/* Filter Tabs Container (for new HTML structure) */
.filter-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 53, 141, 0.15);
    border-radius: 20px;
    padding: 12px;
    box-shadow:
        0 8px 32px rgba(0, 53, 141, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.tab-text {
    position: relative;
    z-index: 1;
}

.tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #00358d;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.filter-tab.active .tab-indicator {
    transform: scaleX(1);
}

/* Gallery Views */
.gallery-view {
    display: none;
    animation: fadeIn 0.6s ease-out;
}

.gallery-view.active {
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .facilities-gallery-section {
        padding: 60px 0;
    }

    .gallery-container {
        padding: 0 16px;
    }

    .gallery-title {
        font-size: 2.5rem;
    }

    .gallery-filter-tabs,
    .filter-tabs {
        gap: 4px;
        padding: 8px;
    }

    .filter-tab {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .category-grid,
    .facilities-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .facility-preview,
    .facility-card {
        margin: 0 auto;
        max-width: 400px;
    }

    .preview-image,
    .card-image {
        height: 240px;
    }

    .carousel-container {
        height: 350px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .carousel-btn.prev {
        left: 10px;
    }

    .carousel-btn.next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-header {
        padding: 24px;
        margin-bottom: 40px;
    }

    .gallery-title {
        font-size: 2rem;
    }

    .gallery-description {
        font-size: 1rem;
    }

    .facility-info {
        padding: 24px;
    }

    .facility-info h3 {
        font-size: 1.8rem;
    }

    .carousel-container {
        height: 280px;
    }
}

/* Loading States */
.facility-preview.loading,
.facility-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.facility-preview.loading::after,
.facility-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(0, 53, 141, 0.3);
    border-top: 3px solid #00358d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.filter-tab:focus,
.carousel-btn:focus,
.indicator:focus,
.location-btn:focus {
    outline: 2px solid #00358d;
    outline-offset: 2px;
}

/* Accent color for form elements */
input,
button,
select,
textarea {
    accent-color: #00358d;
}