/* Custom CSS for Sri Sai Mobile Repairs V2 */
/* Corporate Professional Design */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --primary-dark: #102a43;
    --primary-medium: #334e68;
    --primary-light: #d9e2ec;
    --accent: #f59e0b;
    --success: #10b981;
    --text: #1e293b;
    --muted: #64748b;
}

/* ========================================
   Global Overrides
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* Override Bootstrap carousel indicators */
.carousel-control-prev,
.carousel-control-next {
    width: auto;
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    display: none;
}

/* ========================================
   Floating Buttons Animation
   ======================================== */
.floating-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 42, 67, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(16, 42, 67, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 42, 67, 0);
    }
}

.floating-btn:nth-child(2) {
    animation: pulse-green 2s infinite;
    animation-delay: 0.5s;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* ========================================
   Form Focus Styles
   ======================================== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

/* ========================================
   Navbar Shadow on Scroll
   ======================================== */
#navbar.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Service Card Hover Effects
   ======================================== */
.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(16, 42, 67, 0.1);
}

/* ========================================
   Brand Logo Fallback
   ======================================== */
.brand-fallback {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ========================================
   Mobile Responsive Overrides
   ======================================== */
@media (max-width: 640px) {
    /* Hero section adjustments */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }

    /* Service cards on mobile */
    .service-card {
        padding: 1rem;
    }

    /* Floating buttons - smaller on mobile */
    .floating-btn {
        width: 3rem !important;
        height: 3rem !important;
    }

    .floating-btn i {
        font-size: 1rem !important;
    }

    /* Trust signals wrap better */
    .trust-badge {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    /* Carousel controls positioning */
    .carousel-control-prev,
    .carousel-control-next {
        display: none;
    }

    /* Stack contact cards */
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   AOS Animation Overrides
   ======================================== */
[data-aos] {
    pointer-events: auto !important;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--primary-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========================================
   Form Status Messages
   ======================================== */
#form-status.success {
    background-color: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #10b981;
}

#form-status.error {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #ef4444;
}

/* ========================================
   Link Underline Hover Effect
   ======================================== */
.nav-link-hover {
    position: relative;
}

.nav-link-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-link-hover:hover::after {
    width: 100%;
}

/* ========================================
   Button Loading State
   ======================================== */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Selection Color
   ======================================== */
::selection {
    background-color: var(--accent);
    color: white;
}

/* ========================================
   Image Lazy Load Placeholder
   ======================================== */
img[data-brand-img] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

img[data-brand-img].loaded {
    animation: none;
    background: transparent;
}

/* ========================================
   Extra Small Devices (< 480px)
   ======================================== */
@media (max-width: 480px) {
    /* Hero text smaller for very small screens */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }

    /* Section spacing tighter */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Trust badges smaller */
    .trust-badge span,
    [class*="flex"][class*="items-center"][class*="gap-2"] span.text-sm {
        font-size: 0.7rem;
    }

    /* Hero trust badges tighter padding */
    [class*="bg-white"][class*="px-4"][class*="py-2"][class*="rounded-full"] {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-top: 0.375rem;
        padding-bottom: 0.375rem;
    }

    /* Contact info cards */
    .contact-card,
    [class*="bg-white"][class*="p-4"][class*="rounded-xl"] {
        padding: 0.75rem;
    }

    /* Form input zoom prevention on iOS */
    form input,
    form select,
    form textarea {
        font-size: 16px !important;
    }

    /* How It Works steps - smaller icons */
    [class*="w-20"][class*="h-20"] {
        width: 4rem !important;
        height: 4rem !important;
    }

    [class*="w-20"][class*="h-20"] i {
        font-size: 1.5rem !important;
    }

    /* Trust signals bar - smaller numbers */
    [class*="text-4xl"][class*="font-extrabold"][class*="text-accent"] {
        font-size: 2rem !important;
    }

    /* Footer text smaller */
    footer p,
    footer li,
    footer a {
        font-size: 0.875rem;
    }

    footer h4,
    footer h5 {
        font-size: 1rem;
    }
}

/* ========================================
   Very Small Devices (< 360px)
   ======================================== */
@media (max-width: 360px) {
    /* Hide email in top bar for very small screens */
    .top-bar-email,
    [href*="mailto:"] span {
        display: none;
    }

    /* Even smaller hero text */
    h1 {
        font-size: 1.5rem !important;
    }

    /* Tighter container padding */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Service cards stacked tighter */
    [class*="grid"][class*="gap-6"] {
        gap: 1rem;
    }

    /* Floating buttons slightly smaller position */
    [class*="fixed"][class*="right-4"][class*="bottom-4"] {
        right: 0.5rem;
        bottom: 0.5rem;
    }
}

/* ========================================
   Small Devices (480px - 640px)
   ======================================== */
@media (min-width: 480px) and (max-width: 640px) {
    /* Hero section optimizations */
    h1 {
        font-size: 2rem !important;
    }

    /* Service cards single column with better spacing */
    section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }
}

/* ========================================
   Medium Devices / Tablets (640px - 768px)
   ======================================== */
@media (min-width: 640px) and (max-width: 768px) {
    /* Section padding adjustments */
    section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    /* Grid adjustments for tablets */
    [class*="lg:grid-cols-4"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ========================================
   Top Bar Responsive Fixes
   ======================================== */
@media (max-width: 640px) {
    /* Top bar contact info - center aligned and stacked */
    .top-bar-contact {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }

    /* Ensure top bar doesn't break layout */
    [class*="bg-primary-dark"][class*="py-2"] .container > div {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ========================================
   Form Responsive Improvements
   ======================================== */
@media (max-width: 640px) {
    /* Form container less padding on mobile */
    [class*="bg-white"][class*="rounded-2xl"][class*="shadow-lg"] {
        padding: 1rem;
    }

    /* Form grid single column on small screens */
    form [class*="grid"][class*="md:grid-cols-2"] {
        grid-template-columns: 1fr;
    }

    /* Form buttons stack on very small screens */
    form [class*="flex"][class*="sm:flex-row"] {
        flex-direction: column;
    }

    form [class*="flex"][class*="sm:flex-row"] button {
        width: 100%;
    }
}

/* ========================================
   Service Areas Pills Responsive
   ======================================== */
@media (max-width: 480px) {
    /* Service area pills smaller on mobile */
    [class*="bg-white/10"][class*="px-4"][class*="py-2"][class*="rounded-full"],
    [class*="bg-accent"][class*="px-4"][class*="py-2"][class*="rounded-full"] {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-top: 0.375rem;
        padding-bottom: 0.375rem;
        font-size: 0.75rem;
    }
}

/* ========================================
   Why Choose Us Grid Responsive
   ======================================== */
@media (max-width: 480px) {
    /* Why Us feature grid - stack on very small screens */
    [class*="grid"][class*="grid-cols-2"][class*="gap-6"] {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Feature card padding reduced */
    [class*="text-center"][class*="p-4"][class*="bg-primary-light/50"] {
        padding: 0.75rem;
    }

    [class*="text-center"][class*="p-4"][class*="bg-primary-light/50"] i {
        font-size: 2rem !important;
    }
}
