/* CLEDA Mobile Optimizations - Fixed Version */

/* Base Mobile Resets */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-touch-callout: none;
    }
    
    body {
        font-size: 16px;
        line-height: 1.6;
        overflow-x: hidden;
    }
    
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Navigation Mobile - CRITICAL FIXES */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem !important;
        height: 80px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    /* Logo Visibility Fix - BIGGER */
    .logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        z-index: 1001 !important;
    }
    
    .logo-icon {
        width: 70px !important;
        height: 70px !important;
        display: flex !important;
        flex-shrink: 0 !important;
    }
    
    .logo-image {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }
    
    .logo-text {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .logo-title {
        font-size: 1.1rem !important;
        line-height: 1.2 !important;
        font-weight: 600 !important;
    }
    
    .logo-subtitle {
        font-size: 0.6rem !important;
        line-height: 1.1 !important;
        opacity: 0.9 !important;
    }
    
    /* Desktop Nav Menu - Hide */
    .nav-menu {
        display: none !important;
    }
    
    /* Mobile Menu Button - Show and Make More Visible */
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        z-index: 1001 !important;
        order: 3 !important;
        background: rgba(0, 119, 133, 0.1) !important;
        padding: 0.65rem !important;
        border-radius: 8px !important;
    }
    
    .mobile-menu-btn span {
        width: 28px !important;
        height: 3px !important;
        background: #003366 !important;
        border-radius: 2px !important;
        display: block !important;
    }
    
    /* Navigation CTA Button Fix - NOT full width in nav */
    .nav-menu .nav-cta {
        display: none !important;
    }
    
    /* Mobile Menu */
    .mobile-menu {
        top: 80px !important;
    }
    
    .mobile-nav-menu {
        padding: 1rem !important;
    }
    
    .mobile-nav-item {
        margin-bottom: 0.5rem !important;
    }
    
    .mobile-nav-link {
        padding: 0.875rem 1rem !important;
        font-size: 1rem !important;
        display: block !important;
    }
    
    /* Join Marketplace in Mobile Menu - SMALLER */
    .mobile-nav-menu .nav-cta {
        display: block !important;
        width: auto !important;
        max-width: 200px !important;
        margin: 1rem auto 0.5rem !important;
        text-align: center !important;
        padding: 0.75rem 1.25rem !important;
        font-size: 0.95rem !important;
    }
}

/* Hero Section Mobile - Fix spacing */
@media (max-width: 768px) {
    .hero {
        min-height: 100vh !important;
        padding-top: 80px !important;
        padding-bottom: 60px !important;
    }
    
    .hero-content {
        padding: 2rem 1rem 3rem !important;
    }
    
    .hero h1 {
        font-size: 2.2rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.2 !important;
    }
    
    .hero-subtitle {
        font-size: 1.2rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-description {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    /* CTA Buttons - Fix spacing and layout */
    .cta-buttons {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: center !important;
        margin-bottom: 6rem !important; /* Extra space before stats */
        padding: 0 1rem !important;
    }
    
    .cta-buttons .btn {
        width: 100% !important;
        max-width: 350px !important;
        padding: 1rem 2rem !important;
        font-size: 1.05rem !important;
        text-align: center !important;
        display: block !important;
    }
    
    /* Stats Section - Fix overlap */
    .stats {
        margin-top: -40px !important; /* Reduced from -120px */
        padding-top: 0 !important;
    }
    
    .stats-container {
        padding: 1rem !important;
        gap: 1rem !important;
    }
}

/* Typography Mobile */
@media (max-width: 768px) {
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
    h3 { font-size: 1.5rem !important; }
    h4 { font-size: 1.25rem !important; }
    h5 { font-size: 1.1rem !important; }
    h6 { font-size: 1rem !important; }
    
    p { font-size: 1rem; line-height: 1.6; }
}

/* Containers Mobile */
@media (max-width: 768px) {
    .container, [class*="container"]:not(.nav-container):not(.hero-content) {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }
}

/* Grids Mobile */
@media (max-width: 768px) {
    [class*="grid"], .team-grid, .resources-grid, .feature-grid,
    .ecosystem-grid, .values-grid, .contact-grid, .support-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* Cards Mobile */
@media (max-width: 768px) {
    [class*="card"] {
        padding: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .stat-card {
        padding: 1.5rem !important;
    }
}

/* Buttons Mobile - General (NOT navigation) */
@media (max-width: 768px) {
    button:not(.mobile-menu-btn), 
    .btn:not(.nav-cta):not(.mobile-nav-link), 
    [class*="button"]:not(.mobile-menu-btn),
    [class*="-btn"]:not(.mobile-menu-btn):not(.nav-cta):not(.submit-btn) {
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Form buttons should be full width */
    .submit-btn, .form-section button[type="submit"],
    .contact-form-section button[type="submit"] {
        width: 100% !important;
        display: block !important;
    }
}

/* Forms Mobile */
@media (max-width: 768px) {
    .form-control, input, select, textarea {
        width: 100% !important;
        padding: 0.875rem 1rem !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }
    
    .form-group {
        margin-bottom: 1.25rem !important;
    }
    
    label {
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem !important;
    }
}

/* Tables Mobile */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    thead {
        display: none;
    }
    
    tbody, tr, td {
        display: block;
        width: 100%;
    }
    
    td {
        text-align: left;
        padding: 0.5rem;
        position: relative;
        padding-left: 50%;
    }
    
    td:before {
        content: attr(data-label);
        position: absolute;
        left: 0.5rem;
        font-weight: 600;
    }
}

/* Images Mobile */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Spacing Mobile */
@media (max-width: 768px) {
    section:not(.hero):not(.stats) {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }
    
    [class*="section"]:not([class*="hero"]):not([class*="nav"]) {
        padding: 60px 20px !important;
    }
}

/* Modals Mobile */
@media (max-width: 768px) {
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 1rem !important;
        padding: 1.5rem !important;
    }
}

/* Dropdowns Mobile */
@media (max-width: 768px) {
    .dropdown-content {
        position: relative !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0.5rem 0 !important;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem !important;
    }
}

/* Touch Targets - Minimum 44px */
@media (max-width: 768px) {
    a, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .nav-container {
        height: 75px !important;
        padding: 0 0.75rem !important;
    }
    
    
    .logo-icon {
        width: 60px !important;
        height: 60px !important;
    }
    
    .logo-title {
        font-size: 1rem !important;
    }
    
    .logo-subtitle {
        font-size: 0.55rem !important;}
    
    .hero h1 {
        font-size: 1.8rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
    }
    
    .hero-description {
        font-size: 0.95rem !important;
    }
    
    .mobile-menu {
        top: 65px !important;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto !important;
        padding-top: 80px !important;
        padding-bottom: 40px !important;
    }
    
    .hero h1 {
        font-size: 1.8rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-description {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .cta-buttons {
        margin-bottom: 3rem !important;
    }
    
    .cta-buttons .btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.95rem !important;
    }
}

/* ========================================
   COMPREHENSIVE SUB-PAGE MOBILE OPTIMIZATION
   ======================================== */

/* All Hero Sections */
@media (max-width: 768px) {
    [class*="hero"], [class*="-hero"] {
        padding: 80px 20px 60px !important;
        min-height: auto !important;
    }
    
    [class*="hero"] h1, [class*="-hero"] h1,
    [class*="hero-title"], .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1.5rem !important;
    }
    
    [class*="hero-subtitle"], [class*="hero"] .subtitle,
    [class*="hero"] p.subtitle {
        font-size: 1.2rem !important;
        line-height: 1.5 !important;
    }
    
    [class*="hero-tagline"] {
        font-size: 1.3rem !important;
    }
    
    [class*="hero-description"] {
        font-size: 1rem !important;
    }
}

/* All Section Spacing */
@media (max-width: 768px) {
    [class*="-section"], section {
        padding: 60px 20px !important;
    }
    
    .services-section, .content-section, .features-section,
    .process-section, .pricing-section, .stats-section,
    .partnership-section, .cta-section {
        padding: 60px 20px !important;
    }
}

/* Section Headers */
@media (max-width: 768px) {
    [class*="section-header"] h2, .section-title,
    [class*="-section"] h2, section h2 {
        font-size: 2rem !important;
        margin-bottom: 1.5rem !important;
        text-align: center !important;
    }
    
    [class*="section-subtitle"], [class*="section-header"] p {
        font-size: 1.1rem !important;
        text-align: center !important;
    }
}

/* All Grids - Make Single Column */
@media (max-width: 768px) {
    [class*="grid"]:not(.gallery-grid):not(.stat-items) {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .services-grid, .features-grid, .process-grid,
    .pricing-grid, .benefits-grid, .industries-grid,
    .ecosystem-grid, .values-grid, .hero-stats {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* Stats Grids - 2 columns on mobile */
@media (max-width: 768px) {
    [class*="stats-grid"], [class*="hero-stats"],
    .stat-items {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    [class*="stat-item"], .stat-card {
        padding: 1.5rem 1rem !important;
    }
    
    [class*="stat-number"], .stat-number, .number {
        font-size: 2rem !important;
    }
}

/* All Cards */
@media (max-width: 768px) {
    [class*="-card"]:not(.stat-card) {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    [class*="-card"] h3, [class*="-card"] h4 {
        font-size: 1.3rem !important;
        margin-bottom: 1rem !important;
    }
    
    [class*="-card"] p {
        font-size: 1rem !important;
    }
}

/* All CTA Buttons and Button Groups */
@media (max-width: 768px) {
    [class*="cta-buttons"], [class*="hero-buttons"],
    [class*="button-group"] {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem !important;
    }
    
    [class*="cta-button"], [class*="hero-button"],
    .btn-primary, .btn-secondary {
        width: 100% !important;
        max-width: 300px !important;
        text-align: center !important;
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
    }
}

/* All Images and Media */
@media (max-width: 768px) {
    img:not(.logo-image):not(.logo-icon):not(.service-icon) {
        max-width: 100% !important;
        height: auto !important;
    }
    
    [class*="image-container"], [class*="img-container"] {
        margin: 1.5rem 0 !important;
    }
}

/* Tables */
@media (max-width: 768px) {
    table {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    table th, table td {
        font-size: 0.9rem !important;
        padding: 0.75rem 0.5rem !important;
    }
}

/* Lists */
@media (max-width: 768px) {
    ul, ol {
        padding-left: 1.5rem !important;
        margin: 1rem 0 !important;
    }
    
    ul li, ol li {
        margin-bottom: 0.75rem !important;
        font-size: 1rem !important;
    }
}

/* Process Steps / Timeline */
@media (max-width: 768px) {
    [class*="process-step"]::after,
    [class*="timeline"]::after {
        display: none !important;
    }
    
    [class*="process-step"], [class*="timeline-item"] {
        margin-bottom: 2rem !important;
    }
}

/* Pricing Cards */
@media (max-width: 768px) {
    [class*="pricing-card"] {
        margin: 1.5rem auto !important;
        max-width: 350px !important;
    }
    
    [class*="price"] {
        font-size: 2.5rem !important;
    }
}

/* Badges and Tags */
@media (max-width: 768px) {
    [class*="badge"], [class*="tag"] {
        font-size: 0.85rem !important;
        padding: 6px 15px !important;
    }
}

/* Modal and Overlay Content */
@media (max-width: 768px) {
    [class*="modal"], [class*="overlay"] {
        padding: 20px !important;
        width: 95% !important;
        max-width: 95% !important;
    }
}


/* Hide Google Translate Banner and Elements */
.goog-te-banner-frame,
.goog-te-balloon-frame,
.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

/* Google Translate dropdown styling */
.goog-te-gadget {
    font-family: inherit !important;
}

.goog-te-gadget-simple {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}
