:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #e67e22;
    --bg-color: #f4f6f7;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-light: #7f8c8d;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.search-container {
    margin-top: 20px;
}

#search {
    padding: 12px 20px;
    width: 100%;
    max-width: 500px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s;
    outline: none;
}

#search:focus {
    border-color: var(--primary-color);
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

/* Card Style */
.card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

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

.card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background-color: #f8f9fa;
}

.card-body {
    padding: 15px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* Detail Page */
.detail-header {
    background-color: transparent;
    padding: 10px 0;
    margin-bottom: 10px;
}

.back-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
}

.detail-container {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    max-width: 800px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.species-image-container {
    position: relative;
    margin-bottom: 20px;
}

.species-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    border-radius: 8px;
    object-fit: contain;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.image-credit {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.species-name {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.scientific-name {
    font-size: 1.2rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 20px;
    display: block;
}

.section-title {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.section-content {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

/* Audio Player */
.audio-player {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #eee;
}

.audio-info {
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.audio-controls {
    width: 100%;
}

audio {
    width: 100%;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.status-badge.native {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.status-badge.alien {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffe0b2;
}

/* Audio Container (iframe) */
.audio-container {
    margin-bottom: 20px;
}
.audio-container iframe {
    width: 100%;
    max-width: 400px;
    border: 1px solid #eee;
    border-radius: 8px;
}

/* Video Button */
.btn-video {
    display: inline-block;
    background-color: #ff0000;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;
}
.btn-video:hover {
    background-color: #cc0000;
}
