/* ==========================================================================
   Travel Designer - Custom Styles
   ========================================================================== */

/* CSS Custom Properties - Tema Orchidea Elegante */
:root {
    --color-primary: #b26cba;
    /* Orchidea - ricco e vibrante */
    --color-secondary: #cb8dd6;
    /* Lilla Soffice - delicato e luminoso */
    --color-neutral: #fef8ff;
    /* Bianco Orchidea - sfondo caldo */
    --color-dark: #3c2840;
    /* Prugna Profondo - elegante e leggibile */
    --color-accent: #7ab8a4;
    /* Verde Salvia Caldo - contrasto fresco */
    --color-highlight: #fcc4ff;
    /* Rosa Chiaro - per highlights */

    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Lato', Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

html {
    scroll-behavior: smooth;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
    position: relative;
}

/* Selection */
::selection {
    background-color: var(--color-primary);
    color: white;
}

/* ==========================================================================
   Navigation Styles
   ========================================================================== */

#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    background-color: rgba(60, 40, 64, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(60, 40, 64, 0.15);
}

#navbar.scrolled .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

#navbar.scrolled .nav-link:hover {
    color: white;
}

/* Logo Gradient Animation - elegante cambio colore Orchidea */
.logo-gradient {
    background: linear-gradient(90deg,
            #ffffff 0%,
            #cb8dd6 25%,
            #ffffff 50%,
            #fcc4ff 75%,
            #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: logoShimmer 8s ease-in-out infinite;
}

@keyframes logoShimmer {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 100% center;
    }
}

#navbar.scrolled .nav-logo {
    color: white;
}

#navbar.scrolled .nav-cta {
    background-color: var(--color-primary);
}

/* ==========================================================================
   Animation Keyframes
   ========================================================================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Float */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ==========================================================================
   Animation Classes
   ========================================================================== */

/* Initial invisible state - CRITICAL: prevents flash before animation */
.animate-fade-in,
.animate-fade-in-up,
.animate-fade-in-down,
.animate-fade-in-left,
.animate-fade-in-right,
.animate-scale-in {
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 1s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 1s ease forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 1s ease forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 1s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 1s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 1s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Animation Delays */
.animation-delay-100 {
    animation-delay: 100ms;
}

.animation-delay-200 {
    animation-delay: 200ms;
}

.animation-delay-300 {
    animation-delay: 300ms;
}

.animation-delay-400 {
    animation-delay: 400ms;
}

.animation-delay-500 {
    animation-delay: 500ms;
}

.animation-delay-600 {
    animation-delay: 600ms;
}

/* ==========================================================================
   Scroll Animations (IntersectionObserver)
   ========================================================================== */

.fade-in-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Stagger children animations */
.fade-in-element:nth-child(1) {
    transition-delay: 0ms;
}

.fade-in-element:nth-child(2) {
    transition-delay: 100ms;
}

.fade-in-element:nth-child(3) {
    transition-delay: 200ms;
}

.fade-in-element:nth-child(4) {
    transition-delay: 300ms;
}

.fade-in-element:nth-child(5) {
    transition-delay: 400ms;
}

.fade-in-element:nth-child(6) {
    transition-delay: 500ms;
}

/* ==========================================================================
   Custom Component Styles
   ========================================================================== */

/* Hero Section Gradient Overlay */
#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(60, 40, 64, 0.2) 0%, rgba(60, 40, 64, 0.4) 100%);
    pointer-events: none;
}

/* Hero Text Shadows - per massima leggibilità con eleganza */
.hero-title-shadow {
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 8px 40px rgba(0, 0, 0, 0.2);
}

.hero-text-shadow {
    text-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Service Cards Hover Effect */
#servizi .group:hover {
    transform: translateY(-5px);
}

/* Destination Cards Overlay */
#destinazioni .group::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    transition: background 0.3s ease;
}

#destinazioni .group:hover::after {
    background: rgba(178, 108, 186, 0.1);
}

/* Testimonial Cards Quote */
#testimonianze .bg-white::before {
    content: '"';
    position: absolute;
    top: 20px;
    right: 30px;
    font-family: var(--font-serif);
    font-size: 80px;
    color: var(--color-primary);
    opacity: 0.1;
    line-height: 1;
}

/* Form Focus States */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(178, 108, 186, 0.2);
}

/* ==========================================================================
   Mobile Menu Animation
   ========================================================================== */

#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobile-menu.open {
    max-height: 400px;
}

/* Hamburger Menu Animation */
#menu-toggle svg path {
    transition: all 0.3s ease;
}

#menu-toggle.active svg path {
    stroke: var(--color-primary);
}

/* ==========================================================================
   Decorative Elements
   ========================================================================== */

/* Decorative line for section headers */
.section-header::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-highlight), var(--color-secondary));
    margin: 20px auto 0;
    border-radius: 2px;
}

/* Subtle gradient background for sections */
.bg-gradient-orchidea {
    background: linear-gradient(135deg, var(--color-neutral) 0%, var(--color-highlight) 50%, var(--color-neutral) 100%);
    background-size: 200% 200%;
}

/* Highlight text with new color */
.text-highlight {
    color: var(--color-highlight);
}

/* Glow effect for primary elements */
.glow-primary {
    box-shadow: 0 0 20px rgba(178, 108, 186, 0.3);
}

.glow-primary:hover {
    box-shadow: 0 0 30px rgba(178, 108, 186, 0.5);
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

/* Primary Button Hover Glow */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

/* ==========================================================================
   Scroll Indicator
   ========================================================================== */

@keyframes scrollIndicator {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ==========================================================================
   Image Treatments
   ========================================================================== */

/* Lazy load placeholder */
img[data-src] {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

img[data-src].loaded {
    filter: blur(0);
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-neutral);
}

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

::-webkit-scrollbar-thumb:hover {
    background: #9a5aa2;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-neutral);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {

    /* Reduce animation intensity on mobile */
    .fade-in-element {
        transform: translateY(20px);
    }

    /* Simpler hover effects */
    #servizi .group:hover {
        transform: none;
    }

    /* Testimonial quote smaller */
    #testimonianze .bg-white::before {
        font-size: 50px;
    }
}

/* Ensure sections don't cause horizontal overflow */
section {
    overflow-x: clip;
}

/* 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;
        scroll-behavior: auto !important;
    }

    .fade-in-element {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   FAQ Accordion Styles
   ========================================================================== */

.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 10px 30px -10px rgba(60, 40, 64, 0.15);
}

.faq-toggle:focus {
    outline: none;
}

.faq-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.open .faq-icon {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-content {
    max-height: 500px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {

    #navbar,
    #mobile-menu,
    footer {
        display: none;
    }

    * {
        background: white !important;
        color: black !important;
    }
}