/**
 * ADDITIONAL MOBILE IMPROVEMENTS
 * Fixes: Header overlap, CTA size, scrollers, video strips, menu, chat length, text alignment
 */

/* ========================================
   FIX 1: Header Covering Hero Headline
======================================== */

/* Add padding to hero section to account for fixed header */
.hero {
    padding-top: 80px !important; /* Increased from 70px to prevent overlap */
}

@media (max-width: 768px) {
    .hero {
        padding-top: 70px !important;
    }
    
    .hero .container {
        padding-top: 1.5rem !important; /* Add extra space below nav */
    }
}

/* ========================================
   FIX 2: Brand Name - Short Version
======================================== */

@media (max-width: 768px) {
    .brand-name {
        max-width: none !important;
        font-size: 0.9rem !important;
        white-space: nowrap;
    }
}

/* ========================================
   FIX 3: Decrease Header CTA Size on Mobile
======================================== */

@media (max-width: 768px) {
    .nav-cta-btn {
        padding: 0.35rem 0.65rem !important;
        font-size: 0.7rem !important;
        min-height: 36px !important;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .nav-cta-btn {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.65rem !important;
        min-height: 32px !important;
    }
}

/* ========================================
   FIX 4: Remove Horizontal Scrollers
======================================== */

/* Remove scrollers from pricing section */
.pricing-section {
    overflow-x: hidden !important;
}

.pricing-grid {
    overflow-x: hidden !important;
}

.pricing-card {
    overflow-x: hidden !important;
}

/* Remove scrollers from process section */
.process-section {
    overflow-x: hidden !important;
}

.process-timeline {
    overflow-x: hidden !important;
}

/* Ensure all sections don't scroll horizontally */
@media (max-width: 768px) {
    .video-demos-section,
    .pricing-section,
    .comparison-section,
    .roi-calculator-section,
    .audience-section,
    .process-section,
    .faq-section {
        overflow-x: hidden !important;
    }
    
    .videos-grid,
    .pricing-grid,
    .comparison-grid,
    .calculator-container,
    .audience-grid,
    .process-timeline {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ========================================
   FIX 5: Remove White Horizontal Strip on Videos
======================================== */

.video-card {
    overflow: hidden !important;
    border: none !important;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000 !important;
    border: none !important;
    margin: 0 !important;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none !important;
    display: block;
}

.video-overlay {
    border: none !important;
    outline: none !important;
}

.play-button {
    border: none !important;
}

/* Remove any white strips or gaps */
.video-card .video-container {
    margin-bottom: 0 !important;
    padding-bottom: 56.25% !important;
    line-height: 0 !important;
}

.video-info {
    margin-top: 0 !important;
    padding-top: 1.5rem !important;
    border-top: none !important;
}

/* ========================================
   FIX 6: Mobile Menu Visibility
======================================== */

/* Mobile hamburger menu */
@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Hidden by default */
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        z-index: 999;
        border-bottom: 2px solid #22c55e;
    }
    
    .nav-menu.active {
        display: flex !important;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        font-size: 0.95rem;
        color: #111827;
        background: #f3f4f6;
        text-align: center;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        background: rgba(34, 197, 94, 0.1);
        color: #22c55e;
    }
    
    /* Hamburger menu button */
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.25rem;
        color: #22c55e;
        cursor: pointer;
        padding: 0.5rem;
        margin-left: 0.5rem;
    }
}

/* Desktop - hide hamburger */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .nav-menu {
        display: flex !important;
    }
}

/* ========================================
   FIX 7: Increase Chat Box Length on Mobile
======================================== */

@media (max-width: 768px) {
    .video-overlay {
        max-height: none !important; /* Remove height restriction */
    }
    
    .chat-messages {
        max-height: 600px !important; /* Increased from 400px */
        overflow-y: auto !important;
        padding: 1rem !important;
    }
    
    .demo-chat {
        width: 100%;
        max-width: 100%;
    }
    
    /* Make sure all messages are visible */
    .message {
        margin-bottom: 0.75rem;
    }
    
    .message-bubble {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        max-width: 80% !important;
        padding: 0.6rem 0.8rem !important;
    }
    
    /* Better scrollbar for chat */
    .chat-messages::-webkit-scrollbar {
        width: 6px;
    }
    
    .chat-messages::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 3px;
    }
    
    .chat-messages::-webkit-scrollbar-thumb {
        background: rgba(34, 197, 94, 0.4);
        border-radius: 3px;
    }
    
    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: rgba(34, 197, 94, 0.6);
    }
}

/* ========================================
   FIX 8: Text Alignment - Desktop & Tablet Left, Mobile Center
======================================== */

/* Mobile: Keep centered */
@media (max-width: 768px) {
    .hero-title,
    .hero-description,
    .hero-badge {
        text-align: center !important;
    }
}

/* Tablet and Desktop: Align left */
@media (min-width: 769px) {
    .hero-content {
        text-align: left !important;
    }
    
    .hero-text {
        text-align: left !important;
    }
    
    .hero-title {
        text-align: left !important;
        margin-left: 0 !important;
        margin-right: auto !important;
    }
    
    .hero-description {
        text-align: left !important;
    }
    
    .hero-badge {
        margin-left: 0 !important;
        margin-right: auto !important;
    }
    
    .hero-stats {
        justify-content: flex-start !important;
    }
    
    .hero-ctas {
        justify-content: flex-start !important;
    }
}

/* ========================================
   ADDITIONAL REFINEMENTS
======================================== */

/* Smooth scroll behavior for anchor links */
html {
    scroll-behavior: smooth;
}

/* Prevent any element from causing horizontal scroll */
@media (max-width: 768px) {
    * {
        max-width: 100%;
    }
    
    /* Specific elements that might overflow */
    img, video, iframe, embed, object {
        max-width: 100%;
        height: auto;
    }
    
    /* Tables */
    table {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        display: block;
    }
    
    /* Pre and code blocks */
    pre, code {
        max-width: 100%;
        overflow-x: auto;
        word-wrap: break-word;
    }
}

/* Better spacing for video cards to prevent white lines */
.video-card {
    margin-bottom: 0 !important;
}

.video-card:not(:last-child) {
    margin-bottom: 2rem !important;
}

/* Ensure pricing cards don't overflow */
@media (max-width: 768px) {
    .pricing-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .pricing-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

/* Process timeline mobile fix */
@media (max-width: 768px) {
    .process-timeline {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 2rem;
        width: 100%;
        max-width: 100%;
    }
    
    .process-step {
        width: 100%;
        max-width: 100%;
    }
}

/* Mobile menu overlay when active */
@media (max-width: 768px) {
    body.menu-active {
        overflow: hidden;
    }
    
    .menu-overlay {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }
    
    .menu-overlay.active {
        display: block;
    }
}

/* Hero section video container in mobile */
@media (max-width: 768px) {
    .hero .video-container {
        position: relative;
        padding-bottom: 0 !important;
        height: auto !important;
    }
    
    .hero .video-container video {
        position: relative;
        width: 100%;
        height: auto;
    }
}

/* Ensure navbar doesn't cause overflow */
.navbar .container {
    max-width: 100% !important;
    overflow: visible !important;
}

/* Fix for chat header */
.whatsapp-demo .chat-header {
    padding: 0.75rem 1rem !important;
    font-size: 0.85rem !important;
}

.whatsapp-demo .chat-header span {
    font-size: 0.8rem !important;
}

/* Mobile menu button styling */
.mobile-menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #22c55e;
    font-size: 1.5rem;
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Improved mobile navigation container */
@media (max-width: 768px) {
    .navbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding: 0 1rem;
    }
    
    .nav-brand {
        flex: 0 0 auto;
    }
    
    .nav-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 0 0 auto;
    }
}
