/* Ultra-Optimized Home Page Styles - Targeting 620ms Render Delay Reduction */
/* All inline styles moved here to prevent render blocking */

/* Core layout styles - moved from inline */
.border-active {
    padding: 5px 10px;
    background: #2A3B7D;
    color: white;
    transition: background-color 0.2s ease-out;
    will-change: background-color;
}

.accordion-list-item::before {
    content: "\25BA \0020";
    color: #ff8b25;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.accordion-list-item {
    padding: 5px 0px 5px 0px;
    contain: layout;
}

.flex-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    contain: layout;
}

.nmt-200 {
    margin-top: -200px;
}

/* Background sections - moved from inline styles */
.section-bg-1 {
    background-image: url('../images/services/medicalbilling/next-to-hero-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-top: -199px;
    contain: layout style paint;
}

.section-bg-2 {
    background-image: url('../images/services/medicalbilling/accordions-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    contain: layout style paint;
}

.section-bg-3 {
    background-image: url('../../images/services/medicalbilling/next-to-hero-bg.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    contain: layout style paint;
}

/* Hero section optimization */
.hero-bg-img {
    background-image: url('../../images/services/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    contain: layout style paint;
    will-change: transform;
}

/* RCM Progress Indicator - GPU accelerated */
.rcm-progress-container {
    position: relative;
    margin: 2rem 0;
    contain: layout style paint;
}

.rcm-progress-line {
    position: absolute;
    background-color: #e9ecef;
    height: 4px;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    contain: layout style;
}

.rcm-progress-line-active {
    position: absolute;
    background: linear-gradient(90deg, var(--secondary-color, #FC5D61) 0%, var(--secondary-color, #FC5D61) 100%);
    height: 4px;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    left: 40px;
    transform-origin: left center;
    will-change: transform;
    contain: layout style;
}

/* Desktop horizontal progress line */
.desktop-progress-line {
    top: 40px;
    left: 75px;
    right: 0;
    width: 85%;
}

.desktop-progress-line-active {
    top: 40px;
    left: 75px;
    width: 0%;
}

/* Mobile vertical progress line */
.mobile-progress-line {
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    height: 100%;
}

.mobile-progress-line-active {
    left: 20px;
    top: 0;
    height: 0%;
    transform-origin: top center;
}

/* RCM Steps optimization */
.rcm-step {
    position: relative;
    z-index: 3;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    padding-top: 20px;
    cursor: pointer;
    contain: layout style;
}

.rcm-step.active {
    transform: scale(1.05);
}

.rcm-step:focus {
    outline: 2px solid #FC5D61;
    outline-offset: 2px;
}

.rcm-step img {
    transition: filter 0.2s ease-out;
    filter: grayscale(0.3);
    background: white;
    border-radius: 50%;
    will-change: filter;
}

.rcm-step.active img {
    filter: grayscale(0);
    box-shadow: 0 4px 8px rgba(252, 93, 97, 0.3);
}

/* Text options optimization */
.text-option {
    transition: all 0.2s ease-out;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 600;
    text-decoration: none;
    will-change: background-color, border-color, color;
}

.text-option.active,
.text-option.border-active {
    background-color: var(--secondary-color, #FC5D61);
    color: white !important;
    border-color: var(--secondary-color, #FC5D61);
}

/* Text animations with GPU acceleration */
.slide-text {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    contain: layout style;
}

.slide-up {
    transform: translateY(-100%);
}

.slide-down {
    transform: translateY(100%);
}

/* Optimized accordion styles */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    contain: layout style;
}

.accordion-content.show {
    max-height: 500px;
}

.accordion-trigger {
    transition: background-color 0.2s ease-out, color 0.2s ease-out;
    will-change: background-color, color;
}

/* Button optimizations */
.secondary-btn {
    background-color: #FC5D61;
    color: white;
    transition: background-color 0.2s ease-out;
    will-change: background-color;
}

.secondary-btn:hover {
    background-color: #e04a4f;
    color: white;
}

.primary-btn {
    transition: background-color 0.2s ease-out, color 0.2s ease-out;
    will-change: background-color, color;
}

/* Performance optimizations */
.img-fluid {
    contain: layout style;
}

section {
    contain: layout style;
}

.card {
    contain: layout style paint;
}

.container {
    contain: layout;
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .nmt-200 {
        margin-top: 0 !important;
    }
    
    .rw-100 {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .rm-0 {
        margin: 0 !important;
    }
    
    .desktop-tabs {
        display: none;
    }
    
    .tab-pane .card .card-body > h4 {
        text-align: left;
    }
    
    .tab-pane .card .card-body > p {
        text-align: justify;
    }
    
    .tab-pane .card .card-body {
        min-height: 363px !important;
    }
    
    .nav-pills .nav-link {
        margin-bottom: 10px;
        padding: 5px 10px;
        border-radius: 8px;
        background-color: #f8f9fa;
        border: 1px solid #ff5100;
        color: #2A3B7D;
        transition: background-color 0.2s ease-out, border-color 0.2s ease-out;
        will-change: background-color, border-color;
    }
    
    .nav-pills .nav-link.active {
        background-color: #ffffff !important;
        border: 2px solid #2A3B7D !important;
    }
    
    #v-pills-tab {
        width: 65px;
    }
    
    .tab-content {
        width: calc(100% - 65px);
    }
    
    /* Reduce animations on mobile for better performance */
    .slide-text,
    .accordion-trigger,
    .secondary-btn,
    .primary-btn,
    .rcm-step {
        transition: none !important;
    }
    
    .rcm-progress-line,
    .rcm-progress-line-active {
        transition: none !important;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .primary-btn,
    .secondary-btn {
        border: 2px solid;
    }
    
    .text-option {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .rcm-progress-container,
    .rcm-progress-line,
    .rcm-progress-line-active {
        display: none;
    }
    
    .hero-bg-img,
    .section-bg-1,
    .section-bg-2,
    .section-bg-3 {
        background-image: none !important;
    }
}
