/* 3FC SRL - Modern Website Styles */

/* CSS Custom Properties */
:root {
    --primary-color: #FF7A00;
    --secondary-color: #1E40AF;
    --accent-color: #F97316;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* Logo 3FC Original Styling */
.logo-3fc-original {
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.logo-3fc-original:hover {
    transform: translateY(-1px);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.logo-3fc-original img {
    transition: all 0.3s ease;
    filter: brightness(1);
}

.logo-3fc-original:hover img {
    filter: brightness(1.1);
}

/* Legacy logo class - kept for compatibility */
.logo-3fc {
    position: relative;
    display: inline-block;
    padding: 8px 16px;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.1) 0%, rgba(255, 122, 0, 0.05) 100%);
    transition: all 0.3s ease;
}

.logo-3fc:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 122, 0, 0.2);
}

/* Navigation Styles */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Header Scroll Effect */
#header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Responsive Header Fixes */
@media (max-width: 640px) {
    .logo-3fc {
        padding: 6px 12px;
        border-width: 1.5px;
    }
    
    .logo-3fc span:first-child {
        font-size: 1.25rem !important;
    }
    
    .logo-3fc span:last-child {
        font-size: 0.625rem !important;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    /* Tablet-specific navbar adjustments */
    header .flex.justify-between {
        flex-wrap: nowrap;
        align-items: center;
    }
}

@media (max-width: 767px) {
    /* Mobile navbar compact mode */
    header .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    /* Ensure buttons don't overflow */
    .btn-primary {
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    header .flex.justify-between {
        gap: 0.5rem;
    }
}

/* Map Container Styles */
.map-container {
    transition: all 0.3s ease;
}

.map-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
    filter: grayscale(0.3);
    transition: filter 0.3s ease;
}

.map-container:hover iframe {
    filter: grayscale(0);
}

/* WhatsApp Floating Button */
.whatsapp-float {
    width: 60px;
    height: 60px;
    animation: pulse-whatsapp 2s infinite;
}

@keyframes pulse-whatsapp {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.whatsapp-float:hover {
    animation-play-state: paused;
}

/* Mobile Menu Styles */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    transform-origin: top;
}

#mobile-menu.hidden {
    display: none !important;
}

#mobile-menu:not(.hidden) {
    display: block !important;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu Button */
#mobile-menu-button {
    transition: all 0.2s ease;
    z-index: 1000;
}

#mobile-menu-button:active {
    transform: scale(0.95);
}

/* ===== MOBILE-FIRST RESPONSIVE OPTIMIZATIONS ===== */

/* Mobile Typography Enhancements */
@media (max-width: 640px) {
    /* Better text readability on mobile */
    body {
        font-size: 16px; /* Prevent iOS zoom on input focus */
        line-height: 1.5;
    }
    
    /* Tighter line height for headings on mobile */
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }
    
    /* Mobile paragraph spacing */
    p {
        margin-bottom: 1rem;
        line-height: 1.6;
    }
    
    /* Mobile header optimizations */
    header {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    /* Logo container mobile enhancements */
    .logo-3fc {
        padding: 6px 14px;
        border-width: 2px;
    }
    
    /* Original logo mobile optimizations */
    .logo-3fc-original img {
        height: 2.5rem !important; /* 40px on mobile */
        max-width: 120px;
        object-fit: contain;
    }
}

/* Touch Target Optimizations */
@media (max-width: 768px) {
    /* Ensure all buttons meet 48px touch target requirement */
    .btn-primary, .btn-secondary, button, a.inline-flex {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Service cards mobile spacing */
    .service-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* WhatsApp float button */
    .whatsapp-float {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-float i {
        font-size: 1.5rem;
    }
    
    /* Mobile menu visibility */
    #mobile-menu-button {
        display: flex !important;
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Hide desktop nav on mobile */
    nav.hidden.md\\:flex {
        display: none !important;
    }
    
    /* Mobile form optimizations */
    input, textarea, select {
        font-size: 16px; /* Prevent iOS zoom */
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    /* Mobile card spacing */
    .bg-white.rounded-2xl, .bg-gray-50.rounded-2xl {
        margin-bottom: 1rem;
        padding: 1.25rem;
    }
}

/* Mobile Layout Improvements */
@media (max-width: 640px) {
    /* Container padding */
    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Grid spacing mobile */
    .grid {
        gap: 1rem;
    }
    
    /* Mobile text center for better UX */
    .text-left {
        text-align: center;
    }
    
    /* Mobile button stack with proper spacing */
    .flex.flex-col.sm\\:flex-row {
        gap: 0.75rem;
    }
}

/* Advanced Mobile UX */
@media (max-width: 480px) {
    /* Extra small screens optimization */
    .text-5xl, .text-4xl {
        font-size: 1.875rem; /* 30px */
        line-height: 1.2;
    }
    
    .text-3xl {
        font-size: 1.5rem; /* 24px */
    }
    
    .text-2xl {
        font-size: 1.25rem; /* 20px */
    }
    
    /* Reduce excessive margin/padding on very small screens */
    .py-12 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .mb-6 {
        margin-bottom: 1rem;
    }
    
    /* Service icons mobile size */
    .service-icon {
        width: 3rem;
        height: 3rem;
    }
    
    /* Trust indicators mobile */
    .bg-white\\/10 {
        padding: 1.25rem;
    }
}

/* Button Styles */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

/* Service Cards */
.service-card {
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.05) 0%, rgba(255, 122, 0, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 1rem;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(255, 122, 0, 0.25);
}

.service-icon {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.15) rotate(5deg);
}

/* Clients Carousel Styles */
.carousel-container {
    position: relative;
    overflow: hidden;
}

#clientsCarousel {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
}

/* Enhanced client logo containers */
.client-logo-container {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

.client-logo-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 122, 0, 0.1), transparent);
    transition: left 0.6s ease;
}

.client-logo-container:hover::before {
    left: 100%;
}

.client-logo-container:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 20px 40px rgba(255, 122, 0, 0.15);
    border-color: rgba(255, 122, 0, 0.3);
}

/* Default logo styling - light logos (grayscale by default) */
.client-logo-container img {
    transition: all 0.4s ease;
    filter: grayscale(100%) brightness(1.1);
}

.client-logo-container:hover img {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.1);
}

/* Dark logos styling - colorful by default, grayscale on hover */
.client-logo-container img[alt*="Pellegrini"],
.client-logo-container img[alt*="Euro & Promos"],
.client-logo-container img[alt*="Euro FJ"] {
    filter: grayscale(0%) brightness(1) contrast(1.1);
}

.client-logo-container:hover img[alt*="Pellegrini"],
.client-logo-container:hover img[alt*="Euro & Promos"], 
.client-logo-container:hover img[alt*="Euro FJ"] {
    filter: grayscale(80%) brightness(1.2) contrast(1);
    transform: scale(1.1);
}

/* Carousel Navigation Buttons */
#prevSlide, #nextSlide {
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

#prevSlide:hover, #nextSlide:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#prevSlide {
    transform: translate(-50%, -50%);
}

#nextSlide {
    transform: translate(50%, -50%);
}

/* Carousel Indicators */
.carousel-indicator {
    transition: all 0.3s ease;
    cursor: pointer;
}

.carousel-indicator:hover {
    transform: scale(1.2);
}

/* Large logo containers - much bigger */
.client-logo-container {
    min-height: 192px; /* h-48 = 192px */
}

/* 3-column layout optimizations */
.client-logo-container {
    min-height: 160px; /* h-40 = 160px */
}

/* Mobile optimizations for carousel */
@media (max-width: 768px) {
    .client-logo-container {
        min-height: 140px; /* Slightly smaller on tablet */
        padding: 1.5rem;
    }
    
    /* Switch to single column on tablet and below */
    .grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    #prevSlide, #nextSlide {
        padding: 0.75rem;
        transform: translate(-50%, -50%) scale(0.9);
    }
    
    .carousel-indicator {
        width: 0.75rem;
        height: 0.75rem;
    }
}

@media (max-width: 640px) {
    .client-logo-container {
        min-height: 120px; /* Compact on mobile */
        padding: 1rem;
    }
    
    /* Hide carousel buttons on mobile, rely on swipe */
    #prevSlide, #nextSlide {
        display: none;
    }
}

/* Special styling for ALPLA logo sizing */
.client-logo-container img[alt*="ALPLA"] {
    max-height: 60px !important;
}

/* Footer logo with pure white background */
.logo-3fc-original .bg-white {
    position: relative;
    overflow: hidden;
    background-color: #ffffff; /* Pure white */
}

.logo-3fc-original .bg-white::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 122, 0, 0.1), transparent);
    transition: left 0.6s ease;
}

.logo-3fc-original .bg-white:hover::before {
    left: 100%;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

/* Counter Animation */
.counter {
    transition: all 0.3s ease;
}

/* Form Styles */
form input:focus,
form textarea:focus,
form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 122, 0, 0.1);
    transform: translateY(-2px);
}

form input,
form textarea,
form select {
    transition: all 0.3s ease;
}

form input:hover,
form textarea:hover,
form select:hover {
    border-color: var(--primary-color);
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #10B981;
    color: white;
}

.notification.error {
    background: #EF4444;
    color: white;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero Background Animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-gradient {
    background: linear-gradient(-45deg, var(--secondary-color), #1E40AF, #2563EB, var(--secondary-color));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform-origin: left;
    transform: scaleX(0);
    z-index: 1000;
    transition: transform 0.3s ease;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .logo-3fc {
        padding: 4px 8px;
    }
    
    .logo-3fc span:first-child {
        font-size: 1.25rem;
    }
    
    .logo-3fc span:last-child {
        font-size: 0.65rem;
    }
    
    /* Mobile navigation improvements */
    header .max-w-7xl {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    header .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .service-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 2rem;
        line-height: 1.3;
    }
}

@media (max-width: 640px) {
    .service-card {
        padding: 1rem;
    }
    
    .service-icon {
        width: 48px;
        height: 48px;
        padding: 12px;
    }
    
    .service-icon i {
        font-size: 1.25rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .max-w-7xl {
        max-width: 90%;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Large Screen Optimizations */
@media (min-width: 1920px) {
    .max-w-7xl {
        max-width: 1600px;
    }
}

/* Dark Mode Support (Future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles would be implemented here */
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .service-card {
        border: 2px solid var(--gray-900);
    }
    
    .btn-primary {
        border: 2px solid var(--gray-900);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-gradient {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.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;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero-gradient {
        background: var(--secondary-color) !important;
    }
    
    .service-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

/* Utility Classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.backdrop-blur-xl {
    backdrop-filter: blur(24px);
}

.transform-gpu {
    transform: translateZ(0);
}

/* Loading Animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Client Logos Styling */
.client-logo-container {
    min-height: 96px;
    position: relative;
    overflow: hidden;
}

.client-logo-container img {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 85%;
    max-height: 60px;
    width: auto;
    height: auto;
}

.client-logo-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.client-logo-container:hover img {
    transform: scale(1.1);
    filter: grayscale(0) !important;
}

/* Enhanced fallback styling for client logos */
.client-logo-container[data-client-name]::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.1), rgba(249, 115, 22, 0.1));
    border-radius: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.client-logo-container:hover[data-client-name]::before {
    opacity: 1;
}

/* Professional placeholder design */
.client-placeholder {
    background: linear-gradient(135deg, #FF7A00, #F97316);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.client-placeholder::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent, rgba(255, 255, 255, 0.1));
    border-radius: 0.5rem;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

/* Mobile optimizations for client logos */
@media (max-width: 768px) {
    .client-logo-container {
        min-height: 80px;
        padding: 1rem !important;
    }
    
    .client-logo-container img {
        max-height: 48px;
        max-width: 90%;
    }
}

@media (max-width: 640px) {
    .client-logo-container {
        min-height: 72px;
        padding: 0.75rem !important;
    }
    
    .client-logo-container img {
        max-height: 40px;
    }
}