/* Mobile Touch Feedback Fix
 * This CSS addresses the issue where tapped elements remain highlighted after touch
 * It ensures elements only show feedback while being actively touched
 */

/* Global touch action settings */
* {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}

/* Buttons and interactive elements */
button,
a,
.nav-menu-link,
.dropdown-link,
.floating-contact-btn,
.floating-top-btn,
.contact-option,
.video-play-button,
.banner-nav-toggle,
.cta-button,
.schedule-day.collapsible .day-header {
    /* Prevent default tap highlight */
    -webkit-tap-highlight-color: transparent !important;
    /* Ensure touch events are properly handled */
    touch-action: manipulation;
}

/* Only apply active state styles while actively pressing */
button:active,
a:active,
.nav-menu-link:active,
.dropdown-link:active,
.floating-contact-btn:active,
.floating-top-btn:active,
.contact-option:active,
.video-play-button:active,
.banner-nav-toggle:active,
.cta-button:active,
.schedule-day.collapsible .day-header:active {
    /* Apply active state only during touch */
    transition: none !important;
}

/* Remove focus outlines on mobile */
@media (max-width: 768px) {
    button:focus,
    a:focus,
    .nav-menu-link:focus,
    .dropdown-link:focus,
    .floating-contact-btn:focus,
    .floating-top-btn:focus,
    .contact-option:focus,
    .video-play-button:focus,
    .banner-nav-toggle:focus,
    .cta-button:focus,
    .schedule-day.collapsible .day-header:focus {
        outline: none !important;
    }
    
    /* Ensure no persistent color changes */
    .nav-menu-link:focus:not(:active),
    .dropdown-link:focus:not(:active) {
        color: inherit !important;
        transform: none !important;
    }
    
    /* Specific fix for navigation menu items */
    .nav-menu-link:focus:not(:active),
    .dropdown-link:focus:not(:active) {
        color: white !important;
        transform: translateX(0) !important;
    }
    
    .nav-menu-link:active,
    .dropdown-link:active {
        color: var(--gracie-red) !important;
        transform: translateX(5px) !important;
    }
    
    /* Fix for floating buttons */
    .floating-contact-btn:focus:not(:active),
    .floating-top-btn:focus:not(:active) {
        transform: none !important;
        background-color: var(--gracie-red) !important;
    }
    
    /* Fix for contact options */
    .contact-option:focus:not(:active) {
        transform: none !important;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Fix for banner nav toggle */
    .banner-nav-toggle:focus:not(:active) {
        transform: translate(-50%, -50%) !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
    }
    
    /* Fix for video play button */
    .video-play-button:focus:not(:active) {
        transform: none !important;
        background-color: rgba(204, 0, 0, 0.8) !important;
    }
    
    /* Fix for schedule day headers */
    .schedule-day.collapsible .day-header:focus:not(:active) {
        background-color: var(--gracie-red) !important;
        transform: none !important;
    }
    
    .schedule-day.collapsible .day-header:active {
        background-color: #d41730 !important;
        transition: background-color 0.1s ease !important;
    }
    
    /* Additional fix to ensure schedule day headers return to original color */
    .schedule-day.collapsible .day-header {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }
    
    /* Force return to original color after touch */
    .schedule-day.collapsible .day-header:focus-visible {
        background-color: var(--gracie-red) !important;
    }
    
    /* Ensure expanded days have different color and collapsed days return to original */
    .schedule-day.expanded .day-header {
        background-color: #d41730 !important;
    }
    
    .schedule-day.collapsed .day-header {
        background-color: var(--gracie-red) !important;
    }
}