* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f5f7f0;
    color: #2c2b28;
    line-height: 1.5;
    min-height: 100vh;
}

.hero {
    background: linear-gradient(135deg, #1a5f3a 0%, #2a8e55 100%);
    color: white;
    padding: 3rem 1.5rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.small-hero {
    padding: 1.5rem 1.5rem;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1rem;
    opacity: 0.9;
}

.nav-bar {
    background: white;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-link {
    color: #2e7d32;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
    background: #e8f5e9;
    color: #1b5e20;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-input-small {
    padding: 0.5rem 1rem;
    border: 1px solid #c8e6c9;
    border-radius: 30px;
    outline: none;
    width: 250px;
}

.search-btn {
    background: #2a8e55;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    cursor: pointer;
}

.page-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: #1b5e20;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

/* Сетка категорий */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.category-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.category-animals {
    background: linear-gradient(135deg, #fff8e1, #ffe0b2);
    border-bottom: 4px solid #ff9800;
}

.category-plants {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-bottom: 4px solid #4caf50;
}

.category-fungi {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    border-bottom: 4px solid #e91e63;
}

.category-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.category-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.category-animals .category-title { color: #e65100; }
.category-plants .category-title { color: #2e7d32; }
.category-fungi .category-title { color: #c2185b; }

.category-desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.category-stats {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

.category-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s;
}

.category-animals .category-btn {
    background: #ff9800;
    color: white;
}
.category-plants .category-btn {
    background: #4caf50;
    color: white;
}
.category-fungi .category-btn {
    background: #e91e63;
    color: white;
}

.category-card:hover .category-btn {
    transform: scale(1.05);
}

/* Случайные виды */
.random-section {
    margin-top: 2rem;
}

.refresh-btn {
    background: #e8f5e9;
    border: 1px solid #2e7d32;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    color: #2e7d32;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Карточки видов */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.species-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.species-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: white;
    padding: 1rem;
}

.card-header .species-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.card-header .scientific {
    font-size: 0.8rem;
    opacity: 0.9;
    font-style: italic;
}

.card-content {
    padding: 1rem;
}

.info-tag {
    display: inline-block;
    background: #e8f5e9;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #2e7d32;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.status-badge {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.description-preview {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.75rem;
    line-height: 1.4;
}

.card-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #eee;
    font-size: 0.75rem;
    color: #999;
    display: flex;
    justify-content: space-between;
}

/* Фильтры */
.filter-bar-simple {
    background: #e8f5e9;
    padding: 1rem;
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 0.3rem 1rem;
    border-radius: 60px;
}

.filter-group label {
    font-weight: 600;
    color: #2e5c3e;
}

select {
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    border: 1px solid #c8e6c9;
    background: white;
    cursor: pointer;
}

.stats-info {
    font-size: 0.85rem;
    color: #2e7d32;
    font-weight: 500;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #c8e6c9;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover, .page-btn.active {
    background: #2e7d32;
    color: white;
    border-color: #2e7d32;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 2rem auto;
    padding: 2rem;
    width: 90%;
    max-width: 900px;
    border-radius: 1rem;
    position: relative;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #333;
}

.species-full {
    max-height: 80vh;
    overflow-y: auto;
}

.species-full h1 {
    color: #1b5e20;
    margin-bottom: 0.5rem;
}

.species-full h3 {
    color: #2e7d32;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid #4caf50;
    padding-left: 0.75rem;
}

.species-full p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.species-full .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #666;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #2e7d32;
    font-size: 1.2rem;
}

footer {
    background: #1b5e20;
    color: #c8e6c9;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 1.6rem; }
    .nav-bar { flex-direction: column; align-items: stretch; }
    .search-input-small { width: 100%; }
    .categories-grid { grid-template-columns: 1fr; }
    .cards-container { grid-template-columns: 1fr; }
    .modal-content { width: 95%; margin: 1rem auto; padding: 1rem; }
}
/* Стили для страницы отдельного вида */
.species-detail-container {
    max-width: 1000px;
    margin: 0 auto;
}

.species-full-detail {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.detail-header {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    padding: 1.5rem;
    border-bottom: 1px solid #a5d6a7;
}

.category-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1rem;
}

.category-animals-badge {
    background: #ff9800;
    color: white;
}

.category-plants-badge {
    background: #4caf50;
    color: white;
}

.category-fungi-badge {
    background: #e91e63;
    color: white;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.meta-chip {
    background: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #2e7d32;
}

.status-chip {
    background: #fff3e0;
    color: #e65100;
}

.detail-section {
    padding: 1.5rem;
    border-bottom: 1px solid #e8f5e9;
}

.detail-section h2 {
    color: #1b5e20;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-left: 4px solid #4caf50;
    padding-left: 1rem;
}

.detail-content {
    color: #424242;
    line-height: 1.7;
    font-size: 1rem;
}

.detail-navigation {
    padding: 1.5rem;
    background: #f5f7f0;
}

.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.nav-species-btn {
    background: #2e7d32;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 40px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.nav-species-btn:hover:not(:disabled) {
    background: #1b5e20;
    transform: scale(1.02);
}

.nav-species-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.error-message {
    text-align: center;
    padding: 3rem;
    background: #ffebee;
    border-radius: 1rem;
    color: #c62828;
}

.error-message a {
    color: #2e7d32;
}
/* Стили для изображений видов */
.species-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
}

.species-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.species-card:hover .species-image img {
    transform: scale(1.05);
}

.species-image-fallback {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.detail-image-container {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    background: #f0f0f0;
}

.detail-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 1rem;
}

.detail-image-fallback {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
}

/* Стили для наблюдений iNaturalist */
.observations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.observation-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.observation-card:hover {
    transform: translateY(-3px);
}

.observation-photo {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.observation-no-photo {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #999;
}

.observation-info {
    padding: 0.75rem;
    font-size: 0.85rem;
}

.observation-user {
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 0.25rem;
}

.observation-date, .observation-place {
    color: #666;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.loading-observations, .no-observations {
    text-align: center;
    padding: 2rem;
    color: #666;
    background: #f5f5f5;
    border-radius: 0.75rem;
}

/* Адаптация под мобильные устройства */
@media (max-width: 768px) {
    .species-image, .species-image-fallback {
        height: 150px;
    }
    
    .observations-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-image-container {
        max-height: 250px;
    }
}
/* Стили для изображений */
.card-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.species-card:hover .card-image {
    transform: scale(1.05);
}

.detail-image-container {
    margin: 1rem 0;
    text-align: center;
}

.detail-image {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.image-error {
    font-size: 0.8rem;
    color: #999;
}
/* Стили для блока iNaturalist наблюдений */
.inat-section {
    background: linear-gradient(135deg, #f5f9f0, #e8f5e9);
    border-radius: 1rem;
    margin-top: 1rem;
}

.inat-container {
    margin-top: 1rem;
}

.inat-observations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.inat-observation-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.inat-observation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.inat-obs-image {
    height: 160px;
    overflow: hidden;
    background: #f0f0f0;
}

.inat-obs-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.inat-observation-card:hover .inat-obs-image img {
    transform: scale(1.05);
}

.inat-obs-image-placeholder {
    height: 160px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #2e7d32;
}

.inat-obs-content {
    padding: 0.75rem;
}

.inat-obs-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.inat-obs-user {
    font-size: 0.85rem;
    font-weight: 500;
    color: #2e7d32;
    margin-bottom: 0.5rem;
}

.inat-obs-quality {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.quality-research {
    background: #e8f5e9;
    color: #2e7d32;
}

.quality-casual {
    background: #fff3e0;
    color: #e65100;
}

.inat-obs-link {
    font-size: 0.75rem;
    color: #2196f3;
    text-decoration: none;
    display: inline-block;
}

.inat-obs-link:hover {
    text-decoration: underline;
}

.inat-loading {
    text-align: center;
    padding: 2rem;
    color: #2e7d32;
}

.inat-info {
    text-align: center;
    padding: 2rem;
    background: #f5f5f5;
    border-radius: 0.75rem;
    color: #666;
}

.inat-project-link {
    text-align: center;
    margin-top: 1rem;
}

.inat-project-btn {
    display: inline-block;
    background: #67a000;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.inat-project-btn:hover {
    background: #4c7a00;
}

@media (max-width: 768px) {
    .inat-observations-grid {
        grid-template-columns: 1fr;
    }
}