.filter-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  animation: fadeIn 0.2s ease;
}

.filter-panel {
  position: fixed;
  top: 0;
  right: -700px;
  width: 700px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;

  &.visible {
    right: 0;
  }

  @media (max-width: 768px) {
    width: 100%;
    right: -100%;
  }
}

.filter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;

  h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
  }
}

.filter-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;

  .filter-description {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.5rem;
  }
}

.filter-conditions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-condition-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.logical-operator {
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  padding: 0.25rem 0;

  &.first {
    color: #1e293b;
  }

  .logical-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    background: white;
    cursor: pointer;

    &:focus {
      outline: none;
      border-color: #206bc4;
    }
  }
}

.filter-condition {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;

  .condition-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
  }
}

.field-select,
.operator-select,
.value-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  color: #1e293b;

  &:focus {
    outline: none;
    border-color: #206bc4;
    box-shadow: 0 0 0 3px rgba(32, 107, 196, 0.1);
  }

  &:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.6;
  }
}

.value-inputs {
  flex: 1;
  display: flex;
  gap: 0.75rem;
  align-items: center;

  .between-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;

    .between-separator {
      font-size: 0.875rem;
      color: #64748b;
      flex-shrink: 0;
    }

    .value-input {
      flex: 1;
    }
  }
}

.condition-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;

  button {
    width: 36px;
    height: 36px;

    mat-icon {
      font-size: 18px;
      width: 18px;
      height: 18px;
      color: #64748b;
    }

    &:hover mat-icon {
      color: #dc2626;
    }
  }
}

.filter-add-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;

  button {
    justify-content: flex-start;
    color: #206bc4;
    font-weight: 500;

    mat-icon {
      margin-right: 0.5rem;
    }

    &:hover {
      background: #e3f2fd;
    }
  }
}

.filter-panel-footer {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 1.5rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  z-index: 10;

  button {
    flex: 1;
  }
}

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