.tree-container {
    font-family: sans-serif;
}

.tree-top-menu {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.tree-top-menu button {
    padding: 10px;
    border: 1px solid #ccc;
    background: #346732;
    cursor: pointer;
    color: #fff;
    border-radius: 20px;
    font-weight: 500;
}
.tree-top-menu button.active {
    background: #cfe9cf;
    border-color: #51ce51;
    color: #346732;
    font-weight: 600;
}

.tree-main {
    display: flex;
    gap: 20px;
}

.tree-filters {
    width: 200px;
    flex-shrink: 0;
}
.filter-container {
    padding: 15px 15px 25px 15px;
    border: 2px solid #346732;
    border-radius: 20px;
    background-color: #3467322e;
}

.filter-container h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: #346732 !important;
    font-size: 20px;
    margin-top: 15px;
    line-height: 1.4em !important;
}
#clear-filters {
    background-color: #346732;
    color: #fff;
    padding: 10px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 20px;
    border: none;
}
.tree-results {
    flex-grow: 1;
}

.species-card {
    border: 1px solid #ccc;
    margin-bottom: 2%;
    padding: 0px;
    display: inline-block;
    width: 30%;
    vertical-align: top;
    margin-right: 2%;
    border-radius: 20px;
    background-color: #fff;
    box-shadow: 0px 0px 10px #ccc;
    transition: all 0.3s ease;
}
.species-card:hover {
    transform: scale(1.05);
}
.species-card a {
    text-decoration: none;
    color: #346732;
}
.species-card a:hover {
    text-decoration: underline;
}
.species-card h3 {
    font-weight: 600;
    margin-bottom: 0px;
    color: #346732 !important;
    font-size: 20px !important;
    margin-top: 0;
}
.species-card em {
    font-style: italic;
    font-size: 14px;
    color: #346732;
}
.species-card p {
    font-size: 14px;
    color: #346732;
}
.species-card img {
    width: 100%;
    height: auto;
    border-radius: 10px 10px 0px 0px;
    object-fit: cover;
    aspect-ratio: 1;
}
.species-card-content {
    padding: 15px;
}
.tags span {
    display: inline-block;
    margin-top: 5px;
    margin-right: 5px;
    background: #e2f0e2;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.filter-container label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.filter-container label svg {
    width: 40px;
    height: 40px;
}
.filter-container label input {
    margin-right: 10px;
}
.filter-container label input[type="checkbox"] {
    width: 20px;
    height: 20px;
}
.filter-container label input[type="checkbox"]:checked {
    background-color: #346732;
    border-color: #346732;
}
.filter-container label input[type="checkbox"]:checked + svg {
    fill: #fff;
}
.filter-container label input[type="checkbox"]:checked + svg path {
    fill: #fff;
}
.filter-container label input[type="checkbox"]:checked + svg path {
    fill: #fff;
}
.filter-container label input[type="checkbox"]:checked + svg path {
    fill: #fff;
}
.filter-container label input[type="checkbox"]:checked + svg path {
    fill: #fff;
}
.filter-container label input[type="checkbox"]:checked + svg path {
    fill: #fff;
}
.filter-container label input[type="checkbox"]:checked + svg path {
    fill: #fff;
}
.filter-container label input[type="checkbox"]:checked + svg path {
    fill: #fff;
}
.filter-container label input[type="checkbox"]:checked + svg path {
    fill: #fff;
}
.filter-container label input[type="checkbox"]:checked + svg path {
    fill: #fff;
}

.custom-checkbox input {
    display: none; /* Hide checkbox box */
  }
  
  .custom-checkbox {
    display: inline-block;
    cursor: pointer;
  }
  
  .custom-checkbox .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
  }
  
  .custom-checkbox .icon {
    width: 24px;
    height: 24px;
    color: gray;
    transition: color 0.3s ease, transform 0.3s ease;
  }
  
  .custom-checkbox .label-text {
    margin-top: 4px;
    font-size: 14px;
    color: gray;
    transition: color 0.3s ease;
  }
  
  /* Checked State */
  .custom-checkbox input:checked + .content .icon {
    color: dodgerblue;
    transform: scale(1.2);
  }
  
  .custom-checkbox input:checked + .content .label-text {
    color: dodgerblue;
    font-weight: bold;
  }
  .filter-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: flex-start;
    margin-bottom: 1.5rem;
  }


  @media (max-width: 768px) {
    .tree-main {
        flex-direction: column;
        gap: 20px;
    }
    .tree-filters {
        width: 100%;
        margin-bottom: 20px;
    }
    .filter-container {
        padding: 15px;
        border: 2px solid #346732;
        border-radius: 20px;
        background-color: #3467322e;
    }
    .filter-container h4 {
        font-weight: 600;
        margin-bottom: 10px;
        color: #346732;
        font-size: 20px;
        margin-top: 15px;
    }
    #clear-filters {
        background-color: #346732;
        color: #fff;
        padding: 10px;
        border-radius: 20px;
        cursor: pointer;
        margin-top: 0px;
        border: none;
    }
    .species-card {
        border: 1px solid #ccc;
        margin-bottom: 20px;  
        padding: 0px;
        display: inline-block;
        width: 100%;
        vertical-align: top;
        margin-right: 0;
        border-radius: 20px;
        background-color: #fff;
        box-shadow: 0px 0px 10px #ccc;
        transition: all 0.3s ease;
    }
    .species-card:hover {
        transform: scale(1.05);
    }
    .species-card a {
        text-decoration: none;
        color: #346732;
    }
    .species-card a:hover {
        text-decoration: underline;
    }
    .species-card h3 {
        font-weight: 600;
        margin-bottom: 0px;
        color: #346732;
        font-size: 20px;
        margin-top: 0;
    }
    .species-card em {
        font-style: italic;
        font-size: 14px;
        color: #346732;
    }
    .species-card p {
        font-size: 14px;
        color: #346732;
    }
    .species-card img {
        width: 100%;
        height: auto;
        border-radius: 10px 10px 0px 0px;
        object-fit: cover;
        aspect-ratio: 1;
    }
    .species-card-content {
        padding: 15px;
    }
    .tags span {
        display: inline-block;
        margin-top: 5px;
        margin-right: 5px;
        background: #e2f0e2;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 12px;
    }
    .tree-top-menu {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        padding: 10px 0;
        gap: 10px;
        -webkit-overflow-scrolling: touch; /* For smooth iOS scrolling */
    }
    
    .tree-top-menu button {
        flex: 0 0 auto; /* Prevent buttons from shrinking */
    }
    
  }