/**
 * OEM Filter Styles
 * @package OEM_System
 */

/* ============================================
   COMMON STYLES
   ============================================ */

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
}

.filter-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.filter-reset {
    background: transparent;
    border: 1px solid #ddd;
    padding: 6px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.3s;
}

.filter-reset:hover {
    background: #f44336;
    border-color: #f44336;
    color: #fff;
}

.filter-section {
    margin-bottom: 25px;
}

.filter-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
}

.filter-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    outline: none;
}

.filter-search-input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.filter-checkbox:hover {
    background: #f9f9f9;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-checkbox span {
    font-size: 14px;
    color: #555;
}

.filter-checkbox small {
    color: #999;
    font-size: 12px;
}

.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.filter-select:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.filter-apply-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.filter-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.no-options {
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* ============================================
   SIDEBAR STYLE
   ============================================ */

.oem-filter-sidebar {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

/* ============================================
   HORIZONTAL STYLE
   ============================================ */

.oem-filter-horizontal {
    background: #fff;
    padding: 20px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 180px;
}

.filter-item input,
.filter-item select {
    width: 100%;
}

.filter-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

.filter-actions button {
    width: auto;
    padding: 12px 25px;
}

/* ============================================
   DROPDOWN STYLE (Compact)
   ============================================ */

.oem-filter-dropdown {
    position: relative;
    margin-bottom: 20px;
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: #d4af37;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.filter-toggle-btn:hover {
    background: #b8941f;
    transform: translateY(-2px);
}

.filter-dropdown-content {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 350px;
    max-width: 90vw;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.filter-dropdown-content.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-dropdown-content .oem-filter-sidebar {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESULTS SECTION
   ============================================ */

.oem-filter-results {
    margin-top: 30px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.results-count {
    font-weight: 600;
    color: #555;
    font-size: 15px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
}

.result-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.result-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.result-card:hover .result-card-image img {
    transform: scale(1.1);
}

.result-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

.result-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.result-meta {
    margin-bottom: 8px;
}

.result-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

.result-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 12px 0;
    flex: 1;
}

.result-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    margin-top: auto;
}

.result-link:hover {
    color: #b8941f;
    gap: 10px;
}

/* Loading State */
.results-loading {
    display: none;
    text-align: center;
    padding: 80px 20px;
}

.results-loading .spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #f0f0f0;
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.results-loading p {
    color: #666;
    font-size: 16px;
}

/* Empty State */
.results-empty {
    display: none;
    text-align: center;
    padding: 80px 20px;
}

.results-empty svg {
    width: 80px;
    height: 80px;
    color: #d0d0d0;
    margin-bottom: 20px;
}

.results-empty p {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
}

.results-empty small {
    font-size: 14px;
    color: #999;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-item {
        min-width: 100%;
    }
    
    .filter-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-actions button {
        width: 100%;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .filter-dropdown-content {
        width: calc(100vw - 40px);
    }
}

@media (max-width: 480px) {
    .oem-filter-sidebar,
    .oem-filter-horizontal {
        padding: 20px;
    }
    
    .result-card-image {
        height: 180px;
    }
    
    .result-title {
        font-size: 16px;
    }
}
