/* Plant Characteristics Filter - WordPress Plugin Styles */

.plant-filter-container * {
    box-sizing: border-box;
}

.plant-filter-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
}

.plant-filter-container .main-container {
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.plant-filter-container .plant-filter-title {
    color: #667eea;
    margin: 0;
    padding: 20px 30px;
    font-size: 2em;
    background: white;
    border-bottom: 3px solid #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plant-filter-container .container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.plant-filter-container .posts-section {
    flex: 1;
    overflow-y: auto;
    background: #f5f5f5;
    padding: 20px;
}

.plant-filter-container .posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.plant-filter-container .post-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.plant-filter-container .post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.2);
}

.plant-filter-container .post-card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.plant-filter-container .post-card .post-link {
    color: #667eea;
    text-decoration: none;
}

.plant-filter-container .post-card .post-link:hover {
    text-decoration: underline;
}

.plant-filter-container .post-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.plant-filter-container .post-card .read-more {
    display: inline-block;
    color: #667eea;
    font-weight: 500;
    margin-top: 10px;
    text-decoration: none;
}

.plant-filter-container .post-card .read-more:hover {
    text-decoration: underline;
}

.plant-filter-container .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.plant-filter-container .tag {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    color: #555;
}

/* Filter Panel - Always visible on left */
.plant-filter-container .filter-panel {
    width: 400px;
    background: white;
    border-right: 2px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.plant-filter-container .filter-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    font-weight: bold;
    font-size: 1.2em;
}

.plant-filter-container .selected-traits {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 2px solid #e0e0e0;
    min-height: 50px;
    font-size: 0.85em;
    color: #555;
}

.plant-filter-container .selected-traits strong {
    color: #667eea;
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.plant-filter-container .selected-traits-list {
    color: #333;
    line-height: 1.6;
}

.plant-filter-container .clear-button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8em;
    margin-top: 8px;
    transition: background 0.2s;
}

.plant-filter-container .clear-button:hover {
    background: #ee5a5a;
}

.plant-filter-container .clear-button.hidden {
    display: none;
}

.plant-filter-container .filter-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.plant-filter-container .category-column {
    width: 150px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    background: #fafafa;
}

.plant-filter-container .subtype-column {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: white;
}

.plant-filter-container .category-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85em;
}

.plant-filter-container .category-item:hover {
    background: #f0f0f0;
}

.plant-filter-container .category-item.active {
    background: #667eea;
    color: white;
    font-weight: bold;
    border-left: 4px solid #764ba2;
}

.plant-filter-container .subtype-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 12px;
}

.plant-filter-container .subtype-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.plant-filter-container .subtype-button:hover {
    transform: scale(1.05);
}

.plant-filter-container .subtype-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid #e0e0e0;
    transition: all 0.3s ease;
    margin-bottom: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plant-filter-container .subtype-button.selected .subtype-circle {
    border-color: #667eea;
    border-width: 4px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.plant-filter-container .subtype-label {
    font-size: 0.75em;
    text-align: center;
    color: #555;
    font-weight: 500;
    word-wrap: break-word;
    max-width: 85px;
}

.plant-filter-container .subtype-button.selected .subtype-label {
    color: #667eea;
    font-weight: bold;
}

.plant-filter-container .no-selection {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.plant-filter-container .posts-loading,
.plant-filter-container .no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 1.1em;
}

.plant-filter-container .post-card.hidden {
    display: none;
}

/* Mobile Responsive Design - Filter fixed at bottom */
@media (max-width: 768px) {
    /* Ensure body doesn't have conflicting positioning */
    body .plant-filter-container {
        position: relative;
    }

    .plant-filter-container .main-container {
        flex-direction: column;
        min-height: 100vh;
    }

    .plant-filter-container .plant-filter-title {
        font-size: 1.5em;
        padding: 15px 20px;
        flex-shrink: 0;
        position: relative;
        z-index: 1001;
    }

    .plant-filter-container .container {
        flex-direction: column;
        flex: 1;
        position: relative;
    }

    .plant-filter-container .posts-section {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        padding-bottom: calc(45vh + 15px);
        /* Ensure posts can scroll behind filter */
        position: relative;
        z-index: 1;
    }

    .plant-filter-container .filter-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-right: none !important;
        border-top: 2px solid #e0e0e0;
        max-height: 45vh;
        z-index: 1000 !important;
        box-shadow: 0 -4px 6px rgba(0,0,0,0.1);
        /* Ensure it stays fixed */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .plant-filter-container .filter-header {
        padding: 15px 20px;
        font-size: 1em;
        flex-shrink: 0;
    }

    .plant-filter-container .selected-traits {
        padding: 12px 20px;
        min-height: auto;
        flex-shrink: 0;
    }

    .plant-filter-container .selected-traits strong {
        font-size: 0.85em;
    }

    .plant-filter-container .selected-traits-list {
        font-size: 0.85em;
    }

    .plant-filter-container .filter-content {
        flex: 1;
        overflow: hidden;
        min-height: 0;
    }

    .plant-filter-container .category-column {
        width: 120px;
        font-size: 0.85em;
    }

    .plant-filter-container .category-item {
        padding: 10px 12px;
        font-size: 0.8em;
    }

    .plant-filter-container .subtype-column {
        padding: 10px;
    }

    .plant-filter-container .subtype-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }

    .plant-filter-container .subtype-circle {
        width: 60px;
        height: 60px;
    }

    .plant-filter-container .subtype-label {
        font-size: 0.7em;
        max-width: 70px;
    }

    .plant-filter-container .posts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .plant-filter-container .post-card {
        padding: 15px;
    }

    .plant-filter-container .post-card h3 {
        font-size: 1.1em;
    }

    .plant-filter-container .post-card p {
        font-size: 0.9em;
    }

    .plant-filter-container .tag {
        font-size: 0.75em;
        padding: 3px 8px;
    }

    .plant-filter-container .clear-button {
        padding: 5px 10px;
        font-size: 0.75em;
        margin-top: 6px;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .plant-filter-container .plant-filter-title {
        font-size: 1.2em;
        padding: 12px 15px;
    }

    .plant-filter-container .filter-panel {
        max-height: 50vh !important;
    }

    .plant-filter-container .posts-section {
        padding-bottom: calc(50vh + 15px);
    }

    .plant-filter-container .category-column {
        width: 100px;
    }

    .plant-filter-container .subtype-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }

    .plant-filter-container .subtype-circle {
        width: 50px;
        height: 50px;
    }

    .plant-filter-container .subtype-label {
        font-size: 0.65em;
        max-width: 60px;
    }
}