/**
 * Vehicle Selector Facet - CSS Styles
 */

/* Main Container */
.wpgb-vehicle-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
}

/* Individual Field Container */
.wpgb-vehicle-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Labels */
.wpgb-vehicle-field label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* Select Dropdowns */
.wpgb-vehicle-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    color: #2c3e50;
    background-color: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c3e50' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.wpgb-vehicle-select:hover:not(:disabled) {
    border-color: #3498db;
}

.wpgb-vehicle-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Disabled State */
.wpgb-vehicle-select:disabled {
    background-color: #f1f3f5;
    color: #adb5bd;
    cursor: not-allowed;
    border-color: #e9ecef;
    opacity: 0.7;
}

/* Loading State */
.wpgb-vehicle-select option:only-child {
    color: #7f8c8d;
    font-style: italic;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wpgb-vehicle-selector {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .wpgb-vehicle-select {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .wpgb-vehicle-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop - 5 columns if all fields visible */
@media (min-width: 1200px) {
    .wpgb-vehicle-selector {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Alternative: Inline Layout */
.wpgb-vehicle-selector.wpgb-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
}

.wpgb-vehicle-selector.wpgb-inline .wpgb-vehicle-field {
    flex: 1;
    min-width: 150px;
}

/* Alternative: Vertical Stacked */
.wpgb-vehicle-selector.wpgb-vertical {
    grid-template-columns: 1fr;
    max-width: 400px;
}

/* Integration with WPGB Filter Styles */
.wpgb-facet .wpgb-vehicle-selector {
    background: transparent;
    padding: 0;
}

.wpgb-facet .wpgb-vehicle-field label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wpgb-vehicle-selector {
        background: #212529;
    }

    .wpgb-vehicle-select {
        background-color: #343a40;
        color: #f8f9fa;
        border-color: #495057;
    }

    .wpgb-vehicle-select:disabled {
        background-color: #2b3035;
        color: #6c757d;
    }

    .wpgb-vehicle-field label {
        color: #e9ecef;
    }
}

/* Custom Scrollbar for Select (Firefox) */
.wpgb-vehicle-select {
    scrollbar-width: thin;
    scrollbar-color: #3498db #f1f3f5;
}

/* Custom Scrollbar (Webkit) */
.wpgb-vehicle-select::-webkit-scrollbar {
    width: 8px;
}

.wpgb-vehicle-select::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.wpgb-vehicle-select::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.wpgb-vehicle-select::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Loading Animation */
@keyframes wpgb-loading-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.wpgb-vehicle-select:disabled option:only-child {
    animation: wpgb-loading-pulse 1.5s ease-in-out infinite;
}

/* Required Field Indicator */
.wpgb-vehicle-field.required label::after {
    content: "*";
    color: #e74c3c;
    margin-left: 4px;
}

/* Error State */
.wpgb-vehicle-field.error .wpgb-vehicle-select {
    border-color: #e74c3c;
}

.wpgb-vehicle-field.error label {
    color: #e74c3c;
}

/* Success State */
.wpgb-vehicle-field.success .wpgb-vehicle-select {
    border-color: #27ae60;
}

/* Hide Hidden Input */
.wpgb-vehicle-value {
    display: none;
}

/* Icon in Label (Optional) */
.wpgb-vehicle-field label svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
    fill: currentColor;
}

/* Compact Mode */
.wpgb-vehicle-selector.wpgb-compact {
    gap: 12px;
    padding: 15px;
}

.wpgb-vehicle-selector.wpgb-compact .wpgb-vehicle-select {
    padding: 8px 12px;
    font-size: 14px;
}

.wpgb-vehicle-selector.wpgb-compact .wpgb-vehicle-field label {
    font-size: 12px;
}

/* Large Mode */
.wpgb-vehicle-selector.wpgb-large {
    gap: 25px;
    padding: 30px;
}

.wpgb-vehicle-selector.wpgb-large .wpgb-vehicle-select {
    padding: 14px 18px;
    font-size: 16px;
}

.wpgb-vehicle-selector.wpgb-large .wpgb-vehicle-field label {
    font-size: 15px;
}
