/* Mobile Optimization CSS - Final Polish */

/* ========== VIEWPORT AND BASE MOBILE SETUP ========== */
@viewport {
    width: device-width;
    initial-scale: 1;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* ========== MOBILE NAVIGATION ENHANCEMENTS ========== */
@media (max-width: 768px) {
    /* Enhanced Mobile Navigation */
    .nav-glass {
        height: 70px !important;
        padding: 0 1rem !important;
    }
    
    .nav-glass .container {
        padding: 0 !important;
    }
    
    .nav-glass .logo-wrapper img {
        height: 36px !important;
    }
    
    .nav-glass .logo-wrapper span {
        font-size: 1.1rem !important;
    }
    
    /* Mobile Menu Button Styling */
    .mobile-menu-button {
        padding: 0.5rem !important;
        background: none !important;
        border: none !important;
        color: white !important;
        font-size: 1.25rem !important;
        cursor: pointer !important;
    }
    
    /* Mobile Navigation Links */
    .mobile-menu {
        background: rgba(26, 26, 26, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .nav-link-mobile {
        padding: 1rem 1.5rem !important;
        font-size: 1.1rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    }
}

/* ========== HERO SECTION MOBILE OPTIMIZATION ========== */
@media (max-width: 768px) {
    .hero-section {
        padding: 6rem 1rem 4rem !important;
        min-height: 90vh !important;
    }
    
    .hero-content {
        text-align: center !important;
    }
    
    .hero-title,
    h1.text-6xl,
    h1.text-5xl {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-subtitle,
    .text-xl {
        font-size: 1.1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 2rem !important;
    }
    
    /* Hero Buttons */
    .hero-buttons,
    .cta-group {
        flex-direction: column !important;
        gap: 1rem !important;
        align-items: center !important;
    }
    
    .btn-glass {
        width: 100% !important;
        max-width: 280px !important;
        padding: 1rem 2rem !important;
        font-size: 1rem !important;
        text-align: center !important;
    }
}

/* ========== GRID LAYOUTS MOBILE OPTIMIZATION ========== */
@media (max-width: 768px) {
    /* Services Grid */
    .services-grid,
    .glass-grid,
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 1rem !important;
    }
    
    /* Team Grid */
    .team-grid,
    .grid.md\\:grid-cols-2,
    .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Case Studies Grid */
    .case-studies-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

/* ========== CARD COMPONENTS MOBILE OPTIMIZATION ========== */
@media (max-width: 768px) {
    .premium-card,
    .glass,
    .service-card,
    .testimonial-card,
    .case-study-card {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem !important;
        border-radius: 1rem !important;
    }
    
    /* Reduce glass effects intensity on mobile for better performance */
    .premium-card,
    .glass {
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
    }
    
    /* Card hover effects - reduced on mobile */
    .premium-card:hover,
    .glass:hover,
    .service-card:hover {
        transform: translateY(-2px) !important;
    }
}

/* ========== TESTIMONIALS MOBILE OPTIMIZATION ========== */
@media (max-width: 768px) {
    .testimonial-filters {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        margin-bottom: 2rem !important;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
        min-width: auto !important;
    }
    
    .testimonials-container {
        grid-template-columns: 1fr !important;
    }
    
    /* Mobile Swipe for Testimonials */
    .testimonial-slider {
        display: flex !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 1rem !important;
        padding: 1rem 0 !important;
    }
    
    .testimonial-slider::-webkit-scrollbar {
        display: none !important;
    }
    
    .testimonial-card {
        flex: 0 0 90% !important;
        scroll-snap-align: center !important;
        margin-right: 1rem !important;
    }
}

/* ========== FORM MOBILE OPTIMIZATION ========== */
@media (max-width: 768px) {
    .contact-form,
    form {
        padding: 1.5rem !important;
    }
    
    .form-group {
        margin-bottom: 1.5rem !important;
    }
    
    input,
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 1rem !important;
        border-radius: 0.5rem !important;
    }
    
    textarea {
        min-height: 120px !important;
    }
    
    .submit-button {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1.1rem !important;
    }
}

/* ========== FOOTER MOBILE OPTIMIZATION ========== */
@media (max-width: 768px) {
    footer {
        padding: 2rem 1rem !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }
    
    .footer-section {
        margin-bottom: 2rem !important;
    }
    
    .social-links {
        justify-content: center !important;
    }
    
    .footer-bottom {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center !important;
    }
}

/* ========== TYPOGRAPHY MOBILE OPTIMIZATION ========== */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 2rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    h4 {
        font-size: 1.25rem !important;
    }
    
    p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }
    
    .text-6xl { font-size: 2.5rem !important; }
    .text-5xl { font-size: 2.25rem !important; }
    .text-4xl { font-size: 2rem !important; }
    .text-3xl { font-size: 1.75rem !important; }
    .text-2xl { font-size: 1.5rem !important; }
    .text-xl { font-size: 1.125rem !important; }
}

/* ========== SPACING AND LAYOUT MOBILE ========== */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .py-12,
    .py-16,
    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .px-4,
    .px-6,
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .gap-8,
    .gap-12 {
        gap: 1.5rem !important;
    }
    
    .space-y-8 > * + * {
        margin-top: 1.5rem !important;
    }
}

/* ========== BUTTONS AND INTERACTIVE ELEMENTS ========== */
@media (max-width: 768px) {
    /* Touch-friendly button sizing */
    .btn,
    .btn-glass,
    button,
    a[class*="btn"] {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
        border-radius: 0.5rem !important;
    }
    
    /* Book Call Button Mobile */
    .book-call-btn {
        bottom: 1rem !important;
        right: 1rem !important;
        padding: 0.75rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Floating Action Buttons */
    .floating-action-btn {
        width: 56px !important;
        height: 56px !important;
        bottom: 1rem !important;
        right: 1rem !important;
    }
}

/* ========== IMAGES AND MEDIA MOBILE ========== */
@media (max-width: 768px) {
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .hero-bg,
    .background-image {
        object-fit: cover !important;
        object-position: center !important;
    }
    
    /* Team member images */
    .founder-image img,
    .team-member img {
        width: 120px !important;
        height: 120px !important;
    }
    
    /* Case study images */
    .case-study-image {
        height: 200px !important;
        object-fit: cover !important;
    }
}

/* ========== PERFORMANCE OPTIMIZATIONS MOBILE ========== */
@media (max-width: 768px) {
    /* Reduce animation complexity on mobile */
    .orb {
        opacity: 0.2 !important;
        filter: blur(10px) !important;
    }
    
    /* Disable floating cards on mobile */
    .floating-card {
        display: none !important;
    }
    
    /* Simplify glass effects */
    .glass::before,
    .premium-card::before,
    .service-card::before {
        display: none !important;
    }
    
    /* Reduce shadow complexity */
    .glass,
    .premium-card,
    .service-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
}

/* ========== TOUCH INTERACTIONS ========== */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .premium-card:hover,
    .glass:hover,
    .service-card:hover {
        transform: none !important;
    }
    
    /* Remove hover-only effects on touch devices */
    .hover-lift:hover {
        transform: none !important;
    }
    
    /* Touch-friendly spacing */
    a, button {
        padding: 1rem !important;
    }
}

/* ========== LANDSCAPE MOBILE OPTIMIZATION ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 70vh !important;
        padding: 4rem 1rem 2rem !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
}

/* ========== SMALL MOBILE DEVICES ========== */
@media (max-width: 480px) {
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
    
    .premium-card,
    .glass,
    .service-card {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .btn-glass {
        font-size: 0.9rem !important;
        padding: 0.75rem 1.25rem !important;
    }
    
    /* Compact footer on small screens */
    footer {
        padding: 1.5rem 0.75rem !important;
    }
    
    .footer-content {
        gap: 1.5rem !important;
    }
}

/* ========== ACCESSIBILITY ENHANCEMENTS ========== */
@media (max-width: 768px) {
    /* Ensure text is readable */
    .text-sm {
        font-size: 0.95rem !important;
    }
    
    .text-xs {
        font-size: 0.85rem !important;
    }
    
    /* Focus states for mobile */
    button:focus,
    a:focus,
    input:focus,
    textarea:focus {
        outline: 2px solid #FFD700 !important;
        outline-offset: 2px !important;
    }
    
    /* Skip link for accessibility */
    .skip-link {
        position: absolute;
        top: -40px;
        left: 6px;
        background: #FFD700;
        color: #1A1A1A;
        padding: 8px;
        border-radius: 4px;
        text-decoration: none;
        z-index: 1000;
    }
    
    .skip-link:focus {
        top: 6px;
    }
}

/* ========== CASE STUDIES MOBILE ========== */
@media (max-width: 768px) {
    .case-study-header {
        padding: 2rem 1rem !important;
        text-align: center !important;
    }
    
    .case-study-content {
        padding: 1.5rem !important;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem !important;
    }
    
    .metric-card {
        padding: 1rem !important;
        text-align: center !important;
    }
    
    .metric-number {
        font-size: 1.5rem !important;
    }
}

/* ========== TESTIMONIALS MOBILE ENHANCEMENT ========== */
@media (max-width: 768px) {
    .testimonial-filters {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0 1rem !important;
    }
    
    .filter-btn {
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    .testimonials-container {
        padding: 1rem !important;
    }
    
    .testimonial-card {
        margin-bottom: 1.5rem !important;
    }
    
    .testimonial-rating {
        justify-content: center !important;
    }
}

/* ========== CONTACT FORM MOBILE ========== */
@media (max-width: 768px) {
    .contact-section {
        padding: 3rem 1rem !important;
    }
    
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .contact-info {
        text-align: center !important;
        margin-bottom: 2rem !important;
    }
    
    .contact-item {
        justify-content: center !important;
        text-align: center !important;
    }
}

/* ========== LOADING AND PERFORMANCE ========== */
@media (max-width: 768px) {
    /* Optimize animations for mobile performance */
    * {
        animation-duration: 0.3s !important;
    }
    
    /* Reduce complex gradients on mobile */
    .glass,
    .premium-card {
        background: rgba(255, 255, 255, 0.05) !important;
    }
    
    /* Simplify shadows */
    .glass,
    .premium-card,
    .service-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }
}

/* ========== SCROLL BEHAVIOR MOBILE ========== */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth !important;
    }
    
    /* Smooth scrolling for mobile */
    body {
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Optimize scroll performance */
    .reveal,
    .fade-up,
    .slide-in-left,
    .slide-in-right {
        will-change: transform, opacity !important;
    }
}

/* ========== SAFE AREA HANDLING (iOS) ========== */
@media (max-width: 768px) {
    .nav-glass {
        padding-top: env(safe-area-inset-top) !important;
        height: calc(70px + env(safe-area-inset-top)) !important;
    }
    
    .hero-section {
        padding-top: calc(6rem + env(safe-area-inset-top)) !important;
    }
    
    footer {
        padding-bottom: env(safe-area-inset-bottom) !important;
    }
    
    .book-call-btn {
        bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
        right: calc(1rem + env(safe-area-inset-right)) !important;
    }
}

/* ========== UTILITIES FOR MOBILE ========== */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .mobile-text-center {
        text-align: center !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-no-margin {
        margin: 0 !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
    }
}

/* ========== FINAL MOBILE POLISH ========== */
@media (max-width: 768px) {
    /* Ensure no horizontal overflow */
    body, html {
        overflow-x: hidden !important;
    }
    
    /* Prevent zoom on inputs */
    input, textarea, select {
        font-size: 16px !important;
    }
    
    /* Optimize tap targets */
    a, button {
        min-height: 44px !important;
        min-width: 44px !important;
    }
    
    /* Improve readability */
    .text-gray-400,
    .text-gray-300 {
        color: rgba(255, 255, 255, 0.8) !important;
    }
}
