/* ==========================================
   FACILITIES PAGE STYLES
   Following the orientation page design pattern
========================================== */

/* Global Typography */
.facilities-section *,
.facility-card * {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
}

/* ==========================================
   FACILITIES SECTION
========================================== */
.facilities-section {
    position: relative;
    padding: 100px 0;
    background: linear-gradient(135deg, #fafbfc 0%, #ffffff 50%, #f9fafb 100%);
    overflow: hidden;
    isolation: isolate;
}

.facilities-section-alt {
    background: linear-gradient(135deg, #ffffff 0%, #f5f8fb 50%, #fafbfc 100%);
}

/* Section Header */
.facilities-section-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 60px;
    position: relative;
    z-index: 1;
}

.facilities-section-header h2 {
    font-size: 42px;
    font-weight: 700;
    color: #1a2a4a;
    margin-bottom: 15px;
}

.facilities-subtitle {
    font-size: 18px;
    color: #5a6c8f;
    margin: 0;
    font-weight: 400;
}

/* ==========================================
   FACILITY CARDS
========================================== */
.facility-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(44, 76, 156, 0.08);
    border: 1px solid rgba(44, 76, 156, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.facility-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2c4c9c, #6096b4);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 2;
}

.facility-card:hover::before {
    transform: scaleX(1);
}

.facility-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(44, 76, 156, 0.15);
    border-color: rgba(44, 76, 156, 0.15);
}

/* ==========================================
   FACILITY IMAGE
========================================== */
.facility-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f0f0f0;
}

.facility-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.facility-card:hover .facility-image img {
    transform: scale(1.1);
}

/* Dark overlay on hover */
.facility-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.facility-card:hover .facility-image::after {
    background: rgba(44, 76, 156, 0.3);
}

/* ==========================================
   VIDEO OVERLAY & PLAY BUTTON
========================================== */
.facility-video-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
    pointer-events: none !important;
}

.facility-play-btn {
    width: 60px !important;
    height: 60px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #2c4c9c !important;
    font-size: 20px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    z-index: 10 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.facility-play-btn:hover {
    transform: scale(1.15) !important;
    background: #2c4c9c !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}

.facility-play-btn i {
    margin-left: 3px !important;
    display: inline-block !important;
    font-size: 20px !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #2c4c9c !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    -webkit-font-smoothing: antialiased !important;
}

.facility-play-btn:hover i {
    color: #ffffff !important;
}

.facility-play-pulse {
    position: absolute !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    border: 3px solid rgba(255, 255, 255, 0.5) !important;
    opacity: 0.6 !important;
    animation: facilityPulse 2s ease-out infinite !important;
    pointer-events: none !important;
    visibility: visible !important;
    z-index: 9 !important;
}

@keyframes facilityPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ==========================================
   FACILITY CONTENT
========================================== */
.facility-content {
    padding: 30px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.facility-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a2a4a;
    margin-bottom: 15px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.facility-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.facility-card:hover .facility-content h3,
.facility-card:hover .facility-content h3 a {
    color: #2c4c9c;
}

.facility-content p {
    font-size: 0.95rem;
    color: #5a6c8f;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* ==========================================
   LEARN MORE LINK
========================================== */
.facility-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #2c4c9c !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    margin-top: auto !important;
}

.facility-link i {
    font-size: 0.85rem !important;
    transition: transform 0.3s ease !important;
    display: inline-block !important;
    font-style: normal !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #2c4c9c !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased !important;
}

.facility-link:hover {
    color: #1e3a7a !important;
    gap: 12px !important;
}

.facility-link:hover i {
    transform: translateX(5px) !important;
    color: #1e3a7a !important;
}

/* ==========================================
   FONT AWESOME ICONS FIX
========================================== */
.facility-card i[class*="fa"] {
    display: inline-block !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    visibility: visible !important;
    opacity: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.facility-card .fa,
.facility-card .fas,
.facility-card .far,
.facility-card .fal,
.facility-card .fab,
.facility-card [class^="fa-"],
.facility-card [class*=" fa-"] {
    display: inline-block !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
}

/* ==========================================
   VIDEO MODAL
========================================== */
#videoModal .modal-dialog {
    max-width: 90%;
    width: 1000px;
    margin: 30px auto;
}

#videoModal .modal-content {
    background-color: #000 !important;
    border: none !important;
    border-radius: 8px;
    overflow: hidden;
}

#videoModal .modal-body {
    padding: 0;
    background: #000;
    min-height: 400px;
}

#videoModal .btn-close-white {
    filter: brightness(200%);
    opacity: 1;
}

#videoModal .ratio {
    background: #000;
}

#videoModal iframe {
    border: none;
}

/* ==========================================
   ADDITIONAL ENHANCEMENTS
========================================== */
.facility-card * {
    transition: all 0.3s ease;
}

.facility-link:focus,
.facility-play-btn:focus {
    outline: 2px solid #2c4c9c;
    outline-offset: 2px;
}

.facility-image img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.facilities-section {
    position: relative;
    z-index: auto;
}

.facility-card {
    position: relative;
    z-index: 1;
}

.row.g-4 {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.btn-hero.btn-lg {
    padding: 16px 40px;
    font-size: 1.05rem;
}

.facilities-section + .facilities-section {
    padding-top: 100px;
}

/* ==========================================
   RESPONSIVE DESIGN
========================================== */
@media (max-width: 992px) {
    .facilities-section {
        padding: 80px 0;
    }

    .facilities-section-header h2 {
        font-size: 32px;
    }

    .facilities-subtitle {
        font-size: 16px;
    }

    .facility-image {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .facilities-section {
        padding: 60px 0;
    }

    .facilities-section-header {
        margin-bottom: 40px;
    }

    .facilities-section-header h2 {
        font-size: 28px;
    }

    .facility-card {
        border-radius: 16px;
    }

    .facility-image {
        height: 220px;
    }

    .facility-content {
        padding: 25px 20px;
    }

    .facility-content h3 {
        font-size: 1.2rem;
    }

    .facility-play-btn {
        width: 50px !important;
        height: 50px !important;
        font-size: 18px !important;
    }

    .facility-play-btn i {
        font-size: 18px !important;
    }

    .facility-play-pulse {
        width: 50px !important;
        height: 50px !important;
    }

    .about-bg-shapes,
    .campus-bg-shapes,
    .rundown-bg-shapes,
    .leaders-bg-shapes {
        display: none;
    }

    .facilities-section + .facilities-section {
        padding-top: 60px;
    }
}

@media (max-width: 576px) {
    .facilities-section-header h2 {
        font-size: 24px;
    }

    .facilities-subtitle {
        font-size: 15px;
    }

    .facility-content h3 {
        font-size: 1.1rem;
    }

    .facility-content p {
        font-size: 0.9rem;
    }

    .orientation-buttons {
        flex-direction: column;
        width: 100%;
    }

    .orientation-buttons .btn-hero {
        width: 100%;
        max-width: 280px;
    }
}

/* ==========================================
   PRINT STYLES
========================================== */
@media print {
    .facilities-section {
        padding: 40px 0;
    }

    .facility-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .facility-video-overlay,
    .about-bg-shapes,
    .campus-bg-shapes,
    .rundown-bg-shapes,
    .leaders-bg-shapes,
    .about-floating-dots,
    .campus-floating-dots,
    .rundown-floating-dots,
    .leaders-floating-dots {
        display: none;
    }
}
