/* ============================================
   CUSTOM CSS - Sandri Kalaci Imbianchino
   ============================================ */

/* Font Import */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Body */
body {
    overflow-x: hidden;
}

/* ============================================
   NAVIGATION
   ============================================ */

/* Transparent Navigation (at top) */
#navbar {
    background-color: transparent;
    backdrop-filter: blur(0px);
    transition: all 0.3s ease;
}

/* Scrolled Navigation (solid background) */
#navbar.scrolled {
    background-color: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Navigation Links Hover Effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

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

/* CTA Button Pulse Animation */
.cta-button {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 10px 25px -3px rgba(59, 130, 246, 0.6);
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    background-image:
        linear-gradient(to bottom right, rgba(30, 58, 138, 0.9), rgba(17, 24, 39, 0.95)),
        url('https://images.unsplash.com/photo-1589939705384-5185137a7f0f?w=1920&h=1080&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* CTA Buttons Hover Effects */
.cta-button-large {
    position: relative;
    overflow: hidden;
}

.cta-button-large::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.cta-button-large:hover::before {
    width: 400px;
    height: 400px;
}

.cta-button-secondary {
    backdrop-filter: blur(10px);
}

/* ============================================
   SERVICE CARDS
   ============================================ */

.service-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.service-card:hover {
    border-color: #3b82f6;
    transform: translateY(-8px);
}

/* Icon Animation on Hover */
.service-card:hover .fas,
.service-card:hover .fab {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

/* ============================================
   PORTFOLIO GALLERY
   ============================================ */

.portfolio-item img {
    transition: transform 0.5s ease;
}

.portfolio-item:hover img {
    transform: scale(1.1);
}

/* Lightbox Zoom Badge */
.portfolio-item .bg-blue-600 {
    transition: all 0.3s ease;
}

.portfolio-item:hover .bg-blue-600 {
    background-color: #1d4ed8;
    transform: scale(1.1);
}

/* ============================================
   FORM STYLING
   ============================================ */

/* Input Focus Effects */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Checkbox Custom Style */
input[type="checkbox"]:checked {
    background-color: #3b82f6;
}

/* Submit Button Hover */
button[type="submit"] {
    position: relative;
    overflow: hidden;
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

button[type="submit"]:hover::before {
    width: 500px;
    height: 500px;
}

/* ============================================
   FLOATING WHATSAPP BUTTON
   ============================================ */

.fixed.bottom-6.right-6 {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.fixed.bottom-6.right-6:hover {
    animation: none;
    transform: scale(1.15);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Hero Section Mobile */
    .hero-section {
        background-attachment: scroll;
    }

    /* Reduce text sizes on mobile */
    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    /* Stack buttons vertically on mobile */
    .flex-col.sm\:flex-row {
        flex-direction: column;
    }

    /* Full width buttons on mobile */
    .cta-button-large,
    .cta-button-secondary {
        width: 100%;
    }
}

/* ============================================
   SCROLL TO TOP BUTTON (Optional)
   ============================================ */

#scroll-to-top {
    position: fixed;
    top: 100px;
    right: 24px;
    width: 50px;
    height: 50px;
    background-color: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 40;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#scroll-to-top:hover {
    background-color: #2563eb;
    transform: translateY(5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   INFINITE CAROUSEL ANIMATION
   ============================================ */

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
}

/* Animazione da destra a sinistra (Lavoro 1) */
.carousel-left {
    animation: scrollLeft 70s linear infinite;
}

/* Animazione da sinistra a destra (Lavoro 2) */
.carousel-right {
    animation: scrollRight 70s linear infinite;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Pausa animazione al hover */
.carousel-container:hover .carousel-track {
    animation-play-state: paused;
}

/* Sfumature ai bordi */
.carousel-fade-left,
.carousel-fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 10;
    pointer-events: none;
}

.carousel-fade-left {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

.carousel-fade-right {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
}

/* Stile elementi carosello */
.carousel-item {
    flex-shrink: 0;
    width: 320px;
}

.carousel-item img {
    width: 320px;
    height: 256px;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 640px) {
    .carousel-item {
        width: 280px;
    }

    .carousel-item img {
        width: 280px;
        height: 220px;
    }

    .carousel-fade-left,
    .carousel-fade-right {
        width: 40px;
    }
}

/* ============================================
   LOADING ANIMATION (Optional)
   ============================================ */

.loader {
    border: 5px solid #f3f4f6;
    border-top: 5px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

/* Webkit Browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 #f1f5f9;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    /* Hide non-essential elements when printing */
    nav,
    footer,
    .fixed,
    #scroll-to-top {
        display: none !important;
    }

    /* Ensure content fits on page */
    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    /* Prevent page breaks inside elements */
    .service-card,
    .portfolio-item {
        page-break-inside: avoid;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Skip to Content Link (for screen readers) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #3b82f6;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Shadow Glow */
.shadow-glow-blue {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

/* Hover Scale Animation */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse-slow {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   SPECIAL EFFECTS
   ============================================ */

/* Hover Lift Effect */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Shine Effect on Hover */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s;
}

.shine:hover::before {
    left: 100%;
}

/* ============================================
   DARK MODE SUPPORT (Optional - per futuro)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Uncomment if you want automatic dark mode
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }
    */
}

/* ============================================
   LIGHTBOX CUSTOM STYLES
   ============================================ */

/* Lightbox Overlay - sfondo scuro */
.lightbox {
    z-index: 9999 !important;
}

.lb-outerContainer {
    border-radius: 12px !important;
    overflow: hidden;
}

.lb-dataContainer {
    padding: 15px 0 !important;
}

/* Pulsante Chiudi più grande e visibile */
.lb-close {
    width: 40px !important;
    height: 40px !important;
    background-size: 20px 20px !important;
    opacity: 1 !important;
    filter: invert(1) !important;
    transition: transform 0.3s ease !important;
}

.lb-close:hover {
    transform: scale(1.2) !important;
}

/* Frecce di navigazione più grandi */
.lb-prev,
.lb-next {
    width: 60px !important;
    height: 100% !important;
    opacity: 1 !important;
    filter: invert(1) !important;
}

.lb-prev {
    left: 0 !important;
    background-position: left 20px center !important;
}

.lb-next {
    right: 0 !important;
    background-position: right 20px center !important;
}

.lb-prev:hover,
.lb-next:hover {
    opacity: 0.8 !important;
}

/* Numero immagine */
.lb-number {
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

/* Titolo immagine */
.lb-caption {
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #fff !important;
}

/* ============================================
   END OF STYLES
   ============================================ */