/* Plants & Plant Detail Styles */

.plants-page, .plant-detail-page {
    padding-top: 90px; /* account for fixed navbar */
}

.plants-header {
    padding: 2rem 0 1rem;
    background: linear-gradient(180deg, rgba(37,99,235,0.06), rgba(255,255,255,0));
}

.plants-subtitle {
    text-align: center;
    color: #4b5563;
    margin-bottom: 1rem;
}

.plants-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

.search-group {
    position: relative;
    width: min(520px, 92vw);
}

#plant-search {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    outline: none;
    font-size: 1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.05);
}

.autocomplete-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    max-height: 260px;
    overflow: auto;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.autocomplete-item:hover {
    background: rgba(37,99,235,0.08);
}

.filters-group {
    display: flex;
    gap: 0.75rem;
}

#region-filter, #code-filter {
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    outline: none;
    font-size: 0.95rem;
}

.plant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.plant-card {
    display: block;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plant-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
}

.plant-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
}

.plant-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plant-region {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(37,99,235,0.9);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

.plant-meta {
    padding: 1rem;
}

.plant-name {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.plant-info {
    display: flex;
    gap: 1rem;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.plant-address {
    color: #4b5563;
    font-size: 0.95rem;
}

.empty-state {
    text-align: center;
    color: #6b7280;
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #2563eb;
}

/* Loading state */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    color: #4b5563;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(37,99,235,0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Grouped by region */
.plant-groups {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.plant-group {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 1rem;
    background: #fff;
}

.plant-group-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: left;
}

.plant-group .plant-grid {
    margin: 0;
}

/* Detail page */
.plant-detail-header {
    padding: 2rem 0 1rem;
    background: linear-gradient(180deg, rgba(37,99,235,0.06), rgba(255,255,255,0));
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.plant-detail {
    margin-top: 1rem;
}

.plant-detail-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
}

.plant-detail-media {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0,0,0,0.12);
}

.plant-detail-img {
    width: 100%;
    height: auto;
    display: block;
}

.detail-block {
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 1rem;
}

.detail-list {
    list-style: none;
    padding-left: 0;
}

.detail-list li {
    margin-bottom: 0.4rem;
}

@media (max-width: 900px) {
    .plant-detail-wrapper {
        grid-template-columns: 1fr;
    }
}
