/**
 * Vehicle Filter Frontend Styles - Turkish Design
 * Modern UI with Theme Color (#C40200)
 *
 * @since 1.0.1
 */

/* ============================================
   Variables
   ============================================ */
:root {
    --vf-primary: #C40200;
    --vf-primary-dark: #A30200;
    --vf-primary-light: rgba(196, 2, 0, 0.08);
    --vf-text: #1a1a1a;
    --vf-text-light: #666;
    --vf-text-muted: #999;
    --vf-border: #e5e5e5;
    --vf-border-focus: #C40200;
    --vf-bg: #ffffff;
    --vf-bg-alt: #f8f9fa;
    --vf-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --vf-shadow-hover: 0 4px 20px rgba(196, 2, 0, 0.15);
    --vf-radius: 10px;
    --vf-radius-sm: 6px;
    --vf-transition: all 0.25s ease;
}

/* ============================================
   Wrapper & Container
   ============================================ */
.vfilter-wrapper {
    background: var(--vf-bg);
    border-radius: var(--vf-radius);
    box-shadow: var(--vf-shadow);
    overflow: hidden;
    margin-bottom: 30px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   Header
   ============================================ */
.vfilter-header {
    background: linear-gradient(135deg, var(--vf-primary) 0%, var(--vf-primary-dark) 100%);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vfilter-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.vfilter-icon {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

/* ============================================
   Garage Section
   ============================================ */
.vfilter-garage {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid var(--vf-border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.vfilter-garage-icon {
    width: 40px;
    height: 40px;
    background: var(--vf-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vfilter-garage-icon svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.vfilter-garage-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vfilter-garage-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--vf-text-muted);
    font-weight: 600;
}

.vfilter-garage-vehicle {
    font-size: 15px;
    font-weight: 700;
    color: var(--vf-text);
}

.vfilter-garage-clear {
    width: 36px;
    height: 36px;
    background: var(--vf-bg);
    border: 1px solid var(--vf-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--vf-transition);
}

.vfilter-garage-clear:hover {
    background: var(--vf-primary);
    border-color: var(--vf-primary);
}

.vfilter-garage-clear:hover svg {
    stroke: #fff;
}

.vfilter-garage-clear svg {
    width: 16px;
    height: 16px;
    stroke: var(--vf-text-light);
}

/* ============================================
   Form & Fields
   ============================================ */
.vfilter-form {
    padding: 24px;
}

.vfilter-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.vfilter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vfilter-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--vf-text);
    cursor: pointer;
}

.vfilter-field label svg {
    width: 16px;
    height: 16px;
    stroke: var(--vf-primary);
    flex-shrink: 0;
}

/* ============================================
   Select Dropdowns
   ============================================ */
.vfilter-select {
    width: 100%;
    height: 46px;
    padding: 0 40px 0 14px;
    border: 2px solid var(--vf-border);
    border-radius: var(--vf-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--vf-text);
    background: var(--vf-bg);
    cursor: pointer;
    transition: var(--vf-transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.vfilter-select:hover {
    border-color: #ccc;
}

.vfilter-select:focus {
    outline: none;
    border-color: var(--vf-border-focus);
    box-shadow: 0 0 0 3px var(--vf-primary-light);
}

.vfilter-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--vf-bg-alt);
}

.vfilter-select option {
    padding: 10px;
}

/* ============================================
   Year Range
   ============================================ */
.vfilter-year-range {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.vfilter-year-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vfilter-year-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--vf-text-light);
}

.vfilter-range-sep {
    font-size: 18px;
    font-weight: 700;
    color: var(--vf-primary);
    padding-bottom: 10px;
}

/* ============================================
   Price Range
   ============================================ */
.vfilter-price-range {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.vfilter-price-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vfilter-price-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--vf-text-light);
}

.vfilter-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 2px solid var(--vf-border);
    border-radius: var(--vf-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--vf-text);
    background: var(--vf-bg);
    transition: var(--vf-transition);
}

.vfilter-input:hover {
    border-color: #ccc;
}

.vfilter-input:focus {
    outline: none;
    border-color: var(--vf-border-focus);
    box-shadow: 0 0 0 3px var(--vf-primary-light);
}

.vfilter-input::placeholder {
    color: var(--vf-text-muted);
}

/* ============================================
   Action Buttons
   ============================================ */
.vfilter-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--vf-border);
}

.vfilter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 28px;
    border-radius: var(--vf-radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--vf-transition);
    border: none;
    flex: 1;
}

.vfilter-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.vfilter-btn-search {
    background: linear-gradient(135deg, var(--vf-primary) 0%, var(--vf-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(196, 2, 0, 0.35);
}

button#vfilter-search {
    color: white;
}

.vfilter-btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 2, 0, 0.45);
}

.vfilter-btn-search:active {
    transform: translateY(0);
}

.vfilter-btn-reset {
    background: var(--vf-bg);
    color: var(--vf-text);
    border: 2px solid var(--vf-border);
    max-width: 160px;
}

.vfilter-btn-reset:hover {
    border-color: var(--vf-primary);
    color: var(--vf-primary);
    background: var(--vf-primary-light);
}

.vfilter-btn-reset svg {
    stroke: currentColor;
}

/* ============================================
   Results Section
   ============================================ */
.vfilter-results {
    margin-top: 24px;
    padding: 20px;
    background: var(--vf-bg-alt);
    border-radius: var(--vf-radius);
}

.vfilter-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--vf-border);
}

.vfilter-results-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--vf-text);
}

.vfilter-results-count {
    font-size: 14px;
    color: var(--vf-text-light);
}

.vfilter-results-count strong {
    color: var(--vf-primary);
}

.vfilter-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.vfilter-product-card {
    background: var(--vf-bg);
    border: 1px solid var(--vf-border);
    border-radius: var(--vf-radius-sm);
    padding: 16px;
    transition: var(--vf-transition);
}

.vfilter-product-card:hover {
    box-shadow: var(--vf-shadow-hover);
    border-color: var(--vf-primary);
    transform: translateY(-2px);
}

.vfilter-product-card h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.vfilter-product-card h4 a {
    color: var(--vf-text);
    text-decoration: none;
    transition: var(--vf-transition);
}

.vfilter-product-card h4 a:hover {
    color: var(--vf-primary);
}

.vfilter-product-meta {
    font-size: 13px;
    color: var(--vf-text-light);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vfilter-product-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--vf-bg-alt);
    padding: 4px 8px;
    border-radius: 4px;
}

/* ============================================
   Pagination
   ============================================ */
.vfilter-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.vfilter-pagination a,
.vfilter-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--vf-border);
    border-radius: var(--vf-radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--vf-text);
    transition: var(--vf-transition);
}

.vfilter-pagination a:hover {
    background: var(--vf-primary);
    color: #fff;
    border-color: var(--vf-primary);
}

.vfilter-pagination .current {
    background: var(--vf-primary);
    color: #fff;
    border-color: var(--vf-primary);
}

/* ============================================
   Loading State
   ============================================ */
.vfilter-loading {
    text-align: center;
    padding: 40px;
    color: var(--vf-text-light);
}

.vfilter-loading::after {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--vf-border);
    border-top-color: var(--vf-primary);
    border-radius: 50%;
    animation: vfilter-spin 0.8s linear infinite;
    margin-left: 12px;
    vertical-align: middle;
}

@keyframes vfilter-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   No Results
   ============================================ */
.vfilter-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--vf-text-light);
}

.vfilter-no-results svg {
    width: 48px;
    height: 48px;
    stroke: var(--vf-border);
    margin-bottom: 12px;
}

.vfilter-no-results h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--vf-text);
}

.vfilter-no-results p {
    margin: 0;
    font-size: 14px;
}

/* ============================================
   Horizontal Layout
   ============================================ */
.vfilter-layout-horizontal .vfilter-fields {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ============================================
   Vertical Layout
   ============================================ */
.vfilter-layout-vertical .vfilter-fields {
    grid-template-columns: 1fr;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .vfilter-header {
        padding: 14px 18px;
    }

    .vfilter-title {
        font-size: 16px;
    }

    .vfilter-form {
        padding: 18px;
    }

    .vfilter-fields {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .vfilter-actions {
        flex-direction: column;
    }

    .vfilter-btn {
        width: 100%;
        max-width: 100% !important;
    }

    .vfilter-year-range,
    .vfilter-price-range {
        flex-direction: column;
        align-items: stretch;
    }

    .vfilter-range-sep {
        display: none;
    }

    .vfilter-garage {
        padding: 12px 18px;
        flex-wrap: wrap;
    }

    .vfilter-results-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .vfilter-form {
        padding: 14px;
    }

    .vfilter-btn {
        height: 44px;
        font-size: 14px;
        padding: 0 20px;
    }

    .vfilter-select,
    .vfilter-input {
        height: 42px;
    }
}
