/* ================================
   18 - LANDING PAGE STYLES
   Sezioni homepage: demo, agenti, tabella, mappa, testimonianze, FAQ, pricing dark wrapper
   Tema chiaro con accenti brand
   ================================ */

/* --- Shared Section Patterns --- */
.section-dark {
    background: var(--bg-sky-light);
    color: var(--text-primary);
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
}

.section-surface {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Come Funziona / Demo Interattiva --- */
.demo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
    align-items: center;
}

.demo-mockup {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    background: #ffffff;
}

.demo-mockup .mockup-chat {
    background: #f8fafc;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    min-height: 160px;
}

.demo-mockup .mockup-chat .msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0.8rem;
}

.demo-mockup .mockup-chat .msg.user-msg {
    justify-content: flex-end;
}

.demo-mockup .mockup-chat .msg-bubble {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 10px 14px;
    font-size: 0.88rem;
    color: var(--text-primary);
    max-width: 80%;
}

.demo-mockup .mockup-chat .msg-bubble.ai-bubble {
    background: #f0f9ff;
    border-color: rgba(0, 168, 232, 0.2);
}

/* Typing cursor */
.typing-cursor::after {
    content: '|';
    animation: blink 0.7s infinite;
    color: var(--primary-sky);
    font-weight: 700;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Matrix mockup animata nel demo */
.demo-mockup .mockup-matrix-container {
    padding: 0.8rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-light);
    min-height: 200px;
    overflow: hidden;
}

.demo-mockup .mockup-matrix {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.demo-mockup .mockup-matrix.visible {
    opacity: 1;
    transform: translateY(0);
}

.mockup-day-col {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mockup-day-header {
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 2px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mockup-day-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.mockup-matrix-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.65rem;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.3s;
}

.mockup-matrix-card.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mockup-matrix-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.mockup-matrix-card .mmc-img {
    width: 100%;
    height: 55px;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
}

/* Card standard senza foto (pasti/trasporti/check-in/out): strip icona */
.mockup-matrix-card .mmc-icon {
    width: 100%;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #94a3b8;
    font-size: 1.1rem;
}

.mockup-matrix-card .mmc-body {
    padding: 6px 8px;
}

.mockup-matrix-card .mmc-body .mmc-time {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    margin-bottom: 3px;
}

.mmc-time.morning { background: #fef3c7; color: #92400e; }
.mmc-time.afternoon { background: #ffedd5; color: #9a3412; }
.mmc-time.evening { background: #ede9fe; color: #5b21b6; }

.mockup-matrix-card .mmc-body .mmc-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.68rem;
    line-height: 1.2;
}

/* Demo copy */
.demo-copy {
    padding-right: 1rem;
}

.demo-copy h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.demo-copy p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.2rem;
    font-size: 1rem;
}

/* Steps */
.demo-steps {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.demo-steps li {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.demo-steps .step-num {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

/* --- 5 Agenti Grid --- */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.agent-card {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    opacity: 0;
    transition: opacity 0.3s;
}

.agent-card:nth-child(1)::before { background: #00a8e8; }
.agent-card:nth-child(2)::before { background: #3ddc84; }
.agent-card:nth-child(3)::before { background: #ff6b35; }
.agent-card:nth-child(4)::before { background: #f59e0b; }
.agent-card:nth-child(5)::before { background: #7c5ce7; }

.agent-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-sky);
    box-shadow: var(--shadow-card-hover);
}

.agent-card:hover::before { opacity: 1; }

.agent-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    font-size: 1.5rem;
}

.agent-icon.flights { background: rgba(0, 168, 232, 0.1); color: #00a8e8; }
.agent-icon.hotels { background: rgba(61, 220, 132, 0.1); color: #3ddc84; }
.agent-icon.activities { background: rgba(255, 107, 53, 0.1); color: #ff6b35; }
.agent-icon.restaurants { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.agent-icon.budget { background: rgba(124, 92, 231, 0.1); color: #7c5ce7; }

.agent-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.agent-card p {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- Itinerario Vivo / Drag-and-Drop Mockup --- */
.itinerary-showcase {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.itinerary-table-mockup {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px;
    border: 1px solid var(--border-light);
}

.itinerary-table-mockup .day-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.itinerary-table-mockup .day-col .day-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}

.itinerary-table-mockup .day-col .activity-cell {
    min-height: 36px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.itinerary-table-mockup .day-col .activity-cell.has-activity {
    background: #f0f9ff;
    border-color: rgba(0, 168, 232, 0.25);
    color: var(--text-primary);
    font-weight: 500;
    padding: 6px 8px;
    gap: 4px;
}

.itinerary-table-mockup .day-col .activity-cell.has-activity i {
    color: var(--primary-sky);
    font-size: 0.65rem;
}

.itinerary-table-mockup .day-col .activity-cell.drag-over {
    border-color: var(--primary-sky);
    background: rgba(0, 168, 232, 0.06);
    border-style: dashed;
}

/* Drag animation class */
.activity-dragging {
    animation: dragLift 1.8s ease-in-out infinite;
}

@keyframes dragLift {
    0%, 100% { transform: translateY(0); box-shadow: var(--shadow-card); }
    30% { transform: translateY(-12px) scale(1.08); box-shadow: 0 16px 40px rgba(0,168,232,0.2); }
    60% { transform: translateX(30px) translateY(-8px) scale(1.05); }
    80% { transform: translateX(30px) translateY(0) scale(1); }
}

/* --- Mapa Showcase (Mapbox) --- */
.map-showcase {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

#mapbox-container {
    height: 450px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    position: relative;
}

.map-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.map-feature-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.map-feature-item .mf-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: #f0f9ff;
    border: 1px solid rgba(0, 168, 232, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-sky);
    font-size: 1rem;
}

.map-feature-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.map-feature-item p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Mapbox marker styles */
.mapbox-marker {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 168, 232, 0.4);
    border: 2px solid #ffffff;
    cursor: pointer;
    transition: transform 0.2s;
}

.mapbox-marker:hover {
    transform: scale(1.3);
}

/* --- Testimonials --- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.testimonial-card {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s;
    box-shadow: var(--shadow-card);
}

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

.testimonial-card .stars {
    color: var(--accent-gold);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.testimonial-card .quote {
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.93rem;
    margin-bottom: 1.5rem;
}

.testimonial-card .author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-card .author-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
}

.testimonial-card .author-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.testimonial-card .author-trip {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- FAQ Accordion --- */
.faq-list {
    max-width: 700px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--border-light);
    border-radius: 14px;
    margin-bottom: 0.75rem;
    background: var(--surface-card);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-card);
}

.faq-question {
    width: 100%;
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-family: 'Poppins', sans-serif;
}

.faq-question i {
    color: var(--primary-sky);
    transition: transform 0.3s;
    font-size: 0.85rem;
}

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

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

.faq-item.open .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding: 0 1.5rem 1.2rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.92rem;
}

/* --- Pricing Dark Wrapper (per contrasto visivo) --- */
.pricing-dark {
    background: var(--bg-sky-light);
    padding: 6rem 2rem;
}

.pricing-dark .subscription-section {
    background: transparent;
    padding: 0;
}

.pricing-dark .section-container h2 {
    color: var(--text-primary);
}

.pricing-dark .subscription-subtitle {
    color: var(--text-secondary);
}

.pricing-dark .card {
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.pricing-dark .card h3 {
    color: var(--text-primary);
}

.pricing-dark .price {
    color: var(--text-primary);
}

.pricing-dark .features-list li {
    color: var(--text-secondary);
}

.pricing-dark .toggle-label {
    color: var(--text-secondary);
}

.pricing-dark .toggle-label.active {
    color: var(--text-primary);
}

.pricing-dark .card-badge {
    background: #f1f5f9;
    color: var(--text-secondary);
}

/* --- Enhanced Footer --- */
.footer-premium {
    background: var(--dark-blue);
    padding: 4rem 2rem 2rem;
    color: #f8f9fa;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto 3rem;
}

.footer-brand img {
    height: 40px;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-col h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #f8f9fa;
    margin-bottom: 1.2rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--primary-sky);
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: #94a3b8;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.footer-social a:hover {
    color: var(--primary-sky);
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .agents-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .demo-grid,
    .itinerary-showcase,
    .map-showcase {
        grid-template-columns: 1fr;
    }
    .agents-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .section-dark,
    .section-surface,
    .pricing-dark {
        padding: 4rem 1.5rem;
    }
    #mapbox-container {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .agents-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   MOBILE — demo "Come funziona" + Laboratorio embedded
   La matrix demo a 4 colonne era illeggibile su telefono e la
   chat del laboratorio usava dimensioni pensate per desktop.
   ============================================================ */
@media (max-width: 768px) {

    /* --- Demo mockup: matrix leggibile a 2 colonne --- */
    .demo-mockup .mockup-matrix {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .demo-mockup .mockup-matrix-container {
        min-height: 120px;      /* niente più buco enorme durante l'animazione */
        padding: 0.7rem;
    }
    .mockup-matrix-card { font-size: 0.72rem; }
    .mockup-matrix-card .mmc-img,
    .mockup-matrix-card .mmc-icon { height: 64px; }
    .mockup-matrix-card .mmc-body .mmc-title { font-size: 0.74rem; }
    .mockup-matrix-card .mmc-body .mmc-time { font-size: 0.62rem; }
    .mockup-day-header { font-size: 0.72rem; }
    .demo-mockup .mockup-chat { padding: 1rem; min-height: 0; }
    .demo-mockup .mockup-chat .msg-bubble { font-size: 0.82rem; max-width: 88%; }

    /* --- Laboratorio embedded: card chat compatta --- */
    .chat-section { padding: 3rem 0.75rem; }
    .chat-section .section-container { max-width: 100%; }
    .chat-app-wrapper { max-width: 100%; margin: 1.25rem auto; border-radius: 16px; }

    .chat-app-wrapper .chat-header { padding: 0.7rem 1rem; gap: 0.7rem; }
    .chat-app-wrapper .agent-avatar { width: 36px; height: 36px; }
    .chat-app-wrapper .agent-info h2 { font-size: 1rem; }
    .chat-app-wrapper .agent-info .status { font-size: 0.72rem; }
    .chat-app-wrapper .new-chat-btn { padding: 6px 10px; font-size: 0.75rem; }

    .chat-section .welcome-screen {
        padding: 1.5rem 1rem 1.75rem;
        min-height: 0;
    }
    .chat-section .welcome-header { margin-bottom: 1.25rem; }
    .chat-section .welcome-header .sparkle-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
    .chat-section .welcome-header h1 { font-size: 1.6rem; }
    .chat-section .welcome-header h2 { font-size: 1.05rem; }

    .chat-section .suggestions-grid { gap: 10px; }
    .chat-section .suggestion-pill {
        min-width: calc(50% - 5px);
        max-width: calc(50% - 5px);
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 8px;
    }
    .chat-section .suggestion-pill .pill-icon { width: 34px; height: 34px; font-size: 1.1rem; }
    .chat-section .suggestion-pill .pill-text { font-size: 0.85rem; }
    .chat-section .suggestion-pill .pill-text span { font-size: 0.72rem; }

    .chat-section .welcome-input-bar { margin-top: 1.5rem; padding: 8px 12px; }
    .chat-section .chat-container { height: 68vh; height: 68dvh; }
}
