/* SPECIES PAGE CSS */
.species-page {
    padding: 60px 0;
    font-family: 'Comfortaa', sans-serif;
    background-color: #fff9f0;
    /* Subtle warm background */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Wood Banner */
.species-header {
    text-align: center;
    margin-bottom: 50px;
}

.wood-banner-title {
    font-family: 'Poetsen One', sans-serif;
    font-size: 2.2rem;
    color: #fff;
    padding: 30px 60px;
    background-image: url('../images/wood_banner_texture.png');
    /* To be replaced with real path */
    background-size: cover;
    background-position: center;
    display: inline-block;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    line-height: 1.2;
}

/* Filters UI */
.filters-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-group {
    position: relative;
    z-index: 1001;
    /* Above the grid and other content */
}

.filter-pill {
    background: #fff;
    border: 1px solid #e0d5c8;
    border-radius: 40px;
    padding: 10px 25px;
    font-size: 1.1rem;
    font-family: 'Comfortaa', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    color: #555;
}

.protected-pill {
    cursor: default;
    gap: 15px;
}

.filter-pill:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    border-color: #8d755b;
}

.arrow-down::after {
    content: '▼';
    font-size: 0.7rem;
    color: #8d755b;
    margin-left: 5px;
}

/* Dropdown */
.filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    min-width: 220px;
    overflow: hidden;
}

.filter-dropdown.active {
    display: block;
}

.filter-dropdown a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #555;
    transition: background 0.2s;
    font-size: 1rem;
}

.filter-dropdown a:hover {
    background: #fdf6ee;
    color: #8d755b;
}

.filter-dropdown a.active {
    background: #8d755b;
    color: #fff;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #f38d35;
    /* Orange in mockup */
}

input:checked+.slider:before {
    transform: translateX(30px);
}

/* Species Grid */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.species-card {
    background: #d4bda8;
    /* Card background color from mockup */
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.1);
    /* Subtle offset shadow */
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.species-card:hover {
    transform: translateY(-5px);
}

.card-image {
    position: relative;
    height: 200px;
    background: #eee;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.protected-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.star-icon {
    color: #f3c235;
}

.status-dot {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.dot-red {
    background: #ff3b30;
}

.dot-green {
    background: #4cd964;
}

.dot-blue {
    background: #007aff;
}

.dot-orange {
    background: #ff9500;
}

.card-content {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
}

.species-name {
    font-family: 'Poetsen One', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #333;
}

.species-category {
    font-size: 1rem;
    color: #666;
    margin-bottom: 15px;
}

.card-footer {
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.view-details-btn {
    background: none;
    border: none;
    cursor: pointer;
}

.circle-icon {
    display: block;
    width: 25px;
    height: 25px;
    border: 2px solid #555;
    border-radius: 50%;
    position: relative;
}

.circle-icon::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: #555;
}

/* Modal */
.species-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.species-modal-overlay.active {
    display: flex;
}

.species-modal-container {
    background: #fff;
    width: 100%;
    max-width: 850px;
    border-radius: 20px;
    padding: 30px;
    position: relative;
    max-height: 95vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #e67e22;
    font-family: 'Comfortaa', sans-serif;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-icon {
    background: #f38d35;
    color: #fff;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
}

.modal-title-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.modal-name {
    font-family: 'Poetsen One', sans-serif;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: #8d755b;
    margin: 0;
}

.modal-category-badge {
    background: #a9c69f;
    color: #fff;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.modal-content-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
}

.desc-header-wood,
.etat-header-wood {
    background: #8d755b; /* Fallback */
    background-image: url('../images/wood_header_texture_small.png');
    background-size: cover;
    color: #fff;
    font-family: 'Poetsen One', sans-serif;
    padding: 8px 20px;
    display: inline-block;
    margin-bottom: 15px;
    min-width: 150px;
    border-radius: 5px;
}

.modal-description-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 40px;
    color: #333;
}

.etat-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.modal-status-text {
    font-size: 1.1rem;
    font-weight: bold;
    color: #555;
}

.modal-image-col img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.modal-footer {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.map-link-btn {
    background: #a9c69f;
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
}

.map-link-btn:hover {
    background: #90b084;
}

/* Animations from home template */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal-on-scroll.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .species-page {
        padding: 30px 0;
    }

    .wood-banner-title {
        font-size: 1.4rem;
        padding: 20px 30px;
    }

    .modal-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
    }

    .species-modal-container {
        padding: 20px;
        margin: 10px;
    }

    .modal-content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modal-image-col {
        order: -1;
    }

    .modal-image-col img {
        max-height: 250px;
        object-fit: cover;
    }

    .desc-header-wood,
    .etat-header-wood {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    .etat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .modal-description-text {
        margin-bottom: 20px;
    }

    .modal-footer {
        margin-top: 30px;
    }

    .map-link-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
        padding: 12px 20px;
    }
}