:root {
    --primary-color: #2d6a4f;
    --primary-dark: #1b4332;
    --primary-light: #40916c;
    --secondary-color: #e9c46a;
    --accent-color: #e76f51;
    --dark-bg: #1a1a2e;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

body.dark-mode .search-card,
body.dark-mode .results-section,
body.dark-mode .species-card,
body.dark-mode .citation-card {
    background: #2d2d44;
    border-color: #3d3d5c;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .scientific-name {
    color: #a0d6b3;
}

body.dark-mode .family-tag,
body.dark-mode .genus-tag,
body.dark-mode .habit-tag {
    background: #3d3d5c;
    color: #b0b0d0;
}

body.dark-mode .reference-info {
    color: #a0a0c0;
}

body.dark-mode .filter-select,
body.dark-mode .search-input,
body.dark-mode .search-type {
    background: #3d3d5c;
    border-color: #4d4d6c;
    color: #e0e0e0;
}

body.dark-mode .filter-select:focus,
body.dark-mode .search-input:focus {
    border-color: var(--primary-light);
}

body.dark-mode .hero-section {
    background: linear-gradient(135deg, #1b4332, #0d2818);
}

body.dark-mode .footer {
    background: #0f0f1a;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 90px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: var(--dark-bg);
    border: none;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    display: none;
}

.back-to-top:hover {
    transform: translateY(-3px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 60px 20px 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.05)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z"></path></svg>') repeat-x bottom;
    opacity: 0.3;
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.875rem;
    margin-bottom: 24px;
    font-weight: 500;
}

.hero-badge i {
    margin-right: 8px;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 800px;
    margin: 0 auto 32px;
}

.highlight {
    color: var(--secondary-color);
    font-weight: 700;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
}

.stat i {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.85;
}

.keyboard-shortcut-hint {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 10px;
}

.keyboard-shortcut-hint kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    line-height: 0;
}

/* Container */
.container {
    max-width: 1400px;
    margin: -40px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 3;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

body.dark-mode .loading-overlay {
    background: rgba(45, 45, 68, 0.9);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Search Card */
.search-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 32px;
    position: relative;
    transition: var(--transition);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-main {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.clear-search:hover {
    color: var(--accent-color);
}

.search-actions {
    display: flex;
    gap: 12px;
}

.search-type {
    padding: 0 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: var(--white);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.search-type:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(45, 106, 79, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* Search Tips */
.search-tips {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-tips i {
    color: var(--primary-color);
}

.search-tips kbd {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.7rem;
}

body.dark-mode .search-tips kbd {
    background: #3d3d5c;
    color: #e0e0e0;
}

/* Advanced Filters */
.advanced-filters {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.filter-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    padding: 8px 0;
    transition: var(--transition);
}

.filter-toggle:hover {
    color: var(--primary-dark);
}

.filter-toggle i:last-child {
    transition: transform 0.3s;
}

.filter-toggle.active i:last-child {
    transform: rotate(180deg);
}

.filter-panel {
    margin-top: 20px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
}

body.dark-mode .filter-group label {
    color: #e0e0e0;
}

.filter-group label i {
    margin-right: 6px;
    color: var(--primary-color);
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    cursor: pointer;
    background: var(--white);
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-actions {
    justify-content: flex-end;
}

.filter-actions .btn {
    padding: 10px 20px;
}

/* Results Section */
.results-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 32px;
    transition: var(--transition);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 24px;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.results-info i {
    color: var(--primary-color);
}

.search-badge {
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--primary-color);
}

body.dark-mode .search-badge {
    background: #3d5c4a;
    color: #a0d6b3;
}

.results-actions {
    display: flex;
    gap: 8px;
    position: relative;
}

.btn-icon {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
}

.btn-icon:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-icon.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Export Dropdown */
.export-dropdown {
    position: relative;
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-width: 150px;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-mode .export-menu {
    background: #2d2d44;
    border-color: #3d3d5c;
}

.export-menu.show {
    display: block;
}

.export-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
}

body.dark-mode .export-menu a {
    color: #e0e0e0;
}

.export-menu a:hover {
    background: #f0f0f0;
}

body.dark-mode .export-menu a:hover {
    background: #3d3d5c;
}

/* Compare Bar */
.compare-bar {
    background: var(--white);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 10px;
    z-index: 100;
}

.compare-bar-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.compare-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.compare-item {
    background: var(--primary-light);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.compare-item button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
}

.btn-compare, .btn-clear-compare {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-compare {
    background: var(--primary-color);
    color: white;
}

.btn-compare:hover {
    background: var(--primary-dark);
}

.btn-clear-compare {
    background: var(--accent-color);
    color: white;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.results-grid.list-view {
    grid-template-columns: 1fr;
}

.species-card {
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.species-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .card-header {
    background: linear-gradient(135deg, #252540, #1f1f38);
}

.taxon-badge {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.taxon-badge.species { background: #e3f2fd; color: #1976d2; }
.taxon-badge.subspecies { background: #f3e5f5; color: #7b1fa2; }
.taxon-badge.variety { background: #fff3e0; color: #ef6c00; }
.taxon-badge.form { background: #e8f5e9; color: #2e7d32; }

body.dark-mode .taxon-badge.species { background: #1a3a5c; color: #90caf9; }
body.dark-mode .taxon-badge.subspecies { background: #3a1a4a; color: #ce93d8; }
body.dark-mode .taxon-badge.variety { background: #4a3a1a; color: #ffb74d; }
body.dark-mode .taxon-badge.form { background: #1a4a2a; color: #81c784; }

.card-actions {
    display: flex;
    gap: 10px;
}

.compare-checkbox {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    padding: 5px;
}

.compare-checkbox:hover {
    color: var(--primary-color);
}

.compare-checkbox.active {
    color: var(--primary-color);
}

.audio-btn {
    background: var(--primary-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    color: var(--white);
}

.audio-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.audio-btn.playing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.audio-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-bg);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    margin-bottom: 8px;
}

.audio-btn:hover .audio-tooltip {
    opacity: 1;
}

.card-body {
    padding: 20px;
}

.scientific-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-dark);
}

.scientific-name i {
    color: var(--primary-color);
    margin-right: 8px;
    font-size: 1rem;
}

.authorship {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-light);
    display: block;
    margin-top: 4px;
}

.highlight-match {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

body.dark-mode .highlight-match {
    background-color: #ffd54f;
    color: #1a1a2e;
}

.taxonomy-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.family-tag, .genus-tag, .habit-tag {
    font-size: 0.875rem;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.family-tag i, .genus-tag i, .habit-tag i {
    font-size: 0.75rem;
    color: var(--primary-color);
}

.reference-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.813rem;
    color: var(--text-light);
}

.reference-info i {
    margin-right: 4px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-details, .btn-cite {
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: var(--transition);
}

.btn-details {
    color: var(--primary-color);
}

.btn-details:hover {
    gap: 12px;
    color: var(--primary-dark);
}

.btn-cite {
    color: var(--text-light);
}

.btn-cite:hover {
    color: var(--secondary-color);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.pagination-btn {
    padding: 10px 20px;
    border: 1px solid #e0e0e0;
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
}

.pagination-number {
    width: 40px;
    height: 40px;
    border: 1px solid #e0e0e0;
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.pagination-number:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-number.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.pagination-dots {
    padding: 0 8px;
    color: var(--text-light);
}

/* Citation Card */
.citation-card {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 32px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

body.dark-mode .citation-card {
    background: #2d2d44;
}

.citation-card h3 {
    font-size: 1.125rem;
    margin-bottom: 12px;
    color: var(--text-dark);
}

body.dark-mode .citation-card h3 {
    color: #e0e0e0;
}

.citation-card h3 i {
    color: var(--primary-color);
    margin-right: 8px;
}

.citation-text {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    background: var(--white);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
}

body.dark-mode .citation-text {
    background: #1a1a2e;
    border-color: #3d3d5c;
}

.btn-citation {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-citation:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
    border-radius: var(--border-radius);
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

body.dark-mode .modal-content {
    background: #2d2d44;
}

.modal-content.small {
    max-width: 500px;
}

.modal-content.large {
    max-width: 1200px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    color: var(--accent-color);
}

/* Modal Content Styles */
.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 5;
}

body.dark-mode .modal-header {
    background: #2d2d44;
    border-bottom-color: #3d3d5c;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
}

body.dark-mode .modal-header h2 {
    color: #a0d6b3;
}

.modal-header h2 i {
    margin-right: 12px;
    color: var(--primary-color);
}

.modal-body {
    padding: 24px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.detail-item span, .detail-item code {
    font-size: 0.95rem;
}

.detail-item code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}

body.dark-mode .detail-item code {
    background: #1a1a2e;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select {
    background: #3d3d5c;
    border-color: #4d4d6c;
    color: #e0e0e0;
}

/* Citation Formats */
.citation-formats {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.citation-format-btn {
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    background: none;
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.citation-format-btn.active {
    background: var(--primary-color);
    color: white;
}

.citation-format-btn:hover:not(.active) {
    background: rgba(45, 106, 79, 0.1);
}

.citation-text-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

body.dark-mode .citation-text-container {
    background: #1a1a2e;
}

.citation-text-container pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    margin-bottom: 15px;
}

/* Compare Table */
.compare-table {
    overflow-x: auto;
}

.compare-table table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table th, .compare-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.compare-table th {
    background: #f8f9fa;
    font-weight: 600;
}

body.dark-mode .compare-table th {
    background: #252540;
}

.compare-table tr:hover td {
    background: #fafafa;
}

body.dark-mode .compare-table tr:hover td {
    background: #252540;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.toast-success { background: #2d6a4f; color: white; }
.toast-error { background: #e76f51; color: white; }
.toast-info { background: #1a1a2e; color: white; }
.toast-warning { background: #e9c46a; color: #1a1a2e; }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-mode .autocomplete-dropdown {
    background: #2d2d44;
    border-color: #3d3d5c;
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

body.dark-mode .autocomplete-item {
    border-bottom-color: #3d3d5c;
}

.autocomplete-item:hover {
    background-color: #f5f5f5;
}

body.dark-mode .autocomplete-item:hover {
    background-color: #3d3d5c;
}

.autocomplete-item strong {
    display: block;
    color: var(--primary-color);
}

.autocomplete-item small {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: #ffffff;
    padding: 48px 20px 24px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    margin-bottom: 16px;
    font-size: 1.125rem;
}

.footer-section p {
    color: #a0a0a0;
    line-height: 1.6;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 16px;
}

.footer-badges span {
    font-size: 0.813rem;
    color: #a0a0a0;
}

.footer-badges i {
    color: var(--primary-light);
    margin-right: 6px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
    color: #a0a0a0;
}

.footer-section ul li i {
    margin-right: 10px;
    color: var(--primary-light);
}

.footer-section a {
    color: #a0a0a0;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-copyright {
    font-size: 0.813rem;
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* List View Styles */
.list-view .species-card {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.list-view .species-card .card-header {
    width: 140px;
    flex-shrink: 0;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    justify-content: center;
}

.list-view .species-card .card-body {
    flex: 1;
}

.list-view .species-card .card-footer {
    width: 140px;
    flex-shrink: 0;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 24px;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .container {
        margin-top: -60px;
        padding: 0 16px;
    }
    
    .search-card {
        padding: 20px;
    }
    
    .search-main {
        flex-direction: column;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        justify-content: stretch;
    }
    
    .filter-actions .btn {
        width: 100%;
    }
    
    .pagination-numbers {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-badges {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .list-view .species-card {
        flex-direction: column;
    }
    
    .list-view .species-card .card-header,
    .list-view .species-card .card-footer {
        width: 100%;
    }
    
    .dark-mode-toggle {
        bottom: 20px;
        right: 20px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 90px;
    }
}

@media (max-width: 480px) {
    .results-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .taxonomy-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .reference-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .hero-section, .search-card, .results-actions, .pagination, .footer, .citation-card,
    .dark-mode-toggle, .back-to-top, .compare-bar, .export-dropdown {
        display: none;
    }
    
    .results-section {
        box-shadow: none;
        padding: 0;
    }
    
    .species-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .scientific-name {
        color: black;
    }
}