/* =================================================================
   COMPATIBILITY FIXES
   Ensures all existing functionality works with performance optimizations
================================================================= */

/* ===== LAZY LOADING FIXES ===== */
.lazy-image {
    transition: opacity 0.3s ease;
    background: #f5f5f5;
}

.lazy-image:not(.loaded) {
    opacity: 0.7;
}

.lazy-image.loaded {
    opacity: 1;
}

/* ===== WOW ANIMATION COMPATIBILITY ===== */
.wow {
    visibility: hidden;
}

.wow.animated {
    visibility: visible;
}

/* Ensure animations work on mobile */
@media (max-width: 768px) {
    .wow {
        animation-duration: 0.8s;
        animation-fill-mode: both;
    }
}

/* ===== NAVIGATION FIXES ===== */
.navbar-toggler {
    border: none;
    padding: 4px 8px;
    background: transparent;
    cursor: pointer;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

.navigation-list {
    transition: all 0.3s ease;
}

@media (max-width: 991px) {
    .navigation-list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #fff;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 9999;
        padding: 20px;
        overflow-y: auto;
    }

    .navigation-list.show {
        right: 0;
    }

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

    .nav li {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .nav a {
        display: block;
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
    }
}

/* ===== MAGNIFIC POPUP FIXES ===== */
.mfp-fade.mfp-bg {
    opacity: 0;
    transition: all 0.15s ease-out;
}

.mfp-fade.mfp-bg.mfp-ready {
    opacity: 0.8;
}

.mfp-fade.mfp-bg.mfp-removing {
    opacity: 0;
}

.mfp-fade.mfp-wrap .mfp-content {
    opacity: 0;
    transition: all 0.15s ease-out;
}

.mfp-fade.mfp-wrap.mfp-ready .mfp-content {
    opacity: 1;
}

.mfp-fade.mfp-wrap.mfp-removing .mfp-content {
    opacity: 0;
}

/* ===== VIDEO PLAYER FIXES ===== */
.video-card-one {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.video-card-one img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1D7D57;
    font-size: 24px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.play-btn:hover {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.1);
    color: #1D7D57;
}

/* ===== TEAM MEMBER HOVER EFFECTS ===== */
.team-member {
    transition: all 0.3s ease;
}

.team-member:hover {
    transform: translateY(-5px);
}

.team-media {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.team-media img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.team-member:hover .team-media img {
    transform: scale(1.05);
}

/* ===== CATEGORIES CARD ANIMATIONS ===== */
.categories-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.categories-card:hover {
    transform: translateY(-10px);
}

.categories-card-inner {
    position: relative;
    height: 100%;
}

.categories-card-front,
.categories-card-back {
    transition: all 0.3s ease;
}

/* ===== SPLIT MEDIA ANIMATIONS ===== */
.split-media {
    position: relative;
    overflow: hidden;
}

.split-media.split-active {
    animation: splitReveal 0.8s ease-out;
}

@keyframes splitReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PERFORMANCE LOADER OVERRIDES ===== */
.page-loader {
    z-index: 99999 !important;
}

/* Hide performance skeleton when content is loaded */
.content-loaded .skeleton,
.content-loaded .skeleton-card,
.content-loaded .skeleton-text {
    display: none;
}

/* ===== RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
    .play-btn {
        width: 60px;
        height: 60px;
        font-size: 18px;
    }

    .categories-card:hover {
        transform: none;
    }

    .team-member:hover {
        transform: none;
    }

    /* Reduce animations on mobile for better performance */
    .wow {
        animation-duration: 0.6s !important;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    .lazy-image,
    .team-member,
    .categories-card,
    .play-btn,
    .navigation-list {
        transition: none !important;
    }

    .wow {
        animation: none !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .page-loader,
    .navbar-toggler,
    .play-btn {
        display: none !important;
    }

    .lazy-image {
        opacity: 1 !important;
    }
}