/* Animals Page Styles - Scientific Database Layout */

/* Banner Section */
.animals-banner {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.banner-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Main Layout */
.animals-main {
    min-height: calc(100vh - 320px);
    padding: 2rem 0;
    background: #f8f9fa;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.page-header h1 {
    color: #00773f;
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 0 1rem 0;
    letter-spacing: 1px;
}

.page-header p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.section-header h2 {
    color: #00773f;
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    padding: 1rem 0;
    background: linear-gradient(135deg, #f0f8f5 0%, #e6f4ea 100%);
    border-radius: 12px;
    border: 2px solid #d4eedd;
}

/* Animals Database Section */
.animals-database-section,
.functional-components-section {
    margin-bottom: 4rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,119,63,0.08);
    border: 1px solid #e6f4ea;
}

/* Animals Grid */
.animals-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

/* Animal Card */
.animal-card {
    background: white;
    border: 2px solid #e6f4ea;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,119,63,0.08);
    text-decoration: none;
    color: inherit;
    display: block;
}

.animal-card:hover {
    transform: translateY(-5px);
    border-color: #00773f;
    box-shadow: 0 8px 30px rgba(0,119,63,0.15);
}

.animal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00773f, #28a745);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.animal-card:hover::before {
    transform: scaleX(1);
}

/* Animal Image */
.animal-image {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.animal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.3s ease;
    display: block;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
}

.animal-card:hover .animal-image img {
    transform: scale(1.05);
}

/* Animal Info */
.animal-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    text-align: center;
}

.animal-info h3 {
    color: #00773f;
    font-size: 1rem;
    font-weight: bold;
    margin: 0;
    font-style: italic;
    text-decoration: none;
}

.common-name {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
    font-weight: 500;
}

.animal-stats {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-item {
    background: #f0f8f5;
    color: #333;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    border: 1px solid #d4eedd;
    text-align: center;
}


/* Detailed Information Section */
.detailed-info-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,119,63,0.08);
    border: 2px solid #e6f4ea;
    position: relative;
}

.detailed-info-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-detail-btn {
    background: #dc3545;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-detail-btn:hover {
    background: #c82333;
}

.detail-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.detail-image {
    width: 100%;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid #e6f4ea;
}

.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.detail-info h3 {
    color: #00773f;
    font-size: 2rem;
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    font-style: italic;
}

.detail-info > p {
    color: #666;
    font-size: 1.2rem;
    margin: 0 0 2rem 0;
    font-weight: 500;
}

/* Detail Tabs */
.detail-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    border-color: #00773f;
    color: #00773f;
}

.tab-btn.active {
    background: #00773f;
    color: white;
    border-color: #00773f;
}

/* Tab Content */
.tab-content {
    min-height: 300px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #e6f4ea;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item label {
    color: #00773f;
    font-weight: bold;
    font-size: 0.9rem;
}

.info-item span {
    color: #333;
    font-size: 1rem;
    line-height: 1.4;
}

/* Active Navigation Link */
.nav-links a.active {
    background-color: rgba(255,255,255,0.2);
    color: white;
}

/* Loading States */
.animals-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.animals-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00773f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animal-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .animals-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
    
    .detail-content {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .animals-banner {
        height: 180px;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .animals-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }
    
    
    .detail-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .detail-image {
        height: 250px;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .animals-banner {
        height: 150px;
    }
    
    .animals-main {
        padding: 1rem 0;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .animals-database-section,
    .functional-components-section,
    .detailed-info-section {
        margin-bottom: 2rem;
        padding: 1.5rem;
    }
    
    .animals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .animal-card {
        border-radius: 12px;
    }
    
    .animal-image {
        height: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .animal-info {
        padding: 1rem;
    }
    
    .animal-info h3 {
        font-size: 1.2rem;
    }
    
    
    .detail-tabs {
        justify-content: center;
    }
    
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .detailed-info-section .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 1rem 0;
        margin-bottom: 2rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    .section-header h2 {
        font-size: 1.4rem;
        padding: 0.8rem;
    }
    
    .animals-database-section,
    .functional-components-section,
    .detailed-info-section {
        padding: 1rem;
        border-radius: 10px;
    }
    
    .animals-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .animal-image {
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .animal-info h3 {
        font-size: 1.1rem;
    }
    
    .common-name {
        font-size: 0.9rem;
    }
    
    .stat-item {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    
    .detail-info h3 {
        font-size: 1.6rem;
    }
    
    .detail-info > p {
        font-size: 1rem;
    }
    
    .tab-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .info-item {
        padding: 0.8rem;
    }
    
    .info-item label {
        font-size: 0.85rem;
    }
    
    .info-item span {
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .animals-banner,
    .close-detail-btn {
        display: none;
    }
    
    .animals-main {
        padding: 0;
    }
    
    .animals-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .animal-card {
        break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .detailed-info-section {
        page-break-before: always;
    }
    
    .tab-content {
        display: block !important;
    }
    
    .tab-panel {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }
}

/* Focus States for Accessibility */
.animal-card:focus,
.search-btn:focus,
.filter-select:focus,
.reset-btn:focus,
.tab-btn:focus,
.close-detail-btn:focus {
    outline: 2px solid #00773f;
    outline-offset: 2px;
}

/* Hover Effects Enhancement */

.info-item:hover {
    background: #f0f8f5;
    border-color: #d4eedd;
}