/* ========== FINAL OPTIMIZATIONS & FIXES ========== */

/* Ensure proper spacing for all sections */
section {
    position: relative;
    overflow: hidden;
}

/* Fix any remaining spacing issues */
.container > section:first-child,
.container > .hero {
    margin-top: 0;
}

/* Improve button hover states */
button, .btn {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Smooth scrolling for anchor links */
html {
    scroll-padding-top: 120px;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

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

/* Form improvements */
.form-input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: transparent;
}

.form-input:valid:not(:focus):not(:placeholder-shown) {
    border-color: #22c55e;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .hero-content,
    .contact-form,
    .testimonial-card,
    .service-card,
    .gallery-item {
        border: 2px solid;
    }
}

/* Print styles */
@media print {
    .header-wrap,
    .social-links,
    .btn-get-started,
    .slider-controls,
    .emergency-contact {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    .hero {
        page-break-inside: avoid;
    }
}

/* Mobile touch improvements */
@media (hover: none) and (pointer: coarse) {
    .social-link:hover,
    .service-card:hover,
    .testimonial-card:hover {
        -webkit-transform: none;
        transform: none;
    }
    
    button, .btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #ef4444;
        --text-medium: #000000;
        --text-light: #000000;
        --bg-primary: #ffffff;
        --bg-secondary: #ffffff;
        --bg-light: #F5F5F5;
        --border-light: rgba(255, 255, 255, 0.1);
    }
    
    .hero-content,
    .contact-form,
    .testimonial-card,
    .service-card {
        background: #F9F8F6;
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-scroll {
    overflow: hidden;
}

.fade-in {
    -webkit-animation: fadeIn 0.6s ease-in-out;
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Performance optimizations */
.hero-content,
.testimonial-card,
.service-card,
.contact-method {
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .hero-content,
    .contact-form {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.95);
    }
}

/* ========== FLOATING ACTION BUTTONS (WhatsApp + Call) ========== */

.floating-actions {
    position: fixed;
    bottom: 28px;
    left: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    z-index: 9000;
}

.float-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.3s ease;
    outline: none;
}

/* Tooltip label */
.float-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    -webkit-transform: translateY(-50%) translateX(-6px);
    transform: translateY(-50%) translateX(-6px);
    background: rgba(30,30,30,0.88);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.float-btn:hover::after {
    opacity: 1;
    -webkit-transform: translateY(-50%) translateX(0);
    transform: translateY(-50%) translateX(0);
}

.float-btn:hover {
    -webkit-transform: scale(1.12) translateY(-2px);
    transform: scale(1.12) translateY(-2px);
}

/* WhatsApp button */
.float-btn-whatsapp {
    background: #25D366;
    box-shadow: 0 6px 22px rgba(37,211,102,0.40);
}

.float-btn-whatsapp:hover {
    box-shadow: 0 10px 30px rgba(37,211,102,0.50);
}

.float-btn-whatsapp svg {
    width: 30px;
    height: 30px;
    fill: #fff;
}

/* Call button */
.float-btn-call {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 6px 22px rgba(255,109,31,0.40);
}

.float-btn-call:hover {
    box-shadow: 0 10px 30px rgba(255,109,31,0.50);
}

.float-btn-call svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

/* Pulse ring animation on WhatsApp */
.float-btn-whatsapp::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(37,211,102,0.45);
    -webkit-animation: floatPulse 2.2s cubic-bezier(0.4,0,0.6,1) infinite;
    animation: floatPulse 2.2s cubic-bezier(0.4,0,0.6,1) infinite;
}

/* Pulse ring animation on Call */
.float-btn-call::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255,109,31,0.40);
    -webkit-animation: floatPulse 2.2s cubic-bezier(0.4,0,0.6,1) infinite;
    animation: floatPulse 2.2s cubic-bezier(0.4,0,0.6,1) infinite;
    animation-delay: 0.4s;
}

@keyframes floatPulse {
    0%   { -webkit-transform: scale(1);    transform: scale(1);    opacity: 0.8; }
    50%  { -webkit-transform: scale(1.22); transform: scale(1.22); opacity: 0.2; }
    100% { -webkit-transform: scale(1);    transform: scale(1);    opacity: 0.8; }
}

@-webkit-keyframes floatPulse {
    0%   { -webkit-transform: scale(1);    transform: scale(1);    opacity: 0.8; }
    50%  { -webkit-transform: scale(1.22); transform: scale(1.22); opacity: 0.2; }
    100% { -webkit-transform: scale(1);    transform: scale(1);    opacity: 0.8; }
}

@media (max-width: 480px) {
    .floating-actions {
        bottom: 20px;
        left: 16px;
        gap: 12px;
    }

    .float-btn {
        width: 50px;
        height: 50px;
    }

    .float-btn-whatsapp svg { width: 26px; height: 26px; }
    .float-btn-call svg     { width: 22px; height: 22px; }

    /* Hide tooltip on very small screens */
    .float-btn::after { display: none; }
}

/* Scroll to top button */
.scroll-top-btn {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(255,109,31,0.35);
    z-index: 9000;
    opacity: 0;
    -webkit-transform: translateY(16px) scale(0.85);
    transform: translateY(16px) scale(0.85);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
}
.scroll-top-btn.visible {
    opacity: 1;
    -webkit-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.scroll-top-btn:hover {
    -webkit-transform: translateY(-3px) scale(1.08);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 10px 28px rgba(255,109,31,0.45);
}
.scroll-top-btn svg { width: 22px; height: 22px; }
@media (max-width: 480px) {
    .scroll-top-btn { bottom: 20px; right: 16px; width: 44px; height: 44px; }
    .scroll-top-btn svg { width: 18px; height: 18px; }
}

/* Mobile nav CTA buttons */
.mobile-nav-ctas {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  margin-top: 8px;
}
.mobile-nav-whatsapp, .mobile-nav-call {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  font-family: 'Noto Sans Devanagari', sans-serif;
}
.mobile-nav-whatsapp {
  background: #25d366;
  color: #fff;
}
.mobile-nav-call {
  background: #1877f2;
  color: #fff;
}
