h2 {
	text-align: center;
}

.species-header-box {
    width: 90%;
    max-width: 1600px;
    margin: 20px auto;
	margin-top: 0;
	margin-bottom: 30px;
    padding: 15px;
    border-radius: 10px;
    box-sizing: border-box;

    height: 140px;            
    display: flex;
    flex-direction: column;
    justify-content: center;    
	text-align: center;
}

.species-title,
.family-title {
    text-align: center;
	margin-bottom: 10px;
	margin-top: 0;
    font-size: 2.5rem;
    letter-spacing: 1px;
	color: white;	
}

.species-title {
    font-style: italic;
}

.species-subtitle {
    font-size: 1.5rem;
    color:  white;
	margin-top: 5px;
	margin-bottom: 10px;
	text-align: center;
}

.info-box {
    width: 90%;  
    max-width: 1600px;   
    margin: 20px auto 20px;  
    padding: 15px;
    background: #B3D6E3;
    border-radius: 10px;
    box-sizing: border-box;

    font-size: 1.3rem;
    color: #1e3a8a;
    font-weight: 500;
	
    display: flex; 
    justify-content: space-between;
    align-items: center; 
    position: relative;
    flex-wrap: wrap;     
    gap: 15px;           
}

.breadcrumb a {
    color: #1e3a8a;
    text-decoration: none;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-left: 12px;
}

.breadcrumb a:hover {
    color: #1e3a8a;
}

span.breadcrumb {
  display: inline-block;
  margin: 0 8px;
}

.search-container {
    width: 500px;
    flex-shrink: 0;
    max-width: 100%;
    position: relative;
    
    height: 40px;
    box-sizing: border-box; 
    display: flex;
    align-items: center; 
    background: white;
    border-radius: 10px;
    padding: 0 16px 0 20px;
    margin-left: 20px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-left: 12px;
    flex-shrink: 1;
    min-width: 0;
}

.search-container input {
    flex: 1;

    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #1e3a8a;

    font-size: 18px;
    font-weight: 300;
}

.search-container input::placeholder {
    color: #1e3a8a;
    opacity: 1;  
}

.search-container .search-icon {
    flex-shrink: 0;
    color: #1e3a8a;
    font-size: 1.875rem;
    line-height: 1;
    margin-left: 12px;
}


@media (max-width: 700px) {
    .search-container {
        width: 100%;
        margin-left: 0;
    }
}

.map-box {
    width: 90%;
    max-width: 1600px;
    margin: 0 auto;
}

.species-map-box {
    width: 100%;
    height: 80vh;
    min-height: 550px;
    max-height: 1000px;
}

.species-map {
    flex: 1;
    display: flex;
    align-items: stretch;
    height: 100%;
}

#species-map {
    width: 100%;
    height: 100%;
    border-radius: 10px;

    overflow: hidden;
}

.list-wrapper {
    width: 90%;
    max-width: 1600px;
    margin: 20px auto;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 1.25rem;
    font-weight: 400;
	text-align: center;
    align-items: start;
}

.list-tab-panel {
    display: none;
}

.list-tab-panel.active {
    display: block;
}

.list-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 900px) {
    .list-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .list-gallery {
        grid-template-columns: 1fr;
    }
}

.list-item a:hover img {
    transform: translateY(-3px);
}
.list-item-header {
    border: none !important;
}
.list-of-genera-tabs .list-tab-btn {
    cursor: default;
}
.list-of-genera-tabs .list-tab-btn:hover {
    background: inherit;
}
.is-static-tab {
    pointer-events: none;
}

.tab-count {
    white-space: nowrap;
    margin-left: 4px;
}

.list-of-genera-tabs,
.species-tabs {
    width: 90%;
    max-width: 1600px;
    margin: 40px auto 20px;
    padding: 12px;

    background: #B3D6E3;
    border-radius: 10px;
    box-sizing: border-box;

    display: flex;
    gap: 10px;

    font-size: 1.25rem;
    color: white;

    flex-wrap: wrap;
}

.species-tabs button,
.list-of-genera-tabs button {
    all: unset;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 1 1 180px; 
    min-width: 140px;

    padding: 10px 14px;

    background: white;
    color: #1e3a8a;

    font-weight: 500;
    text-align: center;

    border-radius: 12px;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.species-tabs button.active,
.list-of-genera-tabs button.active {
    background: #1e3a8a;
    color: white;
    pointer-events: none;
}

.species-tabs button:not(.active):hover,
.list-of-genera-tabs button:not(.active):hover {
    background: white;
    color: #1e3a8a;

    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.tab-panel,
.list-tab-panel {
    display: none;
}

.tab-panel.active,
.list-tab-panel.active {
    display: block;
}

.header-home-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.species-top-box {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
}

.species-description {
    grid-column: 1;
    grid-row: 1;

    width: 80%;
    box-sizing: border-box;

    text-align: left;
}

.species-map {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.species-top-box,
.similar-species-box,
.species-images-box {
    width: 90%;
    max-width: 1600px;
    margin: 20px auto;
    border-radius: 10px;
    box-sizing: border-box;

    font-size: 1.25rem;
    color: #1e3a8a;
    font-weight: 400;
}

#tab-gallery,
#tab-similar,
#tab-references {
    background: transparent;
}

#tab-morphology {
    background: #edf3f5;
    border-radius: 10px;
}

.species-top-box {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
	margin-top: 10px;
    padding: 25px;
    align-items: stretch;
    background: #edf3f5;
}

.species-description h2 {
    margin-top: 0;
    text-align: left;
}

.species-description h3 {
    margin-top: 16px;
    margin-bottom: 6px;
    font-size: 1.25rem;
    color: #1e3a8a;
}

.species-description p {
    margin: 0;
    line-height: 1.8;
	text-align: left;
	margin-bottom: 27px;
    font-weight: 450;
}

.species-map {
    flex: 1 1 350px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.species-map img {
    width: 100%;
    max-width: 420px;
    border-radius: 10px;
    transition: 0.25s ease;
}

.species-map:hover img {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.species-description {
    flex: 2;
}

.species-map {
    flex: 2;
    display: flex;
}

.species-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .species-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .species-gallery {
        grid-template-columns: 1fr;
    }
}

.species-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

.species-gallery .image-box {
    background: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    display: block;
}

.species-gallery .image-box > a {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
}

.species-gallery .image-box > a img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 600px;
    margin: 0 auto;
    border-radius: 30px;
    box-shadow: 8px 10px 20px rgba(0, 0, 0, 0.45);
    object-fit: contain;
}

.species-gallery .image-box:hover img {
    transform: translateY(-3px);
}

.list-item {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-sizing: border-box;
    border-radius: 10px;
}

.list-item-header {
    background: rgba(12, 76, 90, 0.5);
    border-radius: 0 0 10px 10px;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.list-item-header > a {
    color: #1e3a8a;
    text-decoration: none;
}

.common-name {
    margin-top: 4px;
    color: #1e3a8a;
    font-size: 1.125rem;
    font-weight: 400;
}

.list-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease;
}

.list-wrapper .image-box {
    background: #edf3f5;
    box-shadow: 8px 10px 20px rgba(0, 0, 0, 0.45);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.list-wrapper .image-box > a {
    display: block;
    width: 100%;
    height: 300px;
    flex-shrink: 0;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.list-wrapper .image-box > a img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
    object-position: center;
}

.list-wrapper .image-box .list-item-header {
    background: #edf3f5;
    border-radius: 0 0 10px 10px;
    margin: 0;
    flex: 1;
}

.list-wrapper {
    align-items: start;
}

.list-wrapper .image-box:not(:has(> a)) {
    height: auto;
    min-height: 0;
}

.list-wrapper .image-box:not(:has(> a)) .list-item-header {
    min-height: 0;
    flex: 0 1 auto;
}

.similar-species {
    background: #edf3f5;
    box-shadow: 8px 10px 20px rgba(0, 0, 0, 0.45);
    border-radius: 10px;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    gap: 0;
}

.similar-header {
    background: none;
    border-radius: 0;
    padding: 15px;
    margin: 0;
    color: #1e3a8a;
    text-align: center;
    font-weight: 500;
    flex-shrink: 0;
}

.similar-header a,
.similar-header p {
    color: #1e3a8a;
    font-size: 1.375rem;
    font-weight: 400;
}

.similar-header p {
    display: inline;
    margin: 0;
}

.similar-species > a {
    display: block;
    width: 100%;
    height: 250px;
    flex-shrink: 0;
    border-radius: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.similar-species > a img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0 !important;
    box-shadow: none;
    object-fit: cover;
    object-position: center;
}

.similar-diff {
    width: 100%;
    box-sizing: border-box;
    border-radius: 0 0 10px 10px;
    margin: 0;
    padding: 12px 15px;

    font-size: 1.25rem;
    text-align: center;
    font-weight: 350;
}

.similar-diff p {
    color: #1e3a8a;
    margin: 0;
}

.similar-species:last-of-type::after {
    display: none;
}

.species-morphology {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto; 
}

.species-morphology h2 {
    margin-top: 10px;
    margin-bottom: 6px;
    font-size: 1.375rem;
    color: #1e3a8a;
    text-align: left;
}

.species-morphology ul {
    margin: 0 0 1rem 1.5rem;
    padding: 0;
}

.species-morphology li {
    margin: 0;
    line-height: 1.6;
	text-align: left;
	margin-bottom: 8px;
}

.morphology-label {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 500;
    color: #1e3a8a;
}

.morphology-section {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 10px;
    padding: 5px 18px;
    border-radius: 10px;
    box-sizing: border-box;

    overflow-wrap: break-word;
    word-break: break-word;
}

.species-references {
    width: 100%;
    margin: 0 auto; 
}

.reference-item {
    background: #edf3f5;
    color: #1e3a8a;
    font-weight: 400;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 10px;
    padding: 18px 18px;
    border-radius: 10px;
    box-sizing: border-box;

    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    box-shadow: 8px 10px 20px rgba(0, 0, 0, 0.45);
}

.reference-item a {
    color: #1e3a8a;
    font-weight: 600;
    text-decoration: underline;
    margin-top: 10px;
}

.references-empty {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background: #edf3f5;
    box-shadow: 8px 10px 20px rgba(0, 0, 0, 0.45);
}

.morphology-empty {
    text-align: center;
    padding: 4px;
}

.species-map {
    position: relative;
}

.leaflet-top, 
.leaflet-bottom {
    z-index: 500; 
}

.map-fullscreen-btn {
    opacity: 0;
    pointer-events: none;

    position: absolute;
    top: 10px;
    right: 10px;

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 4px;

    cursor: pointer;
    z-index: 999;

    color: black;
    transition: all 0.2s;
    padding: 0;
}

.map-fullscreen-btn.ready {
    opacity: 1;
    pointer-events: auto;
}

.map-fullscreen-btn:hover {
    transform: translateY(-2px);
}

.map-fullscreen-btn .material-symbols-outlined {
    font-size: 1.375rem;
    user-select: none;
}

.map-fullscreen-btn:hover .material-symbols-outlined {
    color: #7bbbe3;
}

.species-map.map-expanded {
    position: fixed;

    top: var(--header-height, 80px);
    left: 10px;
    right: 10px;
    bottom: 20px;

    z-index: 9000;

    background: #1e3a8a;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.4);
}

.species-map.map-expanded .map-frame {
    position: absolute;

    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;

    border-radius: 8px;
    overflow: hidden;
}

.species-map.map-expanded #species-map {
    width: 100%;
    height: 100% !important;
}

body.map-fullscreen-active {
    overflow: hidden;
}

.species-meta-row {
    width: 90%;
    max-width: 1600px;

    margin: 0 auto;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
}

.species-validity {
    color: white;

    font-size: 1.125rem;
    font-weight: 600;
}

.badges-box {
    padding: 10px 14px;
    border-radius: 10px;
    box-sizing: border-box;
}

.species-badges {
    display: flex;
    flex-wrap: wrap;

    justify-content: flex-start;
    align-items: center;

    gap: 10px;

    color: white;
    font-size: 1.25rem;     
    font-weight: 400; 
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 6px 10px;
    border-radius: 8px;

    color: white;

    font-size: 1.125rem;
    font-weight: 400;
}

.badge-icon {
    height: 22px;
    display: inline-block;
    pointer-events: none;

}

.iucn-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin-left: auto;
}

.iucn-icon img {
    height: 40px;
    display: block;
    pointer-events: none;
}

.species-top-box {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: auto auto;
    gap: 20px;
    margin-top: 10px;
    align-items: stretch;
}

.species-description {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.species-map {
    grid-column: 2;
    grid-row: 1;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.report-issue-btn {
    grid-column: 2;
    grid-row: 2;

    align-self: end;
    justify-self: end;

    padding: 10px 15px;

    background: white;
    color: #1e3a8a;

    border: none;
    border-radius: 30px;

    cursor: pointer;

    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;

    transition: 0.2s ease;
}

.report-issue-btn:hover {
    transform: translateY(-3px);
}

.report-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.report-modal.open {
    visibility: visible;
    opacity: 1;
}

.report-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); 
}

.report-modal-content {
    position: relative;
    width: min(600px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 30px;
    background: #edf3f5;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    z-index: 1;
    color: #1e3a8a;
    font-size: 1.125rem;
}

.report-modal-content h2 {
    margin: 0 45px 25px 0;

    color: #1e3a8a;
    font-size: 1.625rem;
    font-weight: 600;
}

.report-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: white;
    color: #1e3a8a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
}

.report-modal-close:hover {
    color: #1e3a8a;
}

.report-field {
    margin-bottom: 20px;
}

.report-field label {
    display: block;
    margin-bottom: 7px;
    color: #1e3a8a;
    font-size: 1rem;
    font-weight: 700;
}

.report-field .optional {
    font-size: 0.875rem;
    font-style: italic;
    font-weight: 400;
}

.report-field input,
.report-field select,
.report-field textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    background: white;
    color: #1e3a8a;
    border: 0px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.report-field input:focus,
.report-field select:focus,
.report-field textarea:focus {
    outline: none;
}

.report-readonly-value {
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    background: white;
    color: #1e3a8a;
    border: 0px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: default;
    user-select: none;
}

.report-help {
    margin: -2px 0 8px;
    color: #1e3a8a;
    font-size: 1rem;
    line-height: 1.4;
}

.report-field textarea {
    min-height: 100px;
    resize: none;
}

.report-submit-btn {
    width: 100%;
    padding: 12px 20px;
    background: white;
    color: #1e3a8a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: 0.2s ease;
}

.report-submit-btn:hover {
    color: #1e3a8a;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.report-submit-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.report-success {
    padding: 25px 10px 10px;
    color: #1e3a8a;
    text-align: center;
}

.report-success h3 {
    margin: 15px 0 8px;
    color: #1e3a8a;
    font-size: 1.25rem;
}
.report-success button {
    padding: 10px 20px;
    background: white;
    color: #1e3a8a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.report-success button:hover {
    color: #1e3a8a;
    transform: translateY(-2px);
}

body.report-modal-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .report-modal {
        padding: 10px;
    }
    .report-modal-content {
        max-height: calc(100vh - 20px);
        padding: 22px;

        font-size: 1rem;
    }
    .report-modal-content h2 {
        font-size: 1.5rem;
    }
    .report-field label {
        font-size: 1rem;
    }
    .report-field input,
    .report-field select,
    .report-field textarea,
    .report-readonly-value {
        font-size: 1rem;
    }
    .report-issue-btn {
        right: 10px;
        bottom: 10px;
        padding: 8px 11px;
        font-size: 0.875rem;
    }
}

#report-issue-btn {
    position: relative;
    z-index: 1000;
}

