/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2a2a2a;
    background-color: #faf8f3;
}

/* Header */
header {
    background-color: #5a6f4c;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Search Container */
.search-container {
    background: #fff9f0;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-container h1 {
    color: #5a6f4c;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    margin-bottom: 1.5rem;
}

.search-box {
    margin-bottom: 1.5rem;
}

#searchBox {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

#searchBox:focus {
    outline: none;
    border-color: #2d5016;
}

/* Filters */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

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

.filter-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

.radio-label input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.radio-label span {
    user-select: none;
}

select {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

select:focus {
    outline: none;
    border-color: #2d5016;
}

.clear-btn {
    padding: 0.5rem 1rem;
    background-color: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    align-self: flex-end;
}

.clear-btn:hover {
    background-color: #555;
}

/* Results Info */
.results-info {
    margin-bottom: 1rem;
}

#resultsCount {
    color: #666;
    font-weight: 500;
}

.results-container {
    /* Container for the plant list */
}

/* Plant List */
.plant-list {
    list-style: none;
    background: #fff9f0;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.plant-list-item {
    border-bottom: 1px solid #e8ded0;
}

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

.plant-list-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.plant-list-link:hover {
    background-color: #f5f0e8;
}

.plant-botanical {
    color: #5a6f4c;
    font-size: 1rem;
    font-weight: 500;
    min-width: 200px;
}

.plant-botanical em {
    font-style: italic;
}

.plant-common {
    color: #666;
    font-size: 0.95rem;
    min-width: 150px;
}

.plant-meta {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge.native {
    background-color: #d4e5d4;
    color: #3d5a3d;
}

.badge.water {
    background-color: #dfe9f0;
    color: #3d5a6b;
}

.badge.habit {
    background-color: #e8ede5;
    color: #5a6f4c;
}

.badge.edible {
    background-color: #ffe8d6;
    color: #8b5a3c;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

/* Plant Detail Page */
.plant-detail {
    background: #fff9f0;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.plant-header {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e8ded0;
}

.botanical-name {
    color: #5a6f4c;
    margin-bottom: 0.5rem;
    font-style: italic;
    font-size: 2rem;
}

.common-name-primary {
    font-size: 1.3rem;
    color: #3d3d3d;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.common-names {
    color: #888;
    font-size: 0.9rem;
}

.plant-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.plant-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background-color: #f5f0e8;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #7a8f6b;
}

.info-card h3 {
    color: #5a6f4c;
    margin-bottom: 1rem;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e8ded0;
}

.info-card li:last-child {
    border-bottom: none;
}

.plant-content {
    line-height: 1.8;
}

.plant-content h2 {
    color: #5a6f4c;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.plant-content h3 {
    color: #6b7f5d;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.plant-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.plant-content li {
    margin-bottom: 0.5rem;
}

.plant-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e8ded0;
}

.back-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #7a8f6b;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.back-link:hover {
    background-color: #5a6f4c;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .plant-header {
        grid-template-columns: 1fr;
    }
    
    .plant-image {
        order: -1;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .plant-list-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .plant-botanical,
    .plant-common {
        min-width: unset;
    }
    
    .plant-meta {
        margin-left: 0;
    }
}
