/* ============================================
   BAAB AutoScout24 - Premium Filter Design
   Webflow-inspired, Professional, Modern
   Color Scheme: #263085 (Primary)
   ============================================ */

/* ===== Dropdown List Styling (for better browser support) ===== */
/* Note: Native select dropdowns have limited customization.
   For full control, consider using a custom dropdown component. */
select {
  /* Remove default browser styling */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Firefox specific dropdown styling */
@-moz-document url-prefix() {
  .as24-filter-field select option,
  .as24-sort-field select option {
    background-color: #ffffff !important;
    color: #1a202c !important;
  }
  
  .as24-filter-field select option:checked,
  .as24-sort-field select option:checked {
    background-color: #263085 !important;
    color: #ffffff !important;
  }
}

/* Webkit browsers (Chrome, Safari, Edge) dropdown styling */
select::-webkit-scrollbar {
  width: 8px;
}

select::-webkit-scrollbar-track {
  background: #f6f6f6;
  border-radius: 4px;
}

select::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 4px;
}

select::-webkit-scrollbar-thumb:hover {
  background: #b8b8b8;
}

/* ===== CSS Variables ===== */
:root {
  --as24-primary: #263085;
  --as24-primary-dark: #1a2361;
  --as24-primary-light: #3d4ba3;
  --as24-primary-lighter: #5a6bc4;
  --as24-primary-ultra-light: #e8ebf5;
  
  --as24-secondary: #4a5568;
  --as24-secondary-light: #718096;
  --as24-secondary-lighter: #a0aec0;
  
  --as24-success: #10b981;
  --as24-success-light: #34d399;
  --as24-success-bg: #d1fae5;
  
  --as24-danger: #ef4444;
  --as24-danger-light: #f87171;
  --as24-danger-bg: #fee2e2;
  
  --as24-warning: #f59e0b;
  --as24-warning-light: #fbbf24;
  --as24-warning-bg: #fef3c7;
  
  --as24-bg: #f6f6f6;
  --as24-bg-secondary: #ffffff;
  --as24-bg-tertiary: #e8e8e8;
  --as24-bg-hover: #ffffff;
  
  --as24-border: #d4d4d4;
  --as24-border-light: #e8e8e8;
  --as24-border-dark: #b8b8b8;
  
  --as24-text: #1a202c;
  --as24-text-secondary: #334155;
  --as24-text-tertiary: #64748b;
  --as24-text-light: #94a3b8;
  
  --as24-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --as24-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  --as24-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
  --as24-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
  --as24-shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.12);
  
  --as24-radius-sm: 6px;
  --as24-radius: 8px;
  --as24-radius-md: 12px;
  --as24-radius-lg: 16px;
  --as24-radius-xl: 20px;
  
  --as24-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --as24-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --as24-transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Main Filter Container ===== */
.as24-filters {
  background: #f6f6f6 !important;
  border: 1px solid var(--as24-border);
  border-radius: var(--as24-radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: var(--as24-transition);
  position: relative;
  overflow: hidden;
}

.as24-filters::before {
  display: none;
}

.as24-filters:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--as24-border-dark);
}

/* ===== Filter Group ===== */
.as24-filter-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .as24-filter-group {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ===== Filter Field ===== */
.as24-filter-field {
  position: relative;
  display: flex;
  flex-direction: column;
}

.as24-filter-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  text-transform: none;
  line-height: 1.4;
}

/* ===== Input & Select Styling ===== */
.as24-filter-field input[type="number"],
.as24-filter-field select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--as24-border);
  border-radius: var(--as24-radius);
  font-size: 14px;
  font-weight: 400;
  color: #1a202c;
  background: var(--as24-bg-secondary) !important;
  background-color: var(--as24-bg-secondary) !important;
  background-image: none !important;
  box-sizing: border-box;
  transition: var(--as24-transition);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  outline: none;
  line-height: 1.5;
  font-family: inherit;
}

.as24-filter-field input[type="number"]:focus,
.as24-filter-field select:focus {
  border-color: var(--as24-primary);
  background: var(--as24-bg-secondary);
  box-shadow: 0 0 0 3px rgba(38, 48, 133, 0.1);
  outline: none;
}

.as24-filter-field input[type="number"]:hover,
.as24-filter-field select:hover {
  border-color: var(--as24-border-dark);
  background: var(--as24-bg-secondary);
}

.as24-filter-field input[type="number"]::placeholder {
  color: #94a3b8;
  opacity: 0.8;
}

/* ===== Select Dropdown Arrow ===== */
.as24-filter-field select {
  background: var(--as24-bg-secondary) !important;
  background-color: var(--as24-bg-secondary) !important;
  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='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px !important;
  padding-right: 40px;
  cursor: pointer;
}

.as24-filter-field select:focus {
  background: var(--as24-bg-secondary) !important;
  background-color: var(--as24-bg-secondary) !important;
  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='%23263085' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px !important;
}

.as24-filter-field select:hover {
  background: var(--as24-bg-secondary) !important;
  background-color: var(--as24-bg-secondary) !important;
  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='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px !important;
}

/* ===== Select Option Styling ===== */
.as24-filter-field select {
  /* Dropdown açıldığında görünen liste için */
  border-radius: var(--as24-radius);
}

.as24-filter-field select option {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  color: #1a202c !important;
  padding: 12px 16px !important;
  margin: 0 !important;
  border: none !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}

.as24-filter-field select option:hover {
  background: #263085 !important;
  background-color: #263085 !important;
  background-image: none !important;
  color: #ffffff !important;
}

.as24-filter-field select option:checked,
.as24-filter-field select option:focus {
  background: #263085 !important;
  background-color: #263085 !important;
  background-image: none !important;
  color: #ffffff !important;
}

.as24-filter-field select option:selected {
  background: #263085 !important;
  background-color: #263085 !important;
  background-image: none !important;
  color: #ffffff !important;
}

/* ===== Range Inputs (Min/Max) ===== */
.as24-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.as24-range input[type="number"] {
  width: 100%;
}

.as24-range span {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  padding: 0 4px;
  user-select: none;
}

/* ===== Hidden Model Field ===== */
.as24-filter-modele-hidden {
  display: none !important;
}

/* ===== Filter Actions (Buttons) ===== */
.as24-filters-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  padding-top: 20px;
  border-top: 1px solid var(--as24-border);
  margin-top: 8px;
}

@media (max-width: 768px) {
  .as24-filters-actions {
    flex-direction: column;
  }
  
  .as24-filters-actions button,
  .as24-filters-actions .as24-btn {
    width: 100%;
  }
}

/* ===== Button Styles ===== */
.as24-btn,
.as24-filters button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--as24-radius);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background-color:#263085!important;
  color:#fff!important;
  transition: var(--as24-transition);
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.as24-filters button[type="submit"] {
  background: var(--as24-primary);
  color: #ffffff;
  min-width: 140px;
}

.as24-filters button[type="submit"]:hover {
  background: var(--as24-primary-dark);
  box-shadow: 0 4px 8px rgba(38, 48, 133, 0.2);
  transform: translateY(-1px);
}

.as24-filters button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ===== Reset Button ===== */
.as24-btn-reset {
  background: var(--as24-bg-secondary);
  color: #475569;
  border: 1px solid var(--as24-border);
}

.as24-btn-reset:hover {
  background: var(--as24-bg-tertiary);
  color: #334155;
  border-color: var(--as24-border-dark);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.as24-btn-reset:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ===== Other Button Variants ===== */
.as24-btn-pdf {
  background: var(--as24-secondary);
  color: #ffffff;
}

.as24-btn-pdf:hover {
  background: var(--as24-secondary-light);
  box-shadow: var(--as24-shadow-md);
  transform: translateY(-1px);
}

.as24-btn-offer {
  background: linear-gradient(135deg, var(--as24-success) 0%, var(--as24-success-light) 100%);
  color: #ffffff;
}

.as24-btn-offer:hover {
  background: linear-gradient(135deg, #059669 0%, var(--as24-success) 100%);
  box-shadow: var(--as24-shadow-md);
  transform: translateY(-1px);
}

/* ===== Sort Form ===== */
.as24-sort-form {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: var(--as24-bg-secondary);
  border: 1px solid var(--as24-border);
  border-radius: var(--as24-radius-md);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: var(--as24-transition);
}

.as24-sort-form:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  border-color: var(--as24-border-dark);
}

@media (max-width: 768px) {
  .as24-sort-form {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
}

.as24-sort-field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.as24-sort-field label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin: 0;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.as24-sort-field select {
  flex: 1;
  min-width: 220px;
  padding: 12px 40px 12px 16px;
  border: 1px solid var(--as24-border);
  border-radius: var(--as24-radius);
  font-size: 14px;
  font-weight: 400;
  color: #1a202c;
  background: var(--as24-bg-secondary) !important;
  background-color: var(--as24-bg-secondary) !important;
  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='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px !important;
  cursor: pointer;
  transition: var(--as24-transition);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.as24-sort-field select:focus {
  border-color: var(--as24-primary);
  background: var(--as24-bg-secondary) !important;
  background-color: var(--as24-bg-secondary) !important;
  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='%23263085' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px !important;
  box-shadow: 0 0 0 3px rgba(38, 48, 133, 0.1);
  outline: none;
}

.as24-sort-field select:hover {
  border-color: var(--as24-border-dark);
  background: var(--as24-bg-secondary) !important;
  background-color: var(--as24-bg-secondary) !important;
  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='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px !important;
}

/* ===== Sort Select Option Styling ===== */
.as24-sort-field select {
  /* Dropdown açıldığında görünen liste için */
  border-radius: var(--as24-radius);
}

.as24-sort-field select option {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  color: #1a202c !important;
  padding: 12px 16px !important;
  margin: 0 !important;
  border: none !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}

.as24-sort-field select option:hover {
  background: #263085 !important;
  background-color: #263085 !important;
  background-image: none !important;
  color: #ffffff !important;
}

.as24-sort-field select option:checked,
.as24-sort-field select option:focus {
  background: #263085 !important;
  background-color: #263085 !important;
  background-image: none !important;
  color: #ffffff !important;
}

.as24-sort-field select option:selected {
  background: #263085 !important;
  background-color: #263085 !important;
  background-image: none !important;
  color: #ffffff !important;
}

/* ===== Loading Overlay (for AJAX) ===== */
.as24-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  border-radius: var(--as24-radius);
  animation: fadeIn 0.2s ease-in-out;
}

.as24-loading-overlay > div {
  text-align: center;
  color: var(--as24-text-secondary);
}

.as24-loading-overlay > div > div:first-child {
  font-size: 24px;
  margin-bottom: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

.as24-loading-overlay > div > div:last-child {
  font-size: 14px;
  font-weight: 500;
  color: var(--as24-text-secondary);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ===== Focus Visible (Accessibility) ===== */
.as24-filter-field input:focus-visible,
.as24-filter-field select:focus-visible,
.as24-filters button:focus-visible,
.as24-btn:focus-visible {
  outline: 2px solid var(--as24-primary);
  outline-offset: 2px;
}

/* ===== Disabled State ===== */
.as24-filter-field input:disabled,
.as24-filter-field select:disabled,
.as24-filters button:disabled,
.as24-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Print Styles ===== */
@media print {
  .as24-filters,
  .as24-sort-form {
    display: none;
  }
}

/* ===== Dark Mode Support (Disabled - Using Light Theme) ===== */
@media (prefers-color-scheme: dark) {
  .as24-filters {
    background: #f6f6f6 !important;
  }
  
  :root {
    --as24-bg: #f6f6f6;
    --as24-bg-secondary: #ffffff;
    --as24-bg-tertiary: #e8e8e8;
    --as24-text: #1a202c;
    --as24-text-secondary: #334155;
    --as24-text-tertiary: #64748b;
    --as24-border: #d4d4d4;
    --as24-border-dark: #b8b8b8;
  }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
  .as24-filter-field input,
  .as24-filter-field select {
    border-width: 2px;
  }
  
  .as24-filters button,
  .as24-btn {
    border: 2px solid currentColor;
  }
}

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