/* Enhanced Styles for AdventureVanParts.com */

/* View Toggle Styles */
.view-toggle .btn-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-toggle .btn {
    border-radius: 0;
}

.view-toggle .btn:first-child {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

.view-toggle .btn:last-child {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

/* Search Results Container */
.search-results-container {
    transition: all 0.3s ease;
}

/* Grid View Styles */
.search-results-container.grid-view .part-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-results-container.grid-view .part-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* List View Styles */
.search-results-container.list-view .part-card.list-card {
    margin-bottom: 1rem;
}

.search-results-container.list-view .part-card .card-body {
    padding: 1rem;
}

.search-results-container.list-view .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.search-results-container.list-view .card-text {
    margin-bottom: 1rem;
}

.search-results-container.list-view .card-footer {
    border-top: none;
    background-color: transparent;
    padding-top: 0;
}

/* Enhanced Part Card Styles */
.part-card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.part-card .card-body {
    padding: 1.25rem;
}

.part-card .card-title a {
    color: #2c5f41;
    font-weight: 600;
    text-decoration: none !important;
}

.part-card .card-title a:hover {
    color: #1e4129;
}

/* Badge Styles */
.badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    margin-right: 0.25rem;
}

.difficulty-easy { 
    background-color: #28a745;
    color: white;
}

.difficulty-medium { 
    background-color: #ffc107;
    color: #212529;
}

.difficulty-hard { 
    background-color: #fd7e14;
    color: white;
}

.difficulty-expert { 
    background-color: #dc3545;
    color: white;
}

/* Search Suggestions */
.search-suggestions {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: white;
    z-index: 1000;
}

.suggestion-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none !important;
}

/* Enhanced Filter Styles */
.card-header {
    background: linear-gradient(135deg, #2c5f41 0%, #1e4129 100%);
    color: white;
    border-bottom: none;
}

.card-header h6 {
    margin: 0;
    font-weight: 600;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-select, .form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: all 0.2s ease;
}

.form-select:focus, .form-control:focus {
    border-color: #2c5f41;
    box-shadow: 0 0 0 0.2rem rgba(44, 95, 65, 0.25);
}

/* Quick Filters */
.btn-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
}

/* Loading Animations */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-results-container.grid-view .row > div {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .view-toggle {
        margin-bottom: 1rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    .part-card .card-body {
        padding: 1rem;
    }
    
    .part-card .card-title {
        font-size: 1rem;
    }
    
    .card-footer .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .card-footer .btn {
        width: 100%;
    }
    
    /* Mobile-specific search improvements */
    .collapse.show {
        display: block !important;
    }
    
    .search-filters-mobile {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1050;
        display: none;
    }
    
    .search-filters-mobile.show {
        display: block;
    }
    
    .search-filters-content {
        position: absolute;
        top: 10%;
        left: 5%;
        right: 5%;
        bottom: 10%;
        background: white;
        border-radius: 12px;
        overflow-y: auto;
        padding: 1rem;
    }
    
    /* Search suggestions mobile */
    .search-suggestions {
        max-height: 200px;
    }
    
    /* View toggle mobile improvements */
    .view-toggle .btn-group {
        width: 100%;
    }
    
    .view-toggle .btn {
        flex: 1;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .search-results-container {
        padding: 0;
    }
    
    .part-card {
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
    
    .form-select, .form-control {
        font-size: 0.9rem;
    }
}

/* Advanced Filter Enhancements */
.collapse.show {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Cards */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-radius: 12px;
}

.card + .card {
    margin-top: 1rem;
}

/* Price Range Display */
.form-text {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Enhanced Stats Cards */
.stats-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stats-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c5f41;
}

.stats-card h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #2c5f41;
}

/* Accessibility Improvements */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid #2c5f41;
    outline-offset: 2px;
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    .part-card {
        background-color: #2d2d2d;
        color: #e9ecef;
    }
    
    .search-suggestions {
        background-color: #2d2d2d;
        border-color: #495057;
    }
    
    .suggestion-item:hover {
        background-color: #3d3d3d;
    }
}

/* Performance Optimizations */
.part-card,
.btn,
.form-control,
.form-select {
    will-change: transform, box-shadow;
}

/* Print Styles */
@media print {
    .view-toggle,
    .card-header,
    .btn {
        display: none !important;
    }
    
    .part-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}