/* Enhanced Mobile Styles for SWS Personal Injury */

/* Custom viewport height for mobile browsers */
:root {
    --vh: 1vh;
}

/* Header scroll states */
.header {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header.scrolled .logo-text {
    font-size: 1.75rem;
}

/* Mobile-specific body adjustments */
.is-mobile {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.touch-device *:hover {
    transform: none !important;
    box-shadow: none !important;
}

.keyboard-visible .mobile-cta-bar {
    display: none !important;
}

/* Mobile Navigation Menu */
.mobile-menu-toggle {
    display: none;
    width: 35px;
    height: 35px;
    position: relative;
    cursor: pointer;
    z-index: 1002;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary);
    margin: 5px auto;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Tablet Styles (769px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }

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

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

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

    .section-title {
        font-size: 2rem;
    }
}

/* Enhanced Mobile Styles (max-width: 768px) */
@media (max-width: 768px) {
    /* Mobile Header */
    .header {
        padding: 0.5rem 0;
    }

    .nav-wrapper {
        flex-direction: row;
        justify-content: space-between;
        padding: 0.75rem 0;
    }

    .logo {
        order: 1;
    }

    .logo-text {
        font-size: 1.5rem;
    }

    .logo-subtitle {
        font-size: 0.75rem;
    }

    .mobile-menu-toggle {
        display: block;
        order: 3;
    }

    /* Mobile Navigation Overlay */
    .main-nav {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 1.5rem;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1001;
    }

    .main-nav.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .header-cta {
        display: none;
    }

    /* Mobile CTA in Navigation */
    .main-nav .mobile-cta {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-top: 2rem;
        padding-top: 2rem;
        border-top: 2px solid var(--primary);
    }

    .main-nav .phone-number {
        font-size: 1.25rem;
        text-align: center;
    }

    /* Hero Mobile Adjustments */
    .hero {
        margin-top: 60px;
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin: 1rem 0;
    }

    /* Attorney Widget Mobile */
    .attorney-widget {
        padding: 1.5rem;
        margin: 2rem 0;
    }

    .attorney-widget h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .expertise-item {
        padding: 0.75rem;
    }

    .expertise-number {
        font-size: 1.5rem;
    }

    .expertise-label {
        font-size: 0.7rem;
    }

    .attorney-message {
        font-size: 0.9rem;
        line-height: 1.5;
        padding: 1rem;
    }

    .attorney-signature {
        font-size: 0.8rem;
    }

    /* Hero Stats Mobile */
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        margin: 2rem 0;
    }

    .stat-item {
        padding: 1rem;
        width: 100%;
    }

    /* Services Section Mobile */
    .services {
        padding: 3rem 0;
    }

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

    .service-card {
        padding: 1.5rem;
    }

    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

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

    /* Calculator Mobile */
    .calculator {
        padding: 3rem 0;
    }

    .calculator-container {
        padding: 1.5rem;
    }

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

    .calculator-item {
        padding: 0.75rem;
    }

    .calculator-label {
        font-size: 0.8rem;
    }

    .calculator-value {
        font-size: 0.9rem;
    }

    .calculate-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    /* Coverage Section Mobile */
    .coverage {
        padding: 3rem 0;
    }

    .coverage-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

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

    .area-card {
        padding: 1rem;
    }

    .area-name {
        font-size: 1rem;
    }

    /* Results Timeline Mobile */
    .results {
        padding: 3rem 0;
    }

    .timeline {
        padding: 0;
    }

    .timeline:before {
        left: 20px;
    }

    .timeline-item {
        padding-left: 50px !important;
        padding-right: 15px !important;
        margin-bottom: 2rem;
    }

    .timeline-dot {
        width: 30px;
        height: 30px;
        left: 20px;
    }

    .timeline-content {
        padding: 1rem;
    }

    .result-amount {
        font-size: 1.5rem;
    }

    .result-type {
        font-size: 0.9rem;
    }

    /* Contact Section Mobile */
    .contact {
        padding: 3rem 0;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-form {
        padding: 0;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .contact-info-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Footer Mobile */
    .footer {
        padding: 3rem 0 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-column h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .footer-links {
        gap: 0.5rem;
    }

    .footer-bottom {
        padding: 1.5rem 0;
        text-align: center;
    }

    /* Chat Widget Mobile */
    .chat-widget {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        display: none;
    }

    .chat-widget.active {
        display: flex;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-toggle {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
}

/* Small Mobile Optimizations (max-width: 400px) */
@media (max-width: 400px) {
    .container {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .text-accent {
        font-size: 1.3rem;
    }

    .expertise-grid {
        grid-template-columns: 1fr;
    }

    .attorney-widget {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .footer-disclaimer {
        font-size: 0.7rem;
    }
}

/* Mobile Landscape Optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 1rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .attorney-widget {
        display: none; /* Hide on landscape to save space */
    }

    .hero-stats {
        flex-direction: row;
        justify-content: space-around;
    }

    .stat-item {
        padding: 0.5rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link,
    .cta-button,
    .tab-button,
    .calculate-btn,
    button {
        min-height: 44px; /* iOS recommended touch target */
        display: inline-flex;
        align-items: center;
    }

    /* Remove hover effects on touch devices */
    .service-card:hover,
    .area-card:hover {
        transform: none;
    }

    /* Better spacing for touch */
    .form-group {
        margin-bottom: 1.5rem;
    }
}

/* Hide mobile elements by default */
.mobile-cta-bar {
    display: none;
}

.main-nav .mobile-cta {
    display: none;
}

/* Fixed Mobile CTA Bar */
@media (max-width: 768px) {
    .main-nav .mobile-cta {
        display: flex;
    }

    .mobile-cta-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
        padding: 0.75rem;
        justify-content: space-around;
        align-items: center;
    }

    .mobile-cta-bar .phone-btn,
    .mobile-cta-bar .chat-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--primary);
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .mobile-cta-bar .icon {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--gradient);
        color: white;
        border-radius: 50%;
        font-size: 14px;
    }

    /* Adjust content for fixed CTA bar */
    body {
        padding-bottom: 70px;
    }
}

/* Performance Optimizations */
@media (max-width: 768px) {
    /* Disable complex animations on mobile */
    .animated-gradient {
        animation: none;
        background: var(--gradient);
    }

    /* Simplify AOS animations */
    [data-aos] {
        transition: opacity 0.3s ease !important;
        transform: none !important;
    }

    /* Reduce parallax effects */
    .parallax {
        background-attachment: scroll;
    }
}