/* Simplifies the time-range popup on embedded dashboards.
   Hides extra elements in DateFilterControl:
     - "Type of range",
     - Relative/Absolute date toggle,
     - "Anchor to" block,
     - "Actual time interval" block,
     - "Cancel" button.
   Also hides time-panel and footer of the picker.
   Selectors are structural (classes/data-test), not tied to visible text.
    See docker/patch/embedded_public_dashboards/time_range_popover_simplify/README.md */

/* "Type of range" and its surroundings */
.time-range-popover .control-label:not([data-test="custom-frame"] .control-label) {
  display: none !important;
}

.time-range-popover .control-label:not([data-test="custom-frame"] .control-label) + *:has(.ant-select) {
  display: none !important;
}

.time-range-popover .control-label:not([data-test="custom-frame"] .control-label) + *:has(.ant-select) + .ant-divider-horizontal {
  display: none !important;
}

/* Relative/Absolute date toggle inside custom-frame */
.time-range-popover [data-test="custom-frame"] .control-label + *:has(.ant-select) {
  display: none !important;
}

/* "Anchor to" block */
.time-range-popover [data-test="custom-frame"] .control-anchor-to {
  display: none !important;
}

/* "Actual time interval" heading */
.time-range-popover [data-test="custom-frame"] > .section-title {
  display: none !important;
}

/* "Actual time interval" content (excluding footer) */
.time-range-popover [data-test="custom-frame"] ~ div:not(.footer) {
  display: none !important;
}

/* "Cancel" button */
.time-range-popover [data-test="cancel-button"] {
  display: none !important;
}

/* Picker time-panel and footer */
.ant-picker-dropdown .ant-picker-time-panel {
  display: none !important;
}

.ant-picker-dropdown .ant-picker-footer {
  display: none !important;
}

/* Top margin for the "Apply" button */
.time-range-popover .footer {
  margin-top: 24px !important;
}
