/* ------------------------
   RESET BASE
------------------------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.body-wrapper {
    background-color: #f7f9fc;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
}

/* ------------------------
   HEADER & NAVBAR
------------------------ */
.header {
    background-color: #0077b6;
    padding: 15px 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;  /* ← QUESTO RISOLVE LA SPAZIATURA */
}

.navbar a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.navbar a:hover {
    color: #ffd166;
}

.navbar .home-link {
    font-size: 1.3rem;
    font-weight: 700;
    padding-bottom: 2px;
}

/* ------------------------
   MAIN CONTENT
------------------------ */
.main-content {
    flex: 1 0 auto;
    max-width: 80vw;
    margin: 0 auto;
    min-height: 85vh;
}

.main-content h1,
.main-content h2,
.main-content h3 {
    color: #023e8a;
    margin-bottom: 20px;
}

.main-content h1 {
    font-size: 2.2rem;
}

.main-content h2 {
    font-size: 1.8rem;
}

.main-content h3 {
    font-size: 1.4rem;
}

/* ------------------------
   FOOTER
------------------------ */
.footer {
    background-color: #023e8a;
    color: #fff;
    text-align: center;
    padding: 15px 20px;
    margin-top: 40px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ------------------------
   LINK GENERALE
------------------------ */
.link {
    text-decoration: none;
    color: #0077b6;
    transition: color 0.3s ease;
}

.link:hover {
    color: #023e8a;
    text-decoration: underline;
}

/* ------------------------
   BOTTONI GENERALI
------------------------ */
.btn {
    cursor: pointer;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background-color: #0077b6;
    color: #fff;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #023e8a;
    transform: translateY(-2px);
}

/* ------------------------
   FORM GENERALE
------------------------ */
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 1rem;
}

.form-textarea {
    resize: vertical;
}

/* ------------------------
   GRID & FLEX UTILITIES
------------------------ */
.flex {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.grid {
    display: grid;
    gap: 20px;
}

.text-center {
    text-align: center;
}

/* ------------------------
   RESPONSIVE
------------------------ */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
    }

    .main-content {
        padding: 20px 10px;
    }
}


/* ------------------------
   BOTTONI
------------------------ */
.btn {
    cursor: pointer;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background-color: #345d1a;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #345d1a;
    transform: translateY(-2px);
}

.finish-flag {
    width: 20px;
    height: 24px;
    position: relative;
    z-index: 1;
}

.finish-flag::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 24px;
    background: #333;
    left: 0;
}

.finish-flag::after {
    content: '🏁';
    position: absolute;
    font-size: 18px;
    left: 2px;
    top: -2px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease-out;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3887be;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}


/* === BASE RESPONSIVE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f9f9f9;
}

/* === CONTAINER === */
.trip-container,
.trips-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

@media (max-width: 768px) {

    .trip-container,
    .trips-grid {
        padding: 15px;
    }
}

/* === TITOLO TRIP === */
.trip-header h1 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #222;
}

@media (max-width: 768px) {
    .trip-header h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }
}

/* === STATISTICHE VIAGGIO === */
.trip-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 30px 0;
}

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

@media (max-width: 480px) {
    .trip-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

@media (max-width: 480px) {
    .stat-card {
        padding: 15px;
        gap: 12px;
    }
}

.stat-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .stat-icon {
        font-size: 28px;
    }
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 18px;
    }
}

/* === GRAFICO ALTIMETRIA === */
.elevation-chart-container {
    margin: 30px 0;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.elevation-chart-container h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

#elevationChart {
    width: 100%;
    height: 200px;
}

@media (max-width: 768px) {
    .elevation-chart-container {
        padding: 15px;
        margin: 20px 0;
    }

    #elevationChart {
        height: 180px;
    }
}

/* === TRIPS GRID (INDEX) === */
.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 40px 20px;
}

@media (max-width: 768px) {
    .trips-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 15px;
    }
}

.trip-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.trip-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.trip-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

@media (max-width: 480px) {
    .trip-card img {
        height: 200px;
    }
}

.trip-card-content {
    padding: 20px;
}

@media (max-width: 480px) {
    .trip-card-content {
        padding: 15px;
    }
}

.trip-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #222;
}

@media (max-width: 480px) {
    .trip-card h3 {
        font-size: 18px;
    }
}

.trip-card p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* === NAVBAR DROPDOWN === */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.dropdown-trigger:hover {
    color: #ffd166;
}

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

.nav-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 12px;
    background: white;
    min-width: 280px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 8px 0;
}

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

.dropdown-item {
    display: block;  /* ← BLOCK invece di FLEX */
    padding: 12px 20px;
    color: #333 !important;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    text-align: left;  /* ← Allineamento esplicito */
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.08) 0%, transparent 100%);
    border-left-color: #FF6B35;
    color: #FF6B35 !important;
}


.dropdown-empty {
    color: #999 !important;
    font-style: italic;
    cursor: default;
    pointer-events: none;
}

.dropdown-empty:hover {
    background: transparent !important;
    border-left-color: transparent !important;
}

/* Mobile dropdown */
@media (max-width: 768px) {
    .navbar-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }
    
    .nav-dropdown {
        width: 100%;
    }

    .dropdown-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 10px 0;
    }

    .dropdown-menu {
        position: static;
        margin-top: 0;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding: 0;
    }

    .nav-dropdown.active .dropdown-menu {
        max-height: 500px;
        opacity: 1;
        visibility: visible;
        padding: 8px 0;
    }

    .dropdown-item {
        padding: 12px 20px 12px 40px;
        color: rgba(255, 255, 255, 0.9) !important;
        border-left: none;
    }

    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffd166 !important;
    }
}


/* === ABOUT PAGE === */

/* === HERO SECTION === */
.about-hero {
    padding: 50px;
    text-align: center;
    
}

.hero-content {
    max-width: 100vw;
    margin: 0 auto;
}

.page-title {
    font-size: 4rem !important;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 400;
}

/* === SECTION CONTAINER === */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title-center {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
}

/* === PERSONAL SECTION === */
.personal-section {
    background: #f8f9fa;
}

.personal-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: center;
}

.personal-image {
    position: relative;
}

.personal-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

.image-decoration {
    position: absolute;
    inset: -20px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 140, 97, 0.1));
    border-radius: 20px;
    z-index: 1;
}

.personal-text {
    padding: 20px 0;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
}

.personal-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4a4a4a;
    margin-bottom: 20px;
}

.stats-mini {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-mini-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #FF6B35;
}

.stat-mini-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* === BIKE SECTION === */
.bike-section {
    padding: 100px 20px;
}

.bike-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: start;
}

.bike-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bike-image-main {
    grid-column: 1 / -1;
}

.bike-image-main img,
.bike-image-secondary img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.bike-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.bike-description {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4a4a4a;
    margin-bottom: 30px;
}

.bike-specs {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #dee2e6;
}

.spec-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.spec-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.95rem;
}

.spec-value {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 1rem;
}

/* === GEAR SECTION === */
.gear-section {
    background: #f8f9fa;
}

.gear-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.gear-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.gear-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.gear-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.gear-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gear-item:hover .gear-image img {
    transform: scale(1.05);
}

.gear-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 107, 53, 0.95);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.gear-content {
    padding: 30px;
}

.gear-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.gear-brand {
    font-size: 0.9rem;
    color: #FF6B35;
    font-weight: 600;
    margin-bottom: 16px;
}

.gear-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #6c757d;
    margin-bottom: 16px;
}

.gear-rating {
    font-size: 1.1rem;
}

/* === CTA SECTION === */
.cta-section {
    padding: 100px 20px;
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.cta-text {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 40px;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background: #FF6B35;
    color: white;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.cta-button:hover {
    background: #ff8c61;
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 107, 53, 0.5);
}

/* === RESPONSIVE === */
@media (max-width: 968px) {
    .page-title {
        font-size: 2.5rem;
    }
    
    .personal-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .bike-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .stats-mini {
        gap: 30px;
    }
    
    .gear-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .about-hero {
        padding: 60px 20px 50px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1.1rem;
    }
    
    .personal-section,
    .bike-section,
    .gear-section,
    .cta-section {
        padding: 60px 20px;
    }
    
    .section-title-center {
        font-size: 2rem;
    }
    
    .bike-gallery {
        grid-template-columns: 1fr;
    }
    
    .stats-mini {
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .cta-title {
        font-size: 2rem;
    }
}
