/* ====================================================================
   CUSTOM CSS per MIPS - La Bussola Digitale
   Design futuristico, raffinato e moderno con Tailwind CSS
   TEMA PRINCIPALE: Compass Rose - Bussola Navigazione
   ==================================================================== */

/* Importa le variabili e reset */
:root {
    --gradient-primary: linear-gradient(to right, #60a5fa, #06b6d4);
    --gradient-hover: linear-gradient(to right, #3b82f6, #0891b2);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.3);
    --duration-transition: 300ms;
    --compass-rotation: 0deg;
}

/* ====================================================================
   CONFIGURAZIONE GLOBALE
   ==================================================================== */

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

/* Rimuovi i tap highlight su mobile */
body {
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* ====================================================================
   ANIMAZIONI CUSTOM - COMPASS THEME
   ==================================================================== */

/* Animazione di rotazione della bussola */
@keyframes compass-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Animazione compass rose (stella polare tremolante) */
@keyframes compass-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Animazione di pulsazione della bussola */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(6, 182, 212, 0.5);
    }
}

/* Animazione di drift per elementi decorativi */
@keyframes drift {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Animazione di shine per effetto di luce */
@keyframes shine {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Animazione di floating */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animazione compass needle (ago bussola) */
@keyframes compass-needle {
    0% {
        transform: rotate(-45deg);
    }
    50% {
        transform: rotate(45deg);
    }
    100% {
        transform: rotate(-45deg);
    }
}

/* Animazione direzione cardinale */
@keyframes cardinal-point {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ====================================================================
   COMPONENTI - DROPDOWN MENU
   ==================================================================== */

/* Dropdown menu styling */
.group:has(> a) .absolute {
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Dropdown items smooth animation */
.group-hover\:opacity-100 {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Mobile dropdown animation */
#mobile-servizi-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobile-servizi-menu:not(.hidden) {
    max-height: 500px;
    transition: max-height 0.3s ease-in;
}

/* ====================================================================
   COMPONENTI - HEADER CON COMPASS THEME
   ==================================================================== */

/* Header con blur effect */
header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
}

/* Background compass pattern nel header */
header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: compass-pulse 4s ease-in-out infinite;
    pointer-events: none;
}

/* Menu link con underline effect */
nav a {
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #60a5fa, #06b6d4);
    transition: width var(--duration-transition) ease;
}

nav a:hover::after {
    width: 100%;
}

/* ====================================================================
   COMPONENTI - HERO SECTION
   ==================================================================== */

/* Container hero con background gradiente */
#hero {
    min-height: auto;
    background: radial-gradient(ellipse at top, rgba(30, 41, 82, 0.3), transparent);
}

/* Home large logo wrapper */
.home-logo-wrapper {
    width: 140px;
    height: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(96,165,250,0.06), rgba(6,182,212,0.04));
    box-shadow: 0 8px 30px rgba(6,182,212,0.06);
    transition: transform var(--duration-transition), box-shadow var(--duration-transition);
    animation: glow-pulse 4s ease-in-out infinite;
}

.home-logo {
    width: 100%;
    height: auto;
    max-width: 120px;
    display: block;
    filter: drop-shadow(0 8px 18px rgba(59,130,246,0.12));
    transition: transform var(--duration-transition) ease;
}

.home-logo-wrapper:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 18px 50px rgba(6,182,212,0.18);
}

@media (min-width: 640px) {
    .home-logo-wrapper {
        width: 180px;
        height: 180px;
        padding: 16px;
    }

    .home-logo {
        max-width: 150px;
    }
}

@media (min-width: 1024px) {
    .home-logo-wrapper {
        width: 220px;
        height: 220px;
        padding: 20px;
        border-radius: 24px;
    }

    .home-logo {
        max-width: 200px;
    }
}

/* Logo usato come sfondo nella sezione bussola */
.compass-bg-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-10%);
    width: 120%;
    height: auto;
    max-width: none;
    object-fit: contain;
    border-radius: 1.5rem;
    opacity: 0.06;
    filter: grayscale(20%);
    mix-blend-mode: screen;
    pointer-events: none;
    transition: opacity 300ms ease, transform 300ms ease;
    z-index: 0;
}

@media (min-width: 640px) {
    .compass-bg-logo {
        opacity: 0.05;
    }
}

@media (min-width: 1024px) {
    .compass-bg-logo {
        opacity: 0.04;
    }
}

/* Titolo hero con text-shadow effect */
#home h1 {
    filter: drop-shadow(0 10px 20px rgba(59, 130, 246, 0.1));
}

/* Pulsating button effect */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left var(--duration-transition) ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* ====================================================================
   COMPONENTI - CARD SERVIZI
   ==================================================================== */

/* Card con effetto hover sofisticato */
.service-card {
    position: relative;
    overflow: hidden;
    transition: all var(--duration-transition) ease;
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.2), rgba(15, 23, 42, 0.5));
}

/* Effetto glow on hover */
.service-card:hover {
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
    transform: translateY(-5px);
}

/* Icona card con scaling */
.service-card .icon {
    transition: all var(--duration-transition) ease;
    display: inline-block;
}

.service-card:hover .icon {
    transform: scale(1.2) rotate(10deg);
}

/* ====================================================================
   COMPONENTI - STATISTICHE
   ==================================================================== */

/* Progress bar animata */
.progress-bar {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

/* Effetto shine sulla progress bar */
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: shine 3s infinite;
}

/* ====================================================================
   COMPONENTI - PORTFOLIO
   ==================================================================== */

/* Portfolio card con hover effect */
.portfolio-card {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    transition: all var(--duration-transition) ease;
}

/* Overlay animato */
.portfolio-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.9));
    opacity: 0;
    transition: opacity var(--duration-transition) ease;
}

.portfolio-card:hover .overlay {
    opacity: 1;
}

/* ====================================================================
   COMPONENTI - FORM
   ==================================================================== */

/* Input e textarea styling */
input, textarea {
    transition: all var(--duration-transition) ease;
    background: rgba(30, 41, 82, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

input:focus, 
textarea:focus {
    background: rgba(30, 41, 82, 0.7);
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* ====================================================================
   COMPONENTI - FOOTER
   ==================================================================== */

/* Link footer con hover effect */
footer a {
    position: relative;
    transition: color var(--duration-transition) ease;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width var(--duration-transition) ease;
}

footer a:hover::after {
    width: 100%;
}

/* ====================================================================
   EFFETTI SPECIALI
   ==================================================================== */

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(45deg, #60a5fa, #06b6d4, #60a5fa);
    background-size: 200% 200%;
    animation: gradient-shift 6s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ====================================================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH (SEMPLIFICATO)
   ==================================================================== */

/* Mobile (<640px) */
@media (max-width: 639px) {
    h1 {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    h3 {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }

    /* Input e textarea mobile */
    input, textarea {
        font-size: 1rem;
    }
}

/* Tablet (640px - 1024px) */
@media (min-width: 640px) and (max-width: 1023px) {
    h1 {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }

    h2 {
        font-size: 2rem;
        line-height: 2.5rem;
    }

    h3 {
        font-size: 1.5rem;
        line-height: 2rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    h1 {
        font-size: 3.75rem;
        line-height: 4rem;
    }

    h2 {
        font-size: 3rem;
        line-height: 3.5rem;
    }

    h3 {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
}

/* ====================================================================
   RESPONSIVE LANDSCAPE MODE
   ==================================================================== */

@media (orientation: landscape) and (max-height: 600px) {
    #home {
        min-height: auto;
        padding-top: 60px !important;
        padding-bottom: 20px !important;
    }

    h1 {
        font-size: 1.5rem;
        line-height: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
        line-height: 1.5rem;
    }
}

/* ====================================================================
   NOTCH HANDLING IPHONE X+
   ==================================================================== */

@supports (padding: max(0px)) {
    body {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    header nav {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    footer {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

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

/* Focus visible per keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

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

/* ====================================================================
   SCROLL REVEAL EFFECT
   ==================================================================== */

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ====================================================================
   UTILITIES
   ==================================================================== */

/* Blur effect per backdrop */
.backdrop-blur-xl {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #60a5fa, #06b6d4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3b82f6, #0891b2);
}

/* Firefox scrollbar */
* {
    scrollbar-color: #60a5fa rgba(15, 23, 42, 0.5);
    scrollbar-width: thin;
}
