/**
 * CUSTOM.CSS - A126 CORPORATE ADVISORS
 * Override Tailwind e stili personalizzati Apple-style
 */

/* =============================================
   ROOT VARIABLES (CSS Custom Properties)
   ============================================= */
:root {
    /* A126 Colors */
    --color-yellow-a126: #FABA0D;
    --color-yellow-light-a126: #EDCD70;
    --color-white-dark-a126: #F2F2F2;
    --color-green-a126: #285F5E;
    --color-gray-dark-a126: #1D1D1B;
    --color-gray-light-a126: #3A3A36;
    --color-white: #FFFFFF;

    /* Spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;
    --space-3xl: 96px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    /* Shadows Apple-style */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 36px rgba(0, 0, 0, 0.16);

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition-fast: 150ms ease-out;
    --transition-normal: 200ms ease-out;
    --transition-slow: 300ms ease-out;
}

/* =============================================
     BASE STYLES
     ============================================= */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* Focus styles accessibili */
*:focus {
    outline: 2px solid var(--color-yellow-a126);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* =============================================
     TYPOGRAPHY IMPROVEMENTS
     ============================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

p {
    line-height: 1.7;
}

/* =============================================
     BUTTON STYLES
     ============================================= */
.btn-primary {
    background-color: var(--color-yellow-a126);
    color: var(--color-gray-dark-a126);
    font-weight: 600;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    transform: translateY(0);
}

.btn-primary:hover {
    background-color: var(--color-green-a126);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-green-a126);
    border: 2px solid var(--color-green-a126);
    font-weight: 600;
    padding: 14px 30px;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.btn-secondary:hover {
    background-color: var(--color-green-a126);
    color: var(--color-white);
}

.btn-text {
    color: var(--color-green-a126);
    text-decoration: underline;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.btn-text:hover {
    color: var(--color-yellow-a126);
}

/* =============================================
     CARD STYLES
     ============================================= */
.card {
    background: var(--color-white);
    border: 1px solid var(--color-white-dark-a126);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--color-yellow-a126);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
}

/* =============================================
     NAVIGATION IMPROVEMENTS
     ============================================= */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile menu animations */
.mobile-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease-out;
}

.mobile-dropdown:not(.hidden) {
    max-height: 500px;
}

/* =============================================
     HERO SECTION STYLES
     ============================================= */
.hero-gradient {
    background: linear-gradient(135deg,
            var(--color-white-dark-a126) 0%,
            var(--color-white) 100%);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

/* =============================================
     FORM STYLES
     ============================================= */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--color-yellow-a126);
    box-shadow: 0 0 0 3px rgba(250, 186, 13, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* =============================================
     NEWSLETTER SECTION
     ============================================= */
.newsletter-form {
    display: flex;
    gap: var(--space-sm);
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
}

@media (max-width: 640px) {
    .newsletter-form {
        flex-direction: column;
    }
}

/* =============================================
     FOOTER STYLES
     ============================================= */
footer {
    background-color: #f9fafb;
}

footer a {
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--color-yellow-a126);
}

/* =============================================
     LOADING STATES
     ============================================= */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 2s infinite;
}

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

    100% {
        background-position: -200% 0;
    }
}

/* =============================================
     TOAST NOTIFICATIONS
     ============================================= */
.toast {
    position: fixed;
    top: var(--space-sm);
    right: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =============================================
     SCROLL ANIMATIONS
     ============================================= */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
     ACCESSIBILITY IMPROVEMENTS
     ============================================= */
.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;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* =============================================
     PRINT STYLES
     ============================================= */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    h1 {
        font-size: 18pt;
    }

    h2 {
        font-size: 16pt;
    }

    h3 {
        font-size: 14pt;
    }

    a::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* =============================================
     UTILITY CLASSES
     ============================================= */
.text-gradient {
    background: linear-gradient(135deg, var(--color-green-a126), var(--color-yellow-a126));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
}

/* =============================================
     DARK MODE SUPPORT (per il futuro)
     ============================================= */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles se necessario */
    /* Per ora mantenere light mode */ }

/* Carosello Casos */
.carousel-slide {
    flex-shrink: 0;
}

.aspect-ratio-16-9 {
    aspect-ratio: 16/9;
}

@supports not (aspect-ratio: 16/9) {
    .aspect-ratio-16-9 {
        position: relative;
        padding-bottom: 56.25%;
        /* 16:9 */
        height: 0;
    }

    .aspect-ratio-16-9 img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* CSS per il carosello e flip cards */
/* Scrollbar nascosta ma scroll funzionante */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Smooth scrolling */
#carousel-scroll {
    scroll-behavior: smooth;
    cursor: grab;
}

#carousel-scroll:active {
    cursor: grabbing;
}

/* Flip Card Styles */
.flip-card-container {
    perspective: 1000px;
}

.flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    transition-delay: 0s;
}

.flip-card-container:hover .flip-card {
    transform: rotateY(180deg);
    transition-delay: 1s;
    /* Ritardo di mezzo secondo prima del flip */
}

.flip-card-container:not(:hover) .flip-card {
    transition-delay: 0s;
    /* Rimuove il delay quando esci dall'hover per tornare subito */
}

.flip-card-front,
.flip-card-back {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .flip-card-container {
        width: 20rem !important;
        height: 38rem !important;
    }
}

/* stile per casi-studio.php */
/* Ken Burns Effect */
@keyframes ken-burns {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

.animate-ken-burns {
    animation: ken-burns 20s ease-out infinite alternate;
}

/* Theatrical card hover effects */
.theatrical-card {
    transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

.theatrical-card:hover {
    transform: scale(1.02);
}

/* Glassmorphism improvements */
.backdrop-blur-sm {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Vignette effect */
.shadow-vignette {
    box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.5);
}

/* Before/After Slider - Smooth transitions */
.before-container {
    transition: clip-path 0.1s ease-out;
}

.slider-handle {
    transition: left 0.1s ease-out;
}

.slider-handle:active {
    cursor: grabbing !important;
}

/* Prevent text selection during drag */
.comparison-slider {
    user-select: none;
    -webkit-user-select: none;
}

/* Before/After Slider smooth transitions */
.comparison-slider .before-image,
.comparison-slider .slider-handle {
    transition: none;
}

/* Gallery smooth animations */
.gallery-item {
    opacity: 1;
    transform: scale(1);
}

/* Hover scale fix */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

/* Video autoplay fix for mobile */
video {
    pointer-events: none;
}

/* Before/After Slider - Area di interazione ampliata */
.slider-handle-wrapper {
    transition: left 0.1s ease-out;
}

.slider-handle-wrapper:hover {
    cursor: grab;
}

.slider-handle-wrapper:active {
    cursor: grabbing !important;
}

.before-container {
    transition: clip-path 0.1s ease-out;
}

/* Prevent text selection during drag */
.comparison-slider {
    user-select: none;
    -webkit-user-select: none;
}

/* Visual feedback on hover */
.slider-handle-wrapper:hover .slider-handle {
    background: #FABA0D;
    box-shadow: 0 0 0 2px rgba(250, 186, 13, 0.3);
}