/* KasetIdea Plants - Fixed CSS for Desktop Scroll */

/* Collapsible Container */
.filters-container {
    background: white;
    border-radius: 15px;
    margin: 0 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Toggle Button */
.filters-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: none;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #2C3E50;
    transition: background 0.3s;
}

.filters-toggle:hover {
    background: #f8f9fa;
}

.filters-toggle.active {
    background: #E8F8F5;
    color: #27AE60;
}

/* Toggle Icon Animation */
.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 20px;
    color: #27AE60;
}

.filters-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

/* Collapsible Content */
.filters-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.filters-content.show {
    max-height: 600px;
}

.filters-inner {
    padding: 0 20px 20px;
}

/* Filter Groups */
.filter-group {
    margin-bottom: 15px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #7F8C8D;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Filter Select Boxes */
.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E8ECF0;
    border-radius: 10px;
    font-size: 15px;
    background: white;
    color: #2C3E50;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 45px;
}

.filter-select:focus {
    border-color: #27AE60;
    outline: none;
    box-shadow: 0 0 0 3px rgba(39,174,96,0.1);
}

/* Active Filters Count Badge */
.active-filters-count {
    background: #E74C3C;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Filter Action Buttons */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-apply-filters {
    flex: 1;
    padding: 12px 20px;
    background: #27AE60;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-apply-filters:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39,174,96,0.3);
}

.btn-reset-filters {
    padding: 12px 20px;
    background: white;
    color: #7F8C8D;
    border: 2px solid #E0E0E0;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-reset-filters:hover {
    border-color: #E74C3C;
    color: #E74C3C;
}

/* Category Pills Container - FIXED FOR ALL SCREEN SIZES */
.category-wrapper {
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #27AE60 #f0f0f0;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

/* Custom Scrollbar for Category Wrapper */
.category-wrapper::-webkit-scrollbar {
    height: 6px;
}

.category-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.category-wrapper::-webkit-scrollbar-thumb {
    background: #27AE60;
    border-radius: 10px;
}

.category-wrapper::-webkit-scrollbar-thumb:hover {
    background: #229954;
}

/* Category Pills - PREVENT WRAPPING ON ALL SCREENS */
.category-pills {
    display: flex !important;
    flex-wrap: nowrap !important; /* Force single row */
    gap: 10px;
    padding-bottom: 10px;
    white-space: nowrap;
    min-width: max-content; /* Ensure pills don't shrink */
}

/* Category Filter Buttons */
.cat-filter {
    flex-shrink: 0; /* Prevent shrinking */
    padding: 10px 20px;
    background: white;
    color: #5D6D7E;
    border: 2px solid #E0E0E0;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap; /* Prevent text wrapping */
    cursor: pointer;
    transition: all 0.3s;
    min-width: fit-content; /* Maintain button width */
}

.cat-filter:hover {
    background: #E8F8F5;
    border-color: #27AE60;
}

.cat-filter.active {
    background: #27AE60;
    color: white;
    border: none;
}

/* Plants Grid */
.plants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

/* Plant Cards */
.plant-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

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

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(0) rotate(-5deg); }
    75% { transform: translateY(20px) rotate(5deg); }
}

/* Swipe Hint - Show on both mobile and desktop when scrollable */
.swipe-hint {
    font-size: 11px;
    color: #95A5A6;
    margin-top: 8px;
    text-align: center;
    display: none;
}

.swipe-hint.show {
    display: block;
}

/* Mobile Specific Styles */
@media (max-width: 991px) {
    .filters-container {
        margin: 0 10px 15px;
    }
    
    .filters-toggle {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .filter-select {
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    /* ⭐ 2 COLUMNS ON MOBILE ⭐ */
    .plants-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 10px;
    }
    
    /* Adjust card for smaller screens */
    .plant-card {
        border-radius: 10px;
    }
    
    .plant-card h3 {
        font-size: 1rem !important;
    }
    
    .plant-card div[style*="height: 220px"] {
        height: 150px !important;
    }
    
    .plant-card div[style*="padding: 20px"] {
        padding: 12px !important;
    }
    
    /* Hide desktop scrollbar on mobile */
    .category-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .category-wrapper {
        scrollbar-width: none;
    }
}

/* Tablet Styles */
@media (min-width: 992px) and (max-width: 1024px) {
    .plants-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filters-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Small Mobile (<480px) - Extra Compact */
@media (max-width: 480px) {
    .plants-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 8px;
    }
    
    .plant-card {
        border-radius: 8px;
    }
    
    .plant-card h3 {
        font-size: 0.9rem !important;
        line-height: 1.2 !important;
    }
    
    .plant-card div[style*="height: 220px"],
    .plant-card div[style*="height: 150px"] {
        height: 120px !important;
    }
    
    .plant-card div[style*="padding: 20px"],
    .plant-card div[style*="padding: 12px"] {
        padding: 10px !important;
    }
    
    /* Smaller badges */
    .plant-card div[style*="position: absolute"][style*="top: 12px"] {
        padding: 4px 8px !important;
        font-size: 10px !important;
    }
    
    /* Smaller scientific name */
    .plant-card div[style*="font-style: italic"] {
        font-size: 11px !important;
    }
    
    /* Smaller icons */
    .plant-card span[style*="font-size: 20px"] {
        font-size: 16px !important;
    }
}

/* Desktop Styles */
@media (min-width: 992px) {
    /* Hide toggle button on desktop */
    .filters-toggle {
        display: none !important;
    }
    
    /* Show filters content always */
    .filters-content {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .filters-inner {
        padding: 20px !important;
    }
    
    .filters-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    /* Hide action buttons on desktop */
    .filter-actions {
        display: none !important;
    }
}

/* Large Desktop - still allow horizontal scroll for many categories */
@media (min-width: 1400px) {
    .category-wrapper {
        max-width: 100%;
    }
}

/* Touch-friendly adjustments */
@media (pointer: coarse) {
    .cat-filter,
    .filter-select,
    .btn-apply-filters,
    .btn-reset-filters,
    button {
        min-height: 44px; /* iOS touch target size */
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading state */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* No results message */
#no-results {
    text-align: center;
    padding: 60px 20px;
}

#no-results h3 {
    font-size: 1.5rem;
    color: #2C3E50;
    margin-bottom: 10px;
}

#no-results p {
    color: #7F8C8D;
    margin: 20px 0;
}

#no-results button {
    margin-top: 20px;
    padding: 12px 30px;
    background: #27AE60;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

#no-results button:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39,174,96,0.3);
}
