/* Mobile First Responsive Styles - Aesthetic Color System */
:root {
    /* Primary Brand Color - #2d7bf4 */
    --color-primary: #2d7bf4;
    --color-primary-light: #60a5fa;
    --color-primary-lighter: #93c5fd;
    --color-primary-lightest: #dbeafe;
    --color-primary-dark: #2563eb;
    --color-primary-darker: #1d4ed8;
    
    /* Neutral Colors */
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-600: #4b5563;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    
    /* Semantic Colors */
    --color-button: #2d7bf4;
    --color-button-hover: #2563eb;
    --color-link: #2d7bf4;
    --color-link-hover: #1d4ed8;
    --color-heading: #111827;
    --color-text: #4b5563;
    --color-border: #e5e7eb;
    --color-background: #ffffff;
    --color-card: #f9fafb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--color-background);
    color: var(--color-text);
    margin: 0;
    padding: 0;
    display: flex;
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: hidden !important;
    overflow-y: auto;
    touch-action: pan-y;
    position: relative;
}

/* Typography - Aesthetic Hierarchy */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

p {
    color: var(--color-text);
    line-height: 1.6;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-link-hover);
}

/* Buttons - Primary Blue Style */
button,
.btn {
    background-color: var(--color-button);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover,
.btn:hover {
    background-color: var(--color-button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 123, 244, 0.3);
}

html, body, #root {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Touch-friendly interactions */
button, a {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* Improve touch target sizes on mobile */
@media (max-width: 768px) {
    button, a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #303134;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #404144;
}

/* Image fallback - Mobile optimized */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Smooth transitions - Mobile optimized */
a, button {
    transition: all 0.2s ease;
}

/* Desktop hover effects only */
@media (hover: hover) and (pointer: fine) {
    a:hover, button:hover {
        opacity: 0.9;
    }
}

/* Mobile active states */
@media (hover: none) and (pointer: coarse) {
    a:active, button:active {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

/* Prevent text selection on interactive elements */
button, .touch-manipulation {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Smooth scrolling for anchor links */
html {
    scroll-padding-top: 100px; /* Account for sticky nav + padding */
}

/* Ensure sections have proper spacing from sticky nav */
#home, #services, #areas, #contact, #pricing {
    scroll-margin-top: 100px;
}

/* Z-index layering system */
.z-base { z-index: 1; }
.z-content { z-index: 10; }
.z-nav { z-index: 50; }
.z-modal { z-index: 100; }

/* FORCE STICKY HEADER (Banner + Navigation) - Aesthetic Blue Theme - Seamless */
nav {
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: none !important;
    transition: all 0.3s ease;
    width: 100% !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    border-bottom: none !important;
}

/* Fixed header container - Never moves */
.fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
}

/* Sticky fallback */
.sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
}

/* Navigation links with primary blue */
nav a {
    color: var(--color-gray-600) !important;
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--color-primary) !important;
}

/* Navigation buttons with primary blue - Force white text */
nav button,
nav .btn,
nav a[href*="wa.me"],
nav a[href="#contact"] {
    background-color: var(--color-primary) !important;
    color: white !important;
}

nav button:hover,
nav .btn:hover,
nav a[href*="wa.me"]:hover,
nav a[href="#contact"]:hover {
    background-color: var(--color-primary-dark) !important;
    box-shadow: 0 4px 12px rgba(45, 123, 244, 0.25) !important;
    color: white !important;
}

/* Force white text on WhatsApp button */
a[href*="wa.me"] {
    color: white !important;
}

a[href*="wa.me"] svg {
    color: white !important;
    fill: white !important;
}

/* Navigation text styling */
nav a,
nav button,
nav span {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Additional sticky class support */
nav.sticky,
.sticky {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
}

/* Enhanced shadow when scrolled */
nav.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Ensure sticky works on all browsers */
@supports (position: sticky) {
    nav {
        position: sticky;
    }
}

@supports not (position: sticky) {
    nav {
        position: fixed;
        width: 100%;
    }
}

/* Mobile viewport optimization */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
}

/* Floating Action Buttons - Professional UX/UI Design */
.floating-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 999;
}

.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.floating-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.floating-btn:hover::before {
    width: 100%;
    height: 100%;
}

.floating-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 12px 32px rgba(0, 0, 0, 0.15);
}

.floating-btn:active {
    transform: translateY(-2px) scale(1.02);
}

/* WhatsApp Button - Official Brand Color */
.whatsapp-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #20BA5A 0%, #0E7A6E 100%);
}

/* Call Button - Primary Blue */
.call-btn {
    background: linear-gradient(135deg, #2d7bf4 0%, #1d4ed8 100%);
    color: white;
}

.call-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.floating-btn svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
}

/* Pulse animation for attention */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 0 12px rgba(37, 211, 102, 0);
    }
}

.whatsapp-btn {
    animation: pulse 2s infinite;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .floating-buttons {
        bottom: 16px;
        right: 16px;
        gap: 12px;
    }
    
    .floating-btn {
        width: 52px;
        height: 52px;
    }
    
    .floating-btn svg {
        width: 22px;
        height: 22px;
    }
}

/* Tablet optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .floating-buttons {
        bottom: 20px;
        right: 20px;
    }
}

/* Accessibility - Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .floating-btn {
        transition: none;
        animation: none;
    }
    
    .whatsapp-btn {
        animation: none;
    }
}

/* MASTER RESPONSIVE CONTAINER SYSTEM - Prevents all overflow */
.max-w-\[1100px\], 
.max-w-\[800px\],
.max-w-\[560px\],
[class*="max-w-"] {
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

@media (min-width: 640px) {
    .max-w-\[1100px\], 
    .max-w-\[800px\],
    .max-w-\[560px\],
    [class*="max-w-"] {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

@media (min-width: 1024px) {
    .max-w-\[1100px\], 
    .max-w-\[800px\],
    .max-w-\[560px\],
    [class*="max-w-"] {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Prevent grid overflow on mobile */
.grid {
    width: 100% !important;
}

/* Ensure images don't cause overflow */
img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Fix for long text that might overflow */
h1, h2, h3, h4, h5, h6, p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Container width control for all screen sizes */
@media (max-width: 639px) {
    /* Mobile: Full width with padding */
    .w-full {
        width: 100% !important;
    }
}

@media (min-width: 640px) and (max-width: 767px) {
    /* Large mobile / Small tablet */
    .max-w-\[1100px\] {
        max-width: 100% !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    /* Tablet */
    .max-w-\[1100px\] {
        max-width: 95% !important;
    }
}

@media (min-width: 1024px) {
    /* Desktop */
    .max-w-\[1100px\] {
        max-width: 1100px !important;
    }
    
    .max-w-\[800px\] {
        max-width: 800px !important;
    }
    
    .max-w-\[560px\] {
        max-width: 560px !important;
    }
}

/* Fix navigation overflow */
nav {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

nav > div {
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure buttons don't cause overflow */
button, a {
    max-width: 100%;
    word-wrap: break-word;
}

/* Fix for service areas grid */
.grid-cols-2 {
    gap: 0.75rem !important;
}

@media (min-width: 768px) {
    .md\:grid-cols-4 {
        gap: 1rem !important;
    }
}

/* FAQ section responsive */
.faq-item h3 {
    font-size: clamp(1rem, 4vw, 1.25rem) !important;
    padding-right: 2rem !important;
}

/* Floating buttons responsive positioning */
@media (max-width: 480px) {
    .floating-buttons {
        bottom: 12px !important;
        right: 12px !important;
    }
    
    .floating-btn {
        width: 48px !important;
        height: 48px !important;
    }
}
