// Variables matching sidebar/dialog styling
$panel-bg: #1a1a1a;
$text-primary: rgba(255, 255, 255, 0.95);
$text-secondary: rgba(255, 255, 255, 0.6);
$text-muted: rgba(255, 255, 255, 0.4);
$border-color: rgba(255, 255, 255, 0.08);
$hover-bg: rgba(255, 255, 255, 0.08);
$active-color: #818cf8;
$active-bg: rgba(129, 140, 248, 0.15);
$transition-fast: 150ms ease;
$transition-normal: 200ms ease;

.quick-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0, 0, 0, 0.3);
  animation: fadeIn $transition-normal;
  cursor: pointer;
}

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

.quick-settings-panel {
  position: absolute;
  top: 52px;
  right: 60px;
  width: 280px;
  background: $panel-bg;
  border: 1px solid $border-color;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: slideDown 200ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  cursor: default;
}

@keyframes slideDown {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

// Pointer arrow
.pointer {
  position: absolute;
  top: -8px;
  right: 18px;
  width: 16px;
  height: 16px;
  background: $panel-bg;
  border-left: 1px solid $border-color;
  border-top: 1px solid $border-color;
  transform: rotate(45deg);
  border-radius: 3px 0 0 0;
}

.panel-body {
  padding: 16px;
}

.control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;

  &:not(:last-child) {
    border-bottom: 1px solid $border-color;
  }

  > label {
    color: $text-primary;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
  }
}

.control-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

// Mode icons for dark/light mode
.mode-icon {
  font-size: 14px;
  opacity: 0.3;
  transition: all 300ms ease;
  user-select: none;

  &.active {
    opacity: 1;
    transform: scale(1.1);
  }

  &.sun {
    filter: grayscale(100%);

    &.active {
      filter: grayscale(0%);
    }
  }

  &.moon {
    filter: grayscale(100%);

    &.active {
      filter: grayscale(0%);
    }
  }
}

// Toggle switch
.switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: background 300ms ease;
  padding: 0;

  &.active {
    background: $active-color;

    .slider {
      transform: translateX(18px);
    }
  }

  .slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 300ms ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  &:hover {
    background: rgba(255, 255, 255, 0.2);

    &.active {
      background: #9aa3fa;
    }
  }
}

// Stepper control
.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid $border-color;

  button {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.05);
    color: $text-secondary;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all $transition-fast;
    font-weight: 300;

    &:hover {
      background: $hover-bg;
      color: $text-primary;
    }

    &:active {
      transform: scale(0.95);
    }
  }

  span {
    min-width: 50px;
    text-align: center;
    color: $text-primary;
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
}

.panel-footer {
  padding: 12px 16px;
  border-top: 1px solid $border-color;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0 0 12px 12px;
}

.more-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid $border-color;
  border-radius: 8px;
  color: $text-primary;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all $transition-fast;

  &:hover {
    background: $hover-bg;
    border-color: rgba(255, 255, 255, 0.15);
  }

  &:active {
    transform: scale(0.98);
  }
}
