/* styles.css - Общие стили для всего проекта */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: #f4f7f2;
    color: #1e3a2f;
    line-height: 1.5;
}

/* Шапка */
header {
    background: linear-gradient(135deg, #2d5e4f 0%, #1e3a2f 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0 0 15px 0;
    font-size: 2.2rem;
    font-weight: 500;
}

/* Контейнер */
.container {
    max-width: 1300px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Навигация */
.nav-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    background: rgba(255,255,255,0.15);
    padding: 10px 20px;
    border-radius: 30px;
    transition: 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
}

.nav-links a:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Заголовки */
h2 {
    border-bottom: 3px solid #7bbf9a;
    padding-bottom: 12px;
    display: inline-block;
    margin-bottom: 25px;
}

h3 {
    color: #2d5e4f;
    margin: 20px 0 15px 0;
}

h4 {
    color: #3a5e4f;
    margin: 15px 0 10px 0;
}

/* Фильтры */
.filters-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    border: 1px solid #d0e2d4;
}

.filters-title {
    font-weight: bold;
    margin-bottom: 15px;
    color: #2d5e4f;
    font-size: 1.2rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a6659;
    margin-bottom: 5px;
}

.filter-select, .filter-input {
    padding: 12px 15px;
    border: 2px solid #d0e2d4;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: 0.2s;
    font-family: inherit;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: #7bbf9a;
    box-shadow: 0 0 0 3px rgba(123, 191, 154, 0.2);
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.95rem;
    background: #e9f3ee;
    color: #1e3a2f;
    border: 1px solid #b9d5c7;
    font-family: inherit;
    display: inline-block;
}

.btn-primary {
    background: #2d5e4f;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #3a7a66;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 94, 79, 0.3);
}

.btn:hover {
    background: #cde6db;
    transform: translateY(-1px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.refresh-btn {
    background: white;
    border: 2px solid #2d5e4f;
    color: #2d5e4f;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    font-size: 1rem;
}

.refresh-btn:hover {
    background: #2d5e4f;
    color: white;
}

/* Карточки */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: all 0.3s;
    border: 1px solid #d0e2d4;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px rgba(0,0,0,0.1);
}

.card-img {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #2d5e4f;
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card-badge.federal { background: #8b1e3f; }
.card-badge.regional { background: #3a7ca5; }
.card-badge.local { background: #6b4e71; }
.card-badge.plants { background: #4caf50; }
.card-badge.animals { background: #2196f3; }
.card-badge.fungi { background: #FF00FF; }

.card-content {
    padding: 22px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    margin: 0 0 12px 0;
    color: #1e3a2f;
    font-size: 1.2rem;
    line-height: 1.3;
}

.card-meta {
    color: #5f7e70;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.card-meta p {
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-description {
    color: #4a6659;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    font-size: 0.95rem;
}

.card-footer {
    margin-top: auto;
}

.card .btn {
    display: block;
    text-align: center;
    margin-top: 10px;
}

/* Секции на главной */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.section-header h2 {
    margin-bottom: 0;
}

.section-controls {
    display: flex;
    gap: 10px;
}

/* Статистика */
.results-info {
    margin-bottom: 20px;
    padding: 10px 0;
    color: #5f7e70;
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 20px;
    color: #5f7e70;
}

/* Детальная карточка ООПТ */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #2d5e4f;
    text-decoration: none;
    font-weight: bold;
    background: #e9f3ee;
    padding: 10px 20px;
    border-radius: 30px;
    transition: 0.2s;
}

.back-link:hover {
    background: #cde6db;
    transform: translateX(-3px);
}

.card-detail {
    background: white;
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
    border: 1px solid #d0e2d4;
}

.detail-img.large {
    width: 100%;
    height: 300px;
    border-radius: 16px;
    margin-bottom: 25px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.photo-item {
    height: 150px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: 0.2s;
    border: 2px solid transparent;
}

.photo-item:hover {
    transform: scale(1.05);
    border-color: #7bbf9a;
}

.detail-title h1 {
    margin: 0 0 10px 0;
    font-size: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
    background: #f8fbf9;
    padding: 25px;
    border-radius: 20px;
}

.info-item {
    border-bottom: 1px dashed #b9d5c7;
    padding-bottom: 12px;
}

.info-item-full {
    grid-column: 1 / -1;
    border-bottom: 1px dashed #b9d5c7;
    padding-bottom: 12px;
}

.info-label {
    font-weight: bold;
    color: #4f6b5e;
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.description-full {
    line-height: 1.8;
    font-size: 1.05rem;
    margin-top: 25px;
}

/* Секция видов */
.species-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 25px;
}

.species-box {
    padding: 20px;
    border-radius: 16px;
}

.species-box.plants {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 4px solid #4caf50;
}

.species-box.animals {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #2196f3;
}

.species-box h4 {
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.species-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.species-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.species-list li:last-child {
    border-bottom: none;
}

.species-link {
    color: #1e3a2f;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.species-link:hover {
    color: #2d5e4f;
    padding-left: 5px;
}

.species-icon {
    font-size: 1.2rem;
}

/* Карточка вида */
.species-detail {
    background: white;
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.05);
    border: 1px solid #d0e2d4;
}

.species-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.species-photo {
    width: 100%;
    height: 300px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    border: 4px solid #7bbf9a;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.species-info h1 {
    margin: 0 0 10px 0;
    font-size: 2.2rem;
    color: #1e3a2f;
}

.species-latin {
    font-style: italic;
    color: #5f7e70;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.species-status {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: bold;
    margin-bottom: 20px;
}

.status-red {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.status-yellow {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}

.species-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
    background: #f8fbf9;
    padding: 25px;
    border-radius: 20px;
}

.species-description {
    line-height: 1.8;
    font-size: 1.05rem;
    margin: 25px 0;
}

.species-habitats {
    margin: 25px 0;
}

.habitat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.habitat-tag {
    background: #e9f3ee;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
}

.species-threats {
    margin: 25px 0;
    padding: 20px;
    background: #fff3e0;
    border-radius: 16px;
    border-left: 4px solid #ff9800;
}

/* Список (all.html, species-list.html) */
.list-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.list-item {
    padding: 15px 25px;
    border-bottom: 1px solid #e0ede5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
    gap: 20px;
}

.list-item:hover {
    background: #f8fbf9;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.list-item-info {
    flex-grow: 1;
}

.list-item-info h3 {
    margin: 0 0 5px 0;
    color: #1e3a2f;
    font-size: 1.2rem;
}

.list-item-meta {
    color: #5f7e70;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.list-item-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Подвал */
footer {
    margin-top: 60px;
    text-align: center;
    padding: 25px;
    color: #5f7e70;
    border-top: 1px solid #d0e2d4;
}

/* Адаптивность */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .detail-img.large {
        height: 200px;
    }
    
    .species-header {
        grid-template-columns: 1fr;
    }
    
    .list-item {
        flex-direction: column;
        text-align: center;
    }
    
    .list-item-actions {
        justify-content: center;
    }
    
    .species-section {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Утилиты */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

.species-box.fungi {
    background: linear-gradient(135deg, #efebe9 0%, #d7ccc8 100%);
    border-left: 4px solid #8d6e63;
}