/**
 * ⚡ Price Range Slider Styles
 * 
 * Features:
 * - Modern UI Design
 * - Smooth Animations
 * - Touch-Friendly
 * - Responsive
 * - RTL Support
 * 
 * @version 1.0.0
 */

/* =====================================
   Price Slider Container
   ===================================== */
.price-slider-container {
    position: relative;
    height: 40px;
    margin: 25px 0;
    direction: ltr; /* Force LTR for slider mechanics */
}

/* =====================================
   Track Background
   ===================================== */
.price-slider-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #e5e7eb 0%, #d1d5db 100%);
    border-radius: 10px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =====================================
   Active Range
   ===================================== */
.price-slider-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
    transition: all 0.15s ease;
}

/* =====================================
   Range Inputs
   ===================================== */
.price-slider-input {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

/* Thumb Styles - Webkit/Blink */
.price-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: all;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.price-slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
}

.price-slider-input::-webkit-slider-thumb:active {
    transform: scale(1.05);
    border-width: 4px;
}

/* Thumb Styles - Firefox */
.price-slider-input::-moz-range-thumb {
    pointer-events: all;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.price-slider-input::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
}

/* =====================================
   Values Display
   ===================================== */
.price-slider-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    direction: rtl;
}

.price-value-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.price-value-wrapper label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-value-separator {
    font-size: 1.25rem;
    color: #9ca3af;
    font-weight: 300;
}

/* =====================================
   Quick Price Buttons
   ===================================== */
.quick-price-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.quick-price-btn {
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Cairo', sans-serif;
}

.quick-price-btn:hover {
    background: #f9fafb;
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.quick-price-btn:active {
    transform: translateY(0);
}

.quick-price-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* =====================================
   Responsive Design
   ===================================== */
@media (max-width: 768px) {
    .price-slider-container {
        margin: 20px 0;
    }
    
    .price-slider-values {
        padding: 10px 12px;
    }
    
    .price-value {
        font-size: 0.9rem;
    }
    
    .quick-price-buttons {
        grid-template-columns: 1fr;
    }
    
    .quick-price-btn {
        padding: 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .price-slider-input::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .price-slider-input::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }
    
    .price-slider-track {
        height: 8px;
    }
}

/* =====================================
   Animations
   ===================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-slider-values,
.quick-price-buttons {
    animation: slideIn 0.3s ease-out;
}

/* =====================================
   Focus States (Accessibility)
   ===================================== */
.price-slider-input:focus {
    outline: none;
}

.price-slider-input:focus::-webkit-slider-thumb {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.price-slider-input:focus::-moz-range-thumb {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.quick-price-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* =====================================
   Loading State
   ===================================== */
.price-slider-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.price-slider-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #3b82f6;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
