/* ===== MOBILE RESPONSIVE FIXES ===== */

/* Mobile Section Spacing - Reduce gaps between sections */
@media (max-width: 768px) {
    /* Reduce section padding to keep content closer */
    section {
        padding: 60px 0 !important;
    }
    
    /* Specific section adjustments */
    .hero {
        padding: 140px 0 60px !important;
    }
    
    .experience-ai-employee {
        padding: 60px 0 !important;
    }
    
    .revenue-calculator-section {
        padding: 60px 0 !important;
    }
    
    .testimonials {
        padding: 60px 0 !important;
    }
    
    .features {
        padding: 60px 0 !important;
    }
    
    .industries {
        padding: 60px 0 !important;
    }
    
    .faqs {
        padding: 60px 0 !important;
    }
    
    /* Mobile Button Text Balance Fixes */
    .btn-large {
        white-space: normal;
        line-height: 1.3;
        text-align: center;
        min-height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: row;
        gap: 8px;
    }
    
    /* Button text should break evenly */
    .btn-large span {
        line-height: 1.3;
        text-align: center;
        display: inline-block;
    }
    
    /* Line breaks should work on mobile */
    .btn-large span br {
        display: inline;
    }
    
    /* Specific button improvements */
    .hero-demo-btn,
    .demo-cta .btn-large,
    #calculateCTA {
        max-width: 300px;
        padding: 16px 24px;
    }
    
    /* Icon spacing */
    .btn-large i {
        flex-shrink: 0;
        margin-left: 4px;
    }
    
    /* Other CTA buttons */
    .cta-button span {
        line-height: 1.3;
        text-align: center;
    }
}

/* Tablet-specific fixes (481px - 1024px) - covers both portrait and landscape tablets */
@media (min-width: 481px) and (max-width: 1024px) {
    /* Ensure hero content is fully centered on tablets */
    .hero {
        text-align: center !important;
        padding: 140px 0 80px !important;
    }
    
    .hero-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    .hero-text {
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto !important;
    }
    
    .hero-title {
        text-align: center !important;
        width: 100% !important;
        margin: 0 auto 20px auto !important;
    }
    
    .hero-subtitle {
        text-align: center !important;
        margin: 0 auto 32px auto !important;
        width: 90% !important;
        max-width: 600px !important;
    }
    
    .hero-cta {
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    /* Hero visual optimization for tablets */
    .hero-visual {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 40px auto 0 auto !important;
    }
    
    .ai-visualization {
        width: 100% !important;
        max-width: 600px !important;
    }
}

/* Extra small mobile - even tighter spacing */
@media (max-width: 480px) {
    section {
        padding: 50px 0 !important;
    }
    
    .hero {
        padding: 120px 0 50px !important;
        text-align: center !important;
    }
    
    /* Force center alignment on very small screens */
    .hero-content,
    .hero-text,
    .hero-title,
    .hero-subtitle,
    .hero-cta {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Mobile Navigation Fixes */
@media (max-width: 768px) {
    /* Navigation improvements */
    .nav {
        padding: 0 16px;
    }
    
    .nav-actions {
        gap: 8px;
    }
    
    /* Hide login button on mobile to reduce clutter */
    .nav-actions .btn-secondary {
        display: none;
    }
    
    /* Make phone button smaller and more mobile-friendly */
    .nav-actions .btn-primary {
        padding: 8px 12px;
        font-size: 0.8rem;
        min-width: auto;
        white-space: nowrap;
    }
    
    .nav-actions .btn-primary span {
        display: none; /* Hide phone number text on mobile */
    }
    
    .nav-actions .btn-primary i {
        font-size: 1rem;
        margin: 0;
    }
    
    /* Logo adjustments */
    .logo-img {
        height: 36px;
        max-width: 160px;
    }
    
    /* Hero section fixes */
    .hero {
        padding: 140px 0 80px;
        text-align: center;
    }
    
    .hero-content {
        text-align: center;
        align-items: center;
        justify-content: center;
    }
    
    .hero-text {
        text-align: center;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    /* Fix hero title sizing and centering */
    .hero-title {
        font-size: clamp(2rem, 7vw, 2.8rem) !important;
        text-align: center;
        line-height: 1.2;
        margin-bottom: 20px;
        width: 100%;
    }
    
    /* Typewriter text centering */
    .typewriter-container {
        text-align: center;
        display: block;
        width: 100%;
        justify-content: center;
    }
    
    .typewriter-text {
        text-align: center !important;
        display: block;
        width: 100%;
    }
    
    /* Hero subtitle centering */
    .hero-subtitle {
        text-align: center;
        margin: 0 auto 32px auto;
        max-width: 90%;
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* Hero CTA centering */
    .hero-cta {
        justify-content: center;
        text-align: center;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    
    .hero-demo-note {
        text-align: center;
        font-size: 0.9rem;
        margin: 0 auto;
    }
    
    /* Button improvements - better text balance */
    .btn-large {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        text-align: center;
        white-space: normal;
        line-height: 1.3;
        min-height: 56px;
        padding: 14px 20px;
        display: flex;
        align-items: center;
    }
    
    /* Specific button text adjustments for better balance */
    .hero-demo-btn {
        max-width: 300px;
    }
    
    .hero-demo-btn span {
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.3;
    }
    
    /* Container padding */
    .container {
        padding: 0 16px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .nav {
        padding: 0 12px;
    }
    
    .nav-actions {
        gap: 6px;
    }
    
    /* Even smaller phone button */
    .nav-actions .btn-primary {
        padding: 6px 10px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    /* Logo further adjustments */
    .logo-img {
        height: 32px;
        max-width: 140px;
    }
    
    /* Hero title smaller for very small screens */
    .hero-title {
        font-size: clamp(1.8rem, 8vw, 2.4rem) !important;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 28px;
        padding: 0 8px;
    }
    
    /* Container adjustments */
    .container {
        padding: 0 12px;
    }
    
    /* Button adjustments - better text wrapping */
    .btn-large {
        font-size: 0.95rem;
        padding: 12px 20px;
        min-height: 52px;
        line-height: 1.3;
    }
    
    /* Smaller button text for very small screens */
    .btn-large {
        font-size: 0.9rem;
        padding: 12px 16px;
        min-height: 48px;
    }
    
    .btn-large span {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    /* Adjust specific buttons for very small screens */
    .hero-demo-btn,
    .demo-cta .btn-large,
    #calculateCTA {
        max-width: 260px;
        padding: 12px 18px;
    }
}

/* Landscape mode fixes for mobile */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 6vw, 2.2rem) !important;
        margin-bottom: 16px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
}

/* Ensure proper text alignment for all hero elements */
.hero * {
    text-align: center;
}

/* Fix any left-aligned elements in hero */
.hero .hero-text,
.hero .hero-content,
.hero .hero-title,
.hero .hero-subtitle,
.hero .hero-cta {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Additional centering for typewriter effect */
.typewriter-container,
.text-gradient {
    display: inline-block;
    text-align: center;
    width: 100%;
}

/* Force center alignment for all mobile and tablet devices */
@media (max-width: 768px) {
    /* Stronger centering rules for hero section */
    .hero * {
        text-align: center !important;
    }
    
    .hero .container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .hero-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        margin: 0 auto !important;
        max-width: 100% !important;
        grid-template-columns: 1fr !important; /* Override desktop grid */
        gap: 20px !important;
    }
    
    /* Override desktop text alignment */
    .hero-title {
        text-align: center !important;
    }
    
    .hero-text {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    /* Typewriter container centering */
    .typewriter-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .typewriter-text {
        text-align: center !important;
        width: 100% !important;
        display: block !important;
    }
    
    /* Hero visual alignment */
    .hero-visual {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
        text-align: center !important;
    }
}

/* Mobile navigation menu improvements */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        padding: 24px;
        border-top: 1px solid var(--glass-border);
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        display: none;
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-menu.mobile-open {
        display: flex;
        transform: translateY(0);
    }
    
    .nav-link {
        padding: 12px 0;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    /* Hamburger menu animation */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Ensure nav-toggle is visible on mobile */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
        z-index: 1001;
    }
    
    /* Additional hero section override for stubborn elements */
    .hero .hero-content {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .hero .hero-text,
    .hero .hero-visual {
        width: 100% !important;
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    /* Industries section subtitle - ensure single line */
    #industries .section-subtitle {
        font-size: 1.1rem;
        line-height: 1.3;
        white-space: nowrap;
        max-width: 90%;
        margin: 0 auto;
    }
    
    /* Features section subtitle - ensure single line */
    #features .section-subtitle {
        font-size: 1.1rem;
        line-height: 1.3;
        white-space: nowrap;
        max-width: 90%;
        margin: 0 auto;
    }
}

/* Extra small mobile - more aggressive subtitle adjustment */
@media (max-width: 480px) {
    #industries .section-subtitle {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    #features .section-subtitle {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

/* For very small screens, use a shorter version */
@media (max-width: 360px) {
    #industries .section-subtitle {
        font-size: 0.9rem;
    }
    
    #features .section-subtitle {
        font-size: 0.9rem;
    }
}

/* Desktop and tablet - ensure single line with better spacing */
@media (min-width: 769px) {
    #industries .section-subtitle {
        font-size: 1.25rem;
        line-height: 1.4;
        white-space: nowrap;
        max-width: 700px;
        margin: 0 auto;
    }
    
    #features .section-subtitle {
        font-size: 1.25rem;
        line-height: 1.4;
        white-space: nowrap;
        max-width: 700px;
        margin: 0 auto;
    }
    
    /* Hide manual line breaks in buttons on desktop */
    .btn-large span br {
        display: none;
    }
}