/**
 * TRREB Price Range Filter Styles - FIXED for SearchingInToronto_IDX Integration
 * File: price-range-filter.css
 * Purpose: Styles for price range filter component
 * Integration: Extends searchingintoronto-idx-v11.css base styles
 * Dependencies: Requires base CSS classes from main plugin
 * RESO Compliance: Supports RESO Web API v4.0 data display
 * FIXED: Proper integration with base CSS, simplified styling, component architecture alignment
 */

/* ==========================================================================
   PRICE RANGE FILTER CONTAINER - Extends filter-container-base
   ========================================================================== */

.trreb-price-range-container {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.price-range-filters {
    /* Extends filter-container-base styling */
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.price-range-filters .filter-header-base {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-range-filters .filter-header-base h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.price-range-filters .filter-content-base {
    padding: 20px;
    background: #fff;
}

/* ==========================================================================
   PROPERTY TYPE SELECTION - Radio button styling
   ========================================================================== */

.price-type-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.price-type-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.price-type-label:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}

.price-type-radio {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #3498db;
}

.price-type-text {
    font-weight: 600;
}

.price-type-radio:checked + .price-type-text {
    color: #2980b9;
}

/* ==========================================================================
   INPUT MODE SELECTION - Radio button styling
   ========================================================================== */

.price-input-mode-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #f0f8ff;
    border-radius: 6px;
    border: 1px solid #bde0ff;
}

.input-mode-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    font-weight: 500;
}

.input-mode-label:hover {
    color: #2980b9;
}

.input-mode-radio {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: #3498db;
}

.input-mode-radio:checked + span {
    color: #2980b9;
    font-weight: 600;
}

/* ==========================================================================
   PRICE RANGE INPUTS - Extends base form styling
   ========================================================================== */

.price-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.price-input-col {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.price-input-col:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.price-input-col label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.price-input-container {
    position: relative;
}

/* Extends base filter form controls */
.price-dropdown,
.price-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    background: #fff;
    transition: all 0.2s ease;
    min-height: 42px; /* Match main plugin field heights */
}

.price-dropdown:focus,
.price-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #fff;
}

.price-input::placeholder {
    color: #6c757d;
    font-style: italic;
    font-weight: 400;
}

.no-max-checkbox {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6c757d;
    cursor: pointer;
}

.no-max-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
}

.no-max-checkbox:hover {
    color: #495057;
}

/* ==========================================================================
   PRICE RANGE SLIDER - For lease properties
   ========================================================================== */

.price-range-slider {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.price-range-slider h5 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #495057;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slider-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.slider-group {
    text-align: center;
}

.slider-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
}

.price-slider {
    width: 100%;
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
    outline: none;
    accent-color: #3498db;
    cursor: pointer;
}

.price-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.price-slider::-webkit-slider-thumb:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   FILTER ACTIONS - Extends base button styling
   ========================================================================== */

.price-filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

/* Use main plugin button classes */
.price-filter-actions .btn-primary,
.price-filter-actions .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-height: 42px; /* Match main plugin button heights */
    line-height: 1.2;
}

.price-filter-actions .btn-primary {
    background: #3498db;
    color: #fff;
}

.price-filter-actions .btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.3);
}

.price-filter-actions .btn-secondary {
    background: #6c757d;
    color: #fff;
}

.price-filter-actions .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.3);
}

.price-filter-actions .btn-primary:disabled,
.price-filter-actions .btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   VALIDATION MESSAGES - Consistent with main plugin styling
   ========================================================================== */

.validation-messages {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.warning-message {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* ==========================================================================
   PRICE SELECTION DISPLAY
   ========================================================================== */

.price-selection-display {
    background: #f8fff9;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 12px 15px;
    margin-top: 15px;
    font-size: 13px;
}

.price-selection-display h5 {
    margin: 0 0 8px 0;
    color: #155724;
    font-size: 14px;
    font-weight: 600;
}

#price-selection-summary {
    color: #27ae60;
    font-weight: 600;
    font-size: 14px;
}

/* ==========================================================================
   FILTER TOGGLE INTEGRATION - Consistent with main plugin
   ========================================================================== */

.filter-toggle {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.filter-toggle:hover {
    background: #f8f9fa;
    color: #495057;
}

/* ==========================================================================
   INTEGRATION CLASSES - For seamless integration with main plugin
   ========================================================================== */

/* Ensure consistent styling with other filter components */
.trreb-price-range-container .filter-container-base {
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* Match main plugin's form styling */
.trreb-price-range-container .filter-select,
.trreb-price-range-container input[type="text"],
.trreb-price-range-container input[type="number"] {
    height: auto;
    min-height: 42px;
}

/* Consistent button heights with main plugin */
.trreb-price-range-container .btn-primary,
.trreb-price-range-container .btn-secondary {
    min-height: 42px;
    line-height: 1.2;
}

/* ==========================================================================
   RESPONSIVE DESIGN - Mobile and tablet support
   ========================================================================== */

@media (max-width: 768px) {
    .price-input-row,
    .slider-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .price-type-selection,
    .price-input-mode-selection {
        flex-direction: column;
        gap: 12px;
    }
    
    .price-filter-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .price-filter-actions .btn-primary,
    .price-filter-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    .price-input-col {
        padding: 12px;
    }
    
    .price-range-filters .filter-header-base {
        padding: 12px 15px;
    }
    
    .price-range-filters .filter-content-base {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .trreb-price-range-container {
        margin: 10px 0;
        border-radius: 6px;
    }
    
    .price-range-slider {
        padding: 15px;
    }
    
    .slider-container {
        gap: 20px;
    }
    
    .price-type-selection {
        padding: 12px;
    }
    
    .price-input-mode-selection {
        padding: 10px 12px;
    }
    
    .price-filter-actions {
        margin-top: 15px;
        padding-top: 12px;
    }
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

.price-type-radio:focus,
.input-mode-radio:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.filter-toggle:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.no-max-checkbox input[type="checkbox"]:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .trreb-price-range-container,
    .price-input-col,
    .price-dropdown,
    .price-input {
        border-width: 2px;
    }
    
    .price-filter-actions .btn-primary,
    .price-filter-actions .btn-secondary {
        border: 2px solid currentColor;
        font-weight: 700;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}