/* ============================================
   BRENTHIS MOBILE-FIRST ENHANCEMENTS
   Ultra-responsive design met touch gestures
   ============================================ */

/* ============================================
   MOBILE BASE SETTINGS
   ============================================ */

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Optimize touch targets */
a, button, input, select, textarea {
    -webkit-tap-highlight-color: rgba(239, 177, 113, 0.3);
    touch-action: manipulation;
}

button, a {
    min-height: 44px;
    min-width: 44px;
}

/* ============================================
   MOBILE NAVIGATION ENHANCEMENTS
   ============================================ */

@media (max-width: 1023px) {
    /* Enhanced mobile menu */
    #mobile-menu {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        background: rgba(255, 255, 255, 0.95);
    }
    
    #mobile-menu a {
        padding: 1rem;
        border-bottom: 1px solid rgba(239, 177, 113, 0.1);
        transition: all 0.3s ease;
    }
    
    #mobile-menu a:hover,
    #mobile-menu a:active {
        background: rgba(239, 177, 113, 0.1);
        padding-left: 2rem;
        border-left: 4px solid var(--accent-amber);
    }
    
    /* Sticky navbar adjustments */
    .main-navbar {
        padding: 0.75rem 0;
    }
    
    .main-navbar img {
        height: 3rem;
    }
}

/* ============================================
   MOBILE HERO SECTION
   ============================================ */

@media (max-width: 768px) {
    .hero-section {
        min-height: 500px;
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-section p {
        font-size: 1.25rem !important;
    }
    
    /* Hide counter on mobile */
    .hero-section .glass-card {
        display: none;
    }
}

/* ============================================
   MOBILE CARDS & GRID OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    /* Service cards stack nicely */
    .flip-card {
        height: auto;
        min-height: 300px;
    }
    
    /* Disable flip on mobile, show both sides stacked */
    .flip-card-inner {
        transform: none !important;
    }
    
    .flip-card-front,
    .flip-card-back {
        position: relative;
        transform: none !important;
    }
    
    .flip-card-back {
        margin-top: 1rem;
        border-radius: var(--radius-lg);
    }
    
    /* Glass cards spacing */
    .glass-card {
        margin-bottom: 1rem;
    }
    
    /* Grid adjustments */
    .grid {
        gap: 1rem !important;
    }
}

/* ============================================
   MOBILE TYPOGRAPHY
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Adjust gradient text sizing */
    .gradient-text {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
    }
    
    /* Counter sizing */
    .counter {
        font-size: 2.5rem;
    }
}

/* ============================================
   MOBILE BUTTONS & CTA
   ============================================ */

@media (max-width: 640px) {
    .btn-modern {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
    
    /* CTA section buttons stack */
    #cta .flex {
        flex-direction: column;
    }
    
    #cta a {
        width: 100%;
    }
}

/* ============================================
   MOBILE FAB (Floating Action Button)
   ============================================ */

@media (max-width: 768px) {
    .fab {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
    }
    
    .fab svg {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   TOUCH SWIPE INDICATORS
   ============================================ */

.swipe-indicator {
    display: none;
}

@media (max-width: 768px) {
    .swipe-container {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .swipe-container::-webkit-scrollbar {
        display: none;
    }
    
    .swipe-indicator {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .swipe-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(239, 177, 113, 0.3);
        transition: all 0.3s ease;
    }
    
    .swipe-dot.active {
        background: var(--accent-amber);
        width: 24px;
        border-radius: 4px;
    }
}

/* ============================================
   MOBILE FORMS
   ============================================ */

@media (max-width: 768px) {
    form input,
    form textarea,
    form select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 1rem;
    }
    
    form .grid {
        grid-template-columns: 1fr;
    }
    
    /* Success message mobile */
    .success-message {
        width: 90% !important;
        left: 5% !important;
        transform: translateY(-50%) !important;
    }
}

/* ============================================
   MOBILE FOOTER
   ============================================ */

@media (max-width: 768px) {
    footer .grid {
        gap: 2rem;
    }
    
    footer h3 {
        font-size: 1.25rem;
    }
    
    footer p,
    footer a {
        font-size: 0.875rem;
    }
}

/* ============================================
   MOBILE TESTIMONIALS/REVIEWS
   ============================================ */

@media (max-width: 768px) {
    #testimonials .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .testimonial-card {
        max-width: 100%;
    }
}

/* ============================================
   HORIZONTAL SCROLL SECTIONS (Mobile Carousels)
   ============================================ */

@media (max-width: 768px) {
    .mobile-scroll {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .mobile-scroll::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-scroll > * {
        flex: 0 0 85%;
        scroll-snap-align: center;
    }
}

/* ============================================
   MOBILE SPACING UTILITIES
   ============================================ */

@media (max-width: 768px) {
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ============================================
   LANDSCAPE MOBILE (small height)
   ============================================ */

@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: 400px;
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .fab {
        bottom: 1rem;
        right: 1rem;
        width: 48px;
        height: 48px;
    }
}

/* ============================================
   TABLET OPTIMIZATION (768px - 1024px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 720px;
    }
    
    /* 2 column grid for tablets */
    .grid-cols-1.md\:grid-cols-2,
    .grid-cols-1.md\:grid-cols-3,
    .grid-cols-1.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Flip cards work well on tablet */
    .flip-card {
        height: 350px;
    }
}

/* ============================================
   SMALL MOBILE (320px - 480px)
   ============================================ */

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section p {
        font-size: 1.1rem !important;
    }
    
    .btn-modern {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    /* Very small cards */
    .glass-card {
        padding: 1.5rem;
    }
    
    /* Smaller icons */
    svg {
        max-width: 32px;
        max-height: 32px;
    }
}

/* ============================================
   EXTRA LARGE MOBILE (iPhone Pro Max, etc)
   ============================================ */

@media (min-width: 481px) and (max-width: 767px) {
    .container {
        max-width: 540px;
    }
    
    /* Better use of space */
    .glass-card {
        padding: 2rem;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS FOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Reduce animations for better performance */
    .float-animation,
    .float-slow {
        animation-duration: 10s;
    }
    
    /* Simpler shadows */
    .glass-card:hover {
        box-shadow: var(--shadow-md);
    }
    
    /* Disable parallax on mobile for performance */
    .parallax-bg {
        position: absolute;
        transform: none !important;
        top: 0;
        height: 100%;
    }
    
    /* Simplify card tilt effect */
    .hover-lift {
        transform: none;
    }
    
    .hover-lift:active {
        transform: scale(0.98);
    }
}

/* ============================================
   SAFE AREAS (iPhone notch, etc)
   ============================================ */

@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .fab {
        bottom: max(1.5rem, env(safe-area-inset-bottom));
        right: max(1.5rem, env(safe-area-inset-right));
    }
    
    .main-navbar {
        padding-top: env(safe-area-inset-top);
    }
}

/* ============================================
   MOBILE ACCESSIBILITY ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Larger focus indicators */
    :focus-visible {
        outline-width: 4px;
    }
    
    /* Better contrast for mobile */
    .text-gray-600 {
        color: #4a5568;
    }
    
    /* Increase line height for readability */
    p {
        line-height: 1.7;
    }
}

/* ============================================
   MOBILE PULL-TO-REFRESH PREVENTION
   ============================================ */

body {
    overscroll-behavior-y: contain;
}

/* ============================================
   PRINT STYLES (Bonus)
   ============================================ */

@media print {
    .fab,
    .scroll-progress,
    nav,
    footer,
    #cta {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
    
    * {
        box-shadow: none !important;
    }
}
