/**
 * VAM Theme - Component Styles
 */

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.vam-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.vam-nav {
    padding: 1rem 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    transition: var(--vam-transition);
}

.vam-nav.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.vam-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.vam-nav__logo {
    font-size: 1.25rem;
    font-weight: 900;
}

.vam-nav__logo span {
    color: var(--vam-m1-red);
}

.vam-nav__list {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.vam-nav__list a {
    font-weight: 500;
    font-size: 0.95rem;
}

.vam-nav__list a:hover {
    color: var(--vam-m3-yellow);
}

.vam-nav__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vam-nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.vam-nav__toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--vam-white);
    transition: var(--vam-transition);
}

@media (max-width: 768px) {
    .vam-nav__menu {
        display: none;
    }
    
    .vam-nav__cta {
        display: none;
    }
    
    .vam-nav__toggle {
        display: flex;
    }
}

/* Mobile Menu */
.vam-mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--vam-dark);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 999;
}

.vam-mobile-menu.active {
    transform: translateX(0);
}

.vam-mobile-menu__list {
    list-style: none;
    padding: 2rem;
}

.vam-mobile-menu__list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vam-mobile-menu__list a {
    display: block;
    padding: 1rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

/* ============================================
   HERO
   ============================================ */
.vam-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 8rem 2rem 4rem;
}

.vam-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.vam-hero__tunnel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200vmax;
    height: 200vmax;
}

.vam-hero__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 2px solid rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    animation: tunnel-expand 4s linear infinite;
}

.vam-hero__ring:nth-child(1) { animation-delay: 0s; }
.vam-hero__ring:nth-child(2) { animation-delay: 0.5s; }
.vam-hero__ring:nth-child(3) { animation-delay: 1s; }
.vam-hero__ring:nth-child(4) { animation-delay: 1.5s; }
.vam-hero__ring:nth-child(5) { animation-delay: 2s; }
.vam-hero__ring:nth-child(6) { animation-delay: 2.5s; }
.vam-hero__ring:nth-child(7) { animation-delay: 3s; }
.vam-hero__ring:nth-child(8) { animation-delay: 3.5s; }

@keyframes tunnel-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        margin-left: 0;
        margin-top: 0;
    }
    100% {
        width: 200vmax;
        height: 200vmax;
        opacity: 0;
        margin-left: -100vmax;
        margin-top: -100vmax;
    }
}

.vam-hero__content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.vam-hero__geo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    margin-bottom: 2rem;
    cursor: pointer;
}

.vam-hero__geo-pulse {
    width: 10px;
    height: 10px;
    background: var(--vam-m2-green);
    border-radius: 50%;
    animation: vam-pulse 2s infinite;
}

.vam-hero__geo-fermata {
    color: var(--vam-m3-yellow);
}

.vam-hero__title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.vam-hero__title span {
    color: var(--vam-m1-red);
}

.vam-hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--vam-gray-400);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.vam-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.vam-hero__scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: bounce 2s infinite;
}

.vam-hero__scroll span {
    font-size: 0.75rem;
    color: var(--vam-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.vam-hero__scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--vam-gray-400);
    border-bottom: 2px solid var(--vam-gray-400);
    transform: rotate(45deg);
}

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

/* ============================================
   LINE CARDS
   ============================================ */
.vam-lines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.vam-line-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--vam-dark);
    border-radius: var(--vam-radius);
    border: 2px solid transparent;
    transition: var(--vam-transition);
}

.vam-line-card:hover {
    border-color: var(--line-color);
    transform: translateX(8px);
}

.vam-line-card__badge {
    width: 60px;
    height: 60px;
    background: var(--line-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 900;
    flex-shrink: 0;
}

.vam-line-card__name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.vam-line-card__count {
    color: var(--vam-gray-400);
    font-size: 0.9rem;
}

.vam-line-card__arrow {
    margin-left: auto;
    color: var(--vam-gray-400);
    font-size: 1.5rem;
}

/* ============================================
   STATS
   ============================================ */
.vam-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 900px) {
    .vam-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .vam-stats {
        grid-template-columns: 1fr;
    }
}

.vam-stat {
    text-align: center;
    padding: 2rem;
    background: var(--vam-dark-lighter);
    border-radius: var(--vam-radius);
}

.vam-stat__value {
    display: block;
    font-family: var(--vam-font-mono);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--vam-m1-red);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.vam-stat__label {
    color: var(--vam-gray-400);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   FOOTER
   ============================================ */
.vam-footer {
    background: var(--vam-dark-lighter);
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vam-footer__grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 900px) {
    .vam-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .vam-footer__grid {
        grid-template-columns: 1fr;
    }
}

.vam-footer__logo {
    font-size: 1.5rem;
    font-weight: 900;
    display: block;
    margin-bottom: 1rem;
}

.vam-footer__logo span {
    color: var(--vam-m1-red);
}

.vam-footer__description {
    color: var(--vam-gray-400);
    margin-bottom: 1.5rem;
}

.vam-footer__social {
    display: flex;
    gap: 1rem;
}

.vam-footer__social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--vam-transition);
}

.vam-footer__social a:hover {
    background: var(--vam-m1-red);
}

.vam-footer-widget__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.vam-footer-widget ul {
    list-style: none;
}

.vam-footer-widget li {
    margin-bottom: 0.5rem;
}

.vam-footer-widget a {
    color: var(--vam-gray-400);
}

.vam-footer-widget a:hover {
    color: var(--vam-m3-yellow);
}

.vam-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vam-footer__copy {
    color: var(--vam-gray-400);
    font-size: 0.9rem;
}

.vam-footer__claim {
    color: var(--vam-gray-600);
    font-size: 0.85rem;
}

/* ============================================
   MAP COMPONENTS
   ============================================ */
.vam-map-wrapper {
    border-radius: var(--vam-radius);
    overflow: hidden;
}

.vam-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.vam-map-filter {
    padding: 0.5rem 1rem;
    background: var(--vam-dark-lighter);
    border: 2px solid transparent;
    border-radius: 100px;
    color: var(--vam-white);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--vam-transition);
}

.vam-map-filter:hover,
.vam-map-filter.active {
    border-color: var(--line-color, var(--vam-m1-red));
    background: var(--line-color, var(--vam-m1-red));
}

.vam-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.vam-map-legend__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--vam-gray-400);
}

.vam-map-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* ============================================
   CTA SECTION
   ============================================ */
.vam-cta-section {
    background: linear-gradient(135deg, var(--vam-dark) 0%, rgba(238, 49, 36, 0.1) 100%);
}

.vam-cta-card {
    background: var(--vam-dark-lighter);
    border: 1px solid rgba(238, 49, 36, 0.3);
    border-radius: 24px;
    padding: 4rem;
    text-align: center;
}

.vam-cta-card__badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(238, 49, 36, 0.2);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.vam-cta-card__title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.vam-cta-card__title span {
    color: var(--vam-m1-red);
}

.vam-cta-card__text {
    color: var(--vam-gray-400);
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

.vam-cta-card__price {
    margin-bottom: 2rem;
}

.vam-cta-card__price-value {
    font-family: var(--vam-font-mono);
    font-size: 3rem;
    font-weight: 700;
    color: var(--vam-m3-yellow);
}

.vam-cta-card__price-period {
    color: var(--vam-gray-400);
}

/* ============================================
   FILTERS
   ============================================ */
.vam-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.vam-filter-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    color: var(--vam-white);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--vam-transition);
}

.vam-filter-btn:hover,
.vam-filter-btn.active {
    background: var(--vam-m1-red);
    border-color: var(--vam-m1-red);
}

/* ============================================
   QUICK STATS
   ============================================ */
.vam-quick-stat {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vam-quick-stat:last-child {
    border-bottom: none;
}

.vam-quick-stat__value {
    display: block;
    font-family: var(--vam-font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--vam-m1-red);
}

.vam-quick-stat__label {
    color: var(--vam-gray-400);
    font-size: 0.9rem;
}

/* ============================================
   DISTANCE BADGE
   ============================================ */
.vam-distance-badge {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    font-family: var(--vam-font-mono);
    font-size: 0.8rem;
}

/* ============================================
   VIDEO BACKGROUND (Cycling)
   ============================================ */
.vam-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.vam-video-bg__video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    transition: opacity 0.5s ease;
}

.vam-video-bg__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(26, 26, 46, 0.85) 0%,
        rgba(26, 26, 46, 0.7) 50%,
        rgba(238, 49, 36, 0.3) 100%
    );
    z-index: 1;
}

/* Video Wrapper - covers multiple sections */
.vam-video-wrapper {
    position: relative;
}

.vam-video-wrapper--active {
    position: relative;
}

.vam-video-wrapper--active .vam-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.vam-video-wrapper--active > section,
.vam-video-wrapper--active > .vam-container {
    position: relative;
    z-index: 2;
}

/* Override background colors inside video wrapper */
.vam-video-wrapper--active .vam-section,
.vam-video-wrapper--active .vam-section--dark,
.vam-video-wrapper--active .vam-esercenti-hero,
.vam-video-wrapper--active .vam-faq-hero {
    background: transparent !important;
}

/* Make cards semi-transparent inside video wrapper */
.vam-video-wrapper--active .vam-vantaggio-card,
.vam-video-wrapper--active .vam-faq-item,
.vam-video-wrapper--active .vam-faq-cta,
.vam-video-wrapper--active .vam-line-card,
.vam-video-wrapper--active .vam-map-wrapper {
    background: rgba(22, 33, 62, 0.85);
    backdrop-filter: blur(10px);
}

.vam-video-wrapper--active .vam-map-container {
    border-radius: var(--vam-radius);
    overflow: hidden;
}

.vam-video-wrapper--active .vam-map-filters {
    background: rgba(22, 33, 62, 0.9);
    padding: 1rem;
    border-radius: var(--vam-radius) var(--vam-radius) 0 0;
    margin-bottom: -1px;
}

/* Hero sections with video background (legacy support) */
.vam-hero--video,
.vam-esercenti-hero--video,
.vam-faq-hero--video {
    position: relative;
    overflow: hidden;
}

.vam-hero--video > .vam-container,
.vam-hero--video > .vam-hero__content,
.vam-esercenti-hero--video > *:not(.vam-video-bg),
.vam-faq-hero--video > *:not(.vam-video-bg) {
    position: relative;
    z-index: 2;
}

/* Responsive: disable video on mobile for performance */
@media (max-width: 768px) {
    .vam-video-bg__video {
        display: none;
    }
    
    .vam-video-bg__overlay {
        background: linear-gradient(
            135deg,
            rgba(26, 26, 46, 0.95) 0%,
            rgba(238, 49, 36, 0.2) 100%
        );
    }
    
    .vam-video-wrapper--active .vam-vantaggio-card,
    .vam-video-wrapper--active .vam-faq-item,
    .vam-video-wrapper--active .vam-faq-cta {
        background: var(--vam-dark-lighter);
        backdrop-filter: none;
    }
}


/* ============================================
   MAP MARKERS (Global Styles)
   ============================================ */
.vam-marker {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.vam-marker:hover {
    transform: scale(1.2);
    z-index: 1000 !important;
}

.vam-marker__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 14px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 3px rgba(255,255,255,0.9);
    position: relative;
}

.vam-marker__icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: vam-marker-pulse 2s infinite;
}

.vam-marker:hover .vam-marker__icon::before {
    opacity: 1;
}

.vam-marker__pin {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid currentColor;
}

@keyframes vam-marker-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 0; }
}

/* Marker Tooltip */
.vam-marker-tooltip {
    background: #1A1A2E !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
    white-space: nowrap;
}

.vam-marker-tooltip::before,
.leaflet-tooltip-top:before {
    border-top-color: #1A1A2E !important;
}

/* Map Popup Styles */
.vam-map-popup {
    text-align: center;
    padding: 5px;
    min-width: 150px;
}

.vam-map-popup__title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 5px;
    color: #1A1A2E;
}

.vam-map-popup__line {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.vam-map-popup__meta {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.vam-map-popup__link {
    display: inline-block;
    background: #EE3124;
    color: white !important;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s;
}

.vam-map-popup__link:hover {
    background: #c9201a;
}

/* Leaflet popup override */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.leaflet-popup-tip {
    box-shadow: none;
}
