* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

header {
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c59 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Menu navigazione */
.nav-menu {
    display: flex;
    gap: 0rem;
    margin: 0.1rem 0;
    justify-content: left;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    background: #2d5a27;
    padding: 0.40rem 1rem;
    border-radius: 0px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background: #1a3319;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none;
    color: white;
}

/* Breadcrumb */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #4a7c59;
    text-decoration: none;
}

/* Simboli ambiente con tooltip */
.simbolo-ambiente {
    cursor: pointer;
    user-select: none;
    display: inline-block;
    padding: 0;
}

.custom-tooltip {
    position: fixed;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: #666;
    border-top: 1px solid #eee;
    margin-top: 3rem;
}

/* Pagina dettaglio pianta */
.plant-detail {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.plant-header {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fd 0%, #d9ecef 100%);
    border-radius: 15px;
    margin-bottom: 2rem;
    position: relative;
}

.plant-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d5a27;
    margin-bottom: 0.5rem;
}

.plant-scientific-name {
    font-style: italic;
    color: #666;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.plant-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.plant-family {
    color: #2d5a27;
    padding: 2px 4px;
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.plant-family a {
    color: inherit;
    text-decoration: none;
}

.plant-date {
    color: #999;
    font-size: 0.80rem;
}

/* Galleria fotografica */
.plant-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.plant-gallery img {
    width: 250px !important;
    height: auto !important;
    max-height: 200px !important;
    object-fit: contain !important;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
}

.photo-note {
    padding: 0 1.5rem 1rem;
    font-style: italic;
    color: #666;
}

/* Sezioni dettaglio */
.detail-section {
    margin-bottom: 2rem;
}

.detail-section h3 {
    color: #2d5a27;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #e8f5e8;
    padding-bottom: 0.5rem;
}

.detail-section h4 {
    font-size: 1.3rem !important;
    font-weight: 600 !important;
    color: #2d5a27 !important;
    margin: 1.5rem 0 1rem 0 !important;
    border-bottom: 2px solid #e8f5e8;
    padding-bottom: 0.5rem;
}

.detail-section img {
    max-width: 250px !important;
    height: auto !important;
    max-height: 200px !important;
    object-fit: contain !important;
    border-radius: 8px;
}

/* Griglia informazioni */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
}

.info-item {
    background: #dee0e3;
    padding: 1rem;
    border-radius: 8px;
}

.info-label {
    font-weight: bold;
    color: #2d5a27;
    display: block;
    margin-bottom: 0.25rem;
}

/* Contenuto testuale */
.content-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.content-text p {
    margin-bottom: 1rem;
}

.content-text strong,
.plant-detail strong {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #4a7c59 !important;
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
}

.content-text a {
    text-decoration: none;
    color: #a87f32;
    font-weight: 700 !important;
}

.content-text a:hover {
    color: #806636 !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.content-text img {
    max-width: 250px !important;
    height: auto !important;
    max-height: 200px !important;
    object-fit: contain !important;
    border-radius: 8px;
}

/* Link fauna con stili specifici */
.fauna-link,
.fauna-link:visited,
.fauna-link:link,
.fauna-link:active {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    font-family: inherit !important;
    font-style: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    border: none !important;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
    vertical-align: inherit !important;
    text-shadow: inherit !important;
}

.fauna-link:hover {
    color: #2d5016 !important;
    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    text-underline-offset: 3px !important;
    transition: color 0.2s ease, text-decoration 0.2s ease !important;
}

.fauna-link:focus {
    outline: 1px dotted #2d5016 !important;
    outline-offset: 2px !important;
}

/* Modal per immagini */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 900px;
    max-height: 80%;
    object-fit: contain;
    margin-top: 5%;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

.fauna-link,
.fauna-link:visited,
.fauna-link:link,
.fauna-link:active {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    font-family: inherit !important;
    font-style: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    text-transform: inherit !important;
    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    border: none !important;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline !important;
    vertical-align: inherit !important;
    text-shadow: inherit !important;
}

.fauna-link:hover {
    color: #2d5016 !important;
    text-decoration: underline !important;
    text-decoration-style: dotted !important;
    text-underline-offset: 3px !important;
    transition: color 0.2s ease, text-decoration 0.2s ease !important;
}

.fauna-link:focus {
    outline: 1px dotted #2d5016 !important;
    outline-offset: 2px !important;
}
/* Bottone Torna Su */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #4a7c59;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #2d5a27;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 124, 89, 0.4);
}

/* Decorazione foglie per desktop */
@media (min-width: 1024px) {
    .plant-header::before,
    .plant-header::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 2cm;
        background-image: 
            radial-gradient(ellipse 15px 20px at 30% 15%, rgba(45, 90, 39, 0.5) 50%, transparent 50%),
            radial-gradient(ellipse 12px 16px at 70% 35%, rgba(74, 124, 89, 0.4) 50%, transparent 50%),
            radial-gradient(ellipse 18px 22px at 25% 55%, rgba(45, 90, 39, 0.6) 50%, transparent 50%),
            radial-gradient(ellipse 14px 18px at 75% 75%, rgba(74, 124, 89, 0.3) 50%, transparent 50%),
            linear-gradient(135deg, transparent 40%, rgba(45, 90, 39, 0.3) 45%, rgba(45, 90, 39, 0.3) 55%, transparent 60%);
        background-size: 
            100% 80px,
            100% 80px,
            100% 80px,
            100% 80px,
            100% 100%;
        background-repeat: repeat-y;
    }

    .plant-header::before {
        left: 0;
    }

    .plant-header::after {
        right: 0;
        transform: scaleX(-1);
    }

    .plant-header {
        padding: 2rem 3cm;
    }
}

/* Media queries per responsività */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .plant-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .plant-gallery img {
        width: 100% !important;
        max-width: 200px !important;
    }

    .info-grid {
        grid-template-columns: 1fr;
        margin-left: 0;
        margin-right: 0;
    }

    .plant-title {
        font-size: 2rem;
    }

    .plant-scientific-name {
        font-size: 1.2rem;
    }

    .plant-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-menu a {
        font-size: 0.85rem;
        padding: 0.3rem 0.8rem;
    }

    .content-text {
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;
        margin-top: 10%;
    }
}


@media print {
  /* Nasconde elementi inutili in stampa */
  header,
  .btn,
  .nav-menu, 
  .breadcrumb, 
  .back-to-top,
  .simbolo-ambiente {
    display: none !important;
  }

  /* Ottimizza il corpo pagina */
  body, * {
    background: #fff;
    color: #000;
    font-size: 95% !important;
  }

  /* Rimuove ombre e padding inutili */
  * {
    box-shadow: none !important;
    background-image: none !important;
  }

  @page {
    size: A4;
    margin: 1.5cm;
  }
}

@page {
  size: A4;
  margin: 1.5cm;
}