/* Stats Section */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stat {
    text-align: center;
    padding: 2rem 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: all 0.2s ease;
}

.stat:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-lg);
}

.dark-theme .stat {
    background-color: var(--charcoal-800);
}

.dark-theme .stat:hover {
    border-color: var(--accent-400);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 0.75rem;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.modal-body {
    padding: 0.75rem;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.contact-option:hover {
    border-color: var(--primary-300);
    background-color: var(--primary-50);
}

.dark-theme .contact-option:hover {
    border-color: var(--accent-400);
    background-color: var(--charcoal-700);
}

.contact-option i {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--primary-600);
}

.dark-theme .contact-option i {
    color: var(--accent-400);
}

/* Ultra-Compact Modal Styles */
.modal-intro {
    text-align: center;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.modal-compact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.modal-compact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.25rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    text-align: center;
}

.modal-compact-item:hover {
    border-color: var(--primary-300);
    background-color: var(--primary-50);
    transform: translateY(-1px);
}

.dark-theme .modal-compact-item:hover {
    border-color: var(--accent-400);
    background-color: var(--charcoal-700);
}

.modal-compact-item i {
    color: var(--primary-600);
    width: 1.25rem;
    height: 1.25rem;
}

.dark-theme .modal-compact-item i {
    color: var(--accent-400);
}

.modal-compact-item span {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.modal-hours-compact {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.modal-hours-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background-color: var(--bg-secondary);
    border-radius: 0.3rem;
    border-left: 2px solid var(--border-color);
}

.modal-hours-row.emergency {
    border-left-color: var(--primary-600);
    background-color: var(--primary-50);
}

.dark-theme .modal-hours-row.emergency {
    border-left-color: var(--accent-400);
    background-color: var(--accent-900);
}

.modal-hours-row i {
    color: var(--primary-600);
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.dark-theme .modal-hours-row i {
    color: var(--accent-400);
}

.modal-hours-row.emergency i {
    color: var(--primary-700);
}

.dark-theme .modal-hours-row.emergency i {
    color: var(--accent-300);
}

.modal-hours-row span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

.modal-hours-row.emergency span {
    color: var(--primary-700);
    font-weight: 600;
}

.dark-theme .modal-hours-row.emergency span {
    color: var(--accent-300);
}



/* Responsive Design */

/* Mobile First - Base styles above are for mobile */

/* Small screens (640px and up) */
@media (min-width: 640px) {
    .container {
        padding: 0 2rem;
    }
    
    .nav-container {
        padding: 1rem 2rem;
    }
    
    .header {
        padding: 10rem 0 6rem;
    }
    
    .header-title {
        font-size: 3.75rem;
    }
    
    .header-subtitle {
        font-size: 3rem;
    }
    
    .header-cta {
        flex-direction: row;
        justify-content: center;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .section-subtitle {
        font-size: 2.75rem;
    }
    
    .page-title {
        font-size: 3rem;
    }
    
    .mobile-nav {
        display: none;
    }
    
    .nav-links {
        display: flex;
    }
    
    .contact-options {
        flex-direction: row;
    }
}

/* Medium screens (768px and up) */
@media (min-width: 768px) {
    .section {
        padding: 6rem 0;
    }
    
    .service-cards {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large screens (1024px and up) */
@media (min-width: 1024px) {
    .header-title {
        font-size: 4.5rem;
    }
    
    .header-subtitle {
        font-size: 3.75rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .page-title {
        font-size: 3.75rem;
    }
    
    .service-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra large screens (1280px and up) */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
    
    .nav-container {
        max-width: 1280px;
    }
    
    .header-container {
        max-width: 1280px;
    }
}

/* Mobile-specific styles */
@media (max-width: 639px) {
    .nav-links {
        display: none;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    body {
        padding-bottom: 5rem; /* Space for mobile nav */
    }
    
    .header {
        padding: 6rem 0 3rem;
    }
    
    .header-title {
        font-size: 2.5rem;
    }
    
    .header-subtitle {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1.875rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .value-props {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat {
        padding: 1.5rem 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 0.5rem;
        max-width: none;
        max-height: 75vh;
    }

    .modal-header {
        padding: 0.75rem;
    }

    .modal-body {
        padding: 0.5rem;
    }

    .contact-options {
        flex-direction: column;
    }

    .modal-compact-grid {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .modal-compact-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.5rem;
        text-align: left;
    }

    .modal-compact-item i {
        width: 1rem;
        height: 1rem;
    }

    .modal-hours-row {
        padding: 0.35rem 0.4rem;
    }

    .modal-hours-row span {
        font-size: 0.7rem;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .service-card-detailed h4 {
        padding-right: 7rem; /* Even more space on very small screens */
        font-size: 1rem; /* Smaller title */
        min-height: 3.5rem; /* More vertical space */
    }

    .service-card-detailed .service-price {
        font-size: 0.6rem; /* Very small font */
        padding: 0.1rem 0.25rem; /* Minimal padding */
        max-width: 6.5rem; /* Maximum available width */
        top: 0.5rem;
        right: 0.25rem;
        line-height: 1.0;
    }
}

/* Print styles */
@media print {
    .navigation,
    .mobile-nav,
    .header-cta,
    .modal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .page {
        display: block !important;
    }
    
    .section {
        break-inside: avoid;
    }
}

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

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.5);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .service-card,
    .stat,
    .value-prop {
        border: 2px solid var(--border-color);
    }
}

/* Responsive Styles for Phases and Footer */

/* Small screens (640px and up) */
@media (min-width: 640px) {
    .cta-buttons {
        flex-direction: row;
        justify-content: center;
    }

    .cta-title {
        font-size: 2.5rem;
    }

    .process-phases {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        justify-content: center;
    }

    .footer-bottom-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .footer-certifications {
        gap: 1.5rem;
    }
}

/* Medium screens (768px and up) */
@media (min-width: 768px) {
    .process-phases {
        grid-template-columns: repeat(2, 1fr);
        justify-content: center;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .footer-credentials {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* Large screens (1024px and up) */
@media (min-width: 1024px) {
    .cta-title {
        font-size: 3rem;
    }

    .process-phases {
        grid-template-columns: repeat(3, 1fr);
        justify-content: center;
    }

    .phase-card {
        padding: 2.5rem;
    }

    .footer-top {
        padding: 4rem 0;
    }
}

/* Extra large screens (1280px and up) */
@media (min-width: 1280px) {
    .process-phases {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
        justify-content: center;
    }

    .phase-card {
        min-height: 280px;
    }
}

/* Mobile-specific styles for phases and footer */
@media (max-width: 639px) {
    .process-phases {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .phase-card {
        padding: 1.5rem;
    }

    .phase-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .phase-number {
        font-size: 1.5rem;
        min-width: auto;
    }

    .cta-title {
        font-size: 1.875rem;
    }

    .cta-description {
        font-size: 1rem;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 0;
        max-width: none;
    }

    .footer-section-title {
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }

    .footer-contact {
        align-items: center;
    }

    .contact-item {
        justify-content: center;
        text-align: center;
    }

    .business-hours {
        text-align: center;
    }

    .hours-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .footer-bottom-content {
        gap: 1.5rem;
    }

    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-certifications {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Print styles for phases and footer */
@media print {
    .footer {
        background: white !important;
        color: black !important;
        border-top: 2px solid black;
    }

    .phase-card {
        background: white !important;
        color: black !important;
        border: 1px solid black;
    }

    .cta-section {
        background: white !important;
    }

    .cta-buttons {
        display: none !important;
    }

    .search-filter-section {
        background: white !important;
        border: 1px solid black;
    }
}

/* Responsive Styles for Search and Services */

/* Small screens (640px and up) */
@media (min-width: 640px) {
    .filter-tabs {
        justify-content: center;
    }

    .quick-links {
        justify-content: center;
    }

    .service-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }

    .category-header {
        flex-direction: row;
        text-align: center;
        justify-content: center;
    }
}

/* Medium screens (768px and up) */
@media (min-width: 768px) {
    .search-filter-section {
        padding: 3rem;
    }

    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-icon {
        width: 3rem;
        height: 3rem;
    }

    .category-info h2 {
        font-size: 2.25rem;
    }

    /* Ensure price doesn't overlap on medium screens */
    .service-card-detailed h4 {
        padding-right: 8rem; /* Make room for price */
        text-align: left;
    }

    /* Tablet service price adjustments */
    .service-card-detailed .service-price {
        font-size: 0.75rem; /* Slightly larger on tablets */
        padding: 0.25rem 0.5rem;
        max-width: 5rem;
        top: 1rem;
        right: 0.75rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Large screens (1024px and up) */
@media (min-width: 1024px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .service-card-detailed {
        padding: 2.5rem;
    }
}

/* Small tablet styles for service cards */
@media (min-width: 640px) and (max-width: 767px) {
    .service-card-detailed h4 {
        padding-right: 7rem; /* Make room for price on small tablets */
        text-align: left;
    }
}

/* Mobile-specific styles for search and services */
@media (max-width: 639px) {
    .search-filter-section {
        margin: 2rem 0;
        padding: 1.5rem;
    }

    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .filter-tabs {
        gap: 0.25rem;
    }

    .filter-tab {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .quick-links {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .quick-links-label {
        margin-bottom: 0.5rem;
    }

    .service-category {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .category-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .category-info h2 {
        font-size: 1.5rem;
    }

    .service-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-card-detailed {
        padding: 1.5rem;
    }

    .service-card-detailed h4 {
        padding-right: 6rem; /* More space for longer prices */
        text-align: left;
        font-size: 1.125rem; /* Slightly smaller title */
        line-height: 1.3;
        min-height: 3rem; /* More space for 2-3 lines */
        display: flex;
        align-items: flex-start;
    }

    .service-card-detailed .service-price {
        position: absolute;
        top: 0.75rem;
        right: 0.5rem;
        font-size: 0.65rem; /* Smaller font on mobile */
        padding: 0.15rem 0.3rem; /* Tighter padding */
        max-width: 5.5rem; /* More width for longer prices */
        text-align: center;
        line-height: 1.1;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .no-results-content i {
        width: 3rem;
        height: 3rem;
    }

    .no-results-content h3 {
        font-size: 1.25rem;
    }
}
