/* 
FLUTTER-STYLE FILTER MODAL
Exact match with Flutter app screenshot
*/

/* Filter Button - Flutter Style */
.filter-button,
.flutter-filter-btn {
  background: transparent;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  position: relative;
}

.filter-button:hover,
.flutter-filter-btn:hover {
  background: #f8f9fa;
  border-color: #721e2c;
}

.filter-button svg,
.flutter-filter-btn i {
  width: 20px;
  height: 20px;
  color: #8e8e93;
}

.filter-button:hover svg,
.flutter-filter-btn:hover i {
  color: #721e2c;
}

/* Filter Badge - Active Filter Indicator */
.filter-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ff3b30;
  color: white;
  font-size: 10px;
  border-radius: 50%;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Filter Indicator - Flutter Style */
.filter-indicator {
  background: #ffebee;
  border: 1px solid #ffd8dc;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideInDown 0.3s ease-out;
}

.filter-indicator.hidden {
  display: none;
  opacity: 0;
  transform: translateY(-20px);
}

.filter-indicator-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}

.filter-icon-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  white-space: nowrap;
  min-width: 0;
}

.filter-icon-text svg {
  color: #8b2635;
  flex-shrink: 0;
}

.filter-text {
  color: #333333;
  font-size: 12px;
  font-weight: 500;
  margin-right: 4px;
}

.filter-values {
  color: #8b2635;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.clear-filter-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b2635;
}

.clear-filter-btn:hover {
  background: #ffd8dc;
  color: #721e2c;
}

.clear-filter-btn svg {
  display: block;
}

/* =================================
   DARK MODE STYLES
   ================================= */

/* DARK MODE - Apply to all filter components */
@media (prefers-color-scheme: dark) {
  /* Filter Button Dark Mode */
  .filter-button,
  .flutter-filter-btn {
    background: #1c1c1e !important;
    border-color: #333333 !important;
    color: #ffffff !important;
  }

  .filter-button:hover,
  .flutter-filter-btn:hover {
    background: #2c2c2e !important;
    border-color: #444444 !important;
  }

  .filter-button svg,
  .flutter-filter-btn i {
    color: #ffffff !important;
  }

  .filter-button:hover svg,
  .flutter-filter-btn:hover i {
    color: #721e2c !important;
  }

  /* Filter Badge Dark Mode */
  .filter-badge {
    background: #ff453a !important;
    color: #ffffff !important;
  }

  /* Filter Indicator Dark Mode */
  .filter-indicator {
    background: #2c2c2e !important;
    border: 1px solid #444444 !important;
  }

  .filter-icon-text svg {
    color: #ff8a95 !important;
  }

  .filter-text {
    color: #ffffff !important;
  }

  .filter-values {
    color: #ff8a95 !important;
  }

  .clear-filter-btn {
    color: #ff8a95 !important;
  }

  .clear-filter-btn:hover {
    background: #444444 !important;
    color: #ff8a95 !important;
  }

  /* Filter Modal Dark Mode */
  .filter-modal-content {
    background: #1c1c1e !important;
    border: 1px solid #333333 !important;
  }

  .filter-modal-header h3 {
    color: #ffffff !important;
  }

  .close-filter-btn {
    color: #ffffff !important;
  }

  .close-filter-btn:hover {
    background: #2c2c2e !important;
  }

  /* Filter Form Elements Dark Mode */
  .filter-group label {
    color: #ffffff !important;
  }

  .filter-dropdown {
    background: #2c2c2e !important;
    border-color: #444444 !important;
    color: #ffffff !important;
  }

  .filter-dropdown:focus {
    border-color: #721e2c !important;
    outline: none;
  }

  /* Time Frame Buttons Dark Mode */
  .time-frame-chip {
    background: #2c2c2e !important;
    border-color: #444444 !important;
    color: #ffffff !important;
  }

  .time-frame-chip.active,
  .time-frame-chip:hover {
    background: #721e2c !important;
    border-color: #721e2c !important;
    color: #ffffff !important;
  }

  /* Apply Filter Button Dark Mode */
  .apply-filter-btn {
    background: #721e2c !important;
    color: #ffffff !important;
  }

  .apply-filter-btn:hover {
    background: #8b2635 !important;
  }

  /* Reset Filter Button Dark Mode */
  .reset-filter-btn {
    background: #2c2c2e !important;
    border-color: #444444 !important;
    color: #ffffff !important;
  }

  .reset-filter-btn:hover {
    background: #444444 !important;
  }
}

/* Additional dark mode selectors for better compatibility */
[data-theme='dark'] .filter-button,
[data-theme='dark'] .flutter-filter-btn,
body.dark-mode .filter-button,
body.dark-mode .flutter-filter-btn,
.dark-mode .filter-button,
.dark-mode .flutter-filter-btn {
  background: #1c1c1e !important;
  border-color: #333333 !important;
  color: #ffffff !important;
}

[data-theme='dark'] .filter-indicator,
body.dark-mode .filter-indicator,
.dark-mode .filter-indicator {
  background: #2c2c2e !important;
  border: 1px solid #444444 !important;
}

[data-theme='dark'] .filter-text,
body.dark-mode .filter-text,
.dark-mode .filter-text {
  color: #ffffff !important;
}

[data-theme='dark'] .filter-values,
body.dark-mode .filter-values,
.dark-mode .filter-values {
  color: #ff8a95 !important;
}

/* Filter Modal - Flutter Light Design */
.filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.filter-modal.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.filter-modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 24px;
}

/* Filter Modal Header - Flutter Style */
.filter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0;
  border: none;
}

.filter-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #333333;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.close-modal-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #666666;
  transition: all 0.2s ease;
}

.close-modal-btn:hover {
  background: #f0f0f0;
  color: #333333;
}

/* Filter Form - Flutter Style */
.filter-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-group {
  margin-bottom: 0;
}

.filter-group label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.filter-group .filter-subtitle {
  font-size: 13px;
  color: #666666;
  font-weight: 400;
  margin-bottom: 12px;
  margin-top: -4px;
}

/* Flutter-style Dropdowns */
.filter-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  color: #333333;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.filter-select:focus {
  outline: none;
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Time Frame Buttons - Flutter Style */
.time-frame-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 6px;
  margin-bottom: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.time-frame-btn {
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  background: #ffffff;
  color: #666666;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: fit-content;
}

.time-frame-btn:hover {
  background: #f8f9fa;
  border-color: #007aff;
}

.time-frame-btn.active {
  background: #007aff;
  color: #ffffff;
  border-color: #007aff;
}

.time-frame-btn.selected {
  background: #007aff;
  color: #ffffff;
  border-color: #007aff;
}

/* Filter Actions - Flutter Style */
.filter-actions {
  display: flex;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.filter-apply-btn {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: #8b2635;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-apply-btn:hover {
  background: #721e2c;
  transform: translateY(-1px);
}

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

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 480px) {
  .filter-modal {
    padding: 16px;
  }

  .filter-modal-content {
    padding: 20px;
    border-radius: 12px;
  }

  .time-frame-buttons {
    gap: 3px;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    margin-top: 4px;
    margin-bottom: 2px;
  }

  .time-frame-btn {
    padding: 4px 8px;
    font-size: 11px;
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 12px;
  }

  .filter-actions {
    flex-direction: column;
    gap: 8px;
  }
}
