/**
 * Theme Picker Widget - Refactored with BEM Methodology
 */

/* ========== THEME PICKER CONTAINER ========== */

.theme-picker {
  left: 0;
  justify-content: flex-start;
  height: calc(100vh - 100px);
  max-height: fit-content;
  width: 380px;
  gap: var(--space-2);
  border-radius: var(--radius-8) var(--radius-8) var(--radius-far) var(--radius-far);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  user-select: none;
}

.theme-picker * {
  user-select: none;
  -webkit-user-select: none;
}

.theme-picker__wrapper {
  width: 100%;
  padding: var(--space-6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.theme-picker__wrapper::-webkit-scrollbar {
  display: none;
}

/* ========== COLOR MODES (Light/Dark/Pure) ========== */

.theme-picker__color-modes {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 100%;
}

.theme-picker__color-mode {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  height: 40px;
  font-weight: 600;
  border-radius: var(--radius-2);
  color: var(--color-text-muted);
  font-size: 1rem;
  will-change: auto;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.theme-picker__color-mode:hover {
  padding: var(--space-2) var(--space-6);
}

.theme-picker__color-mode.active {
  background: var(--color-primary);
  color: var(--color-text);
  font-weight: 800;
}

.theme-picker__color-mode svg,
.theme-picker__color-mode svg path {
  color: inherit;
  width: 20px;
  height: 20px;
}

.theme-picker__color-mode--light {
  border-radius: var(--radius-2) var(--radius-5) var(--radius-5) var(--radius-2);
  padding-left: var(--space-2);
}

.theme-picker__color-mode--dark {
  border-radius: var(--radius-2);
}

.theme-picker__color-mode--pure {
  border-radius: var(--radius-5) var(--radius-2) var(--radius-2) var(--radius-5);
  padding-right: var(--space-2);
}

/* ========== COLOR THEMES ========== */

.theme-picker__color-themes {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  border-radius: var(--radius-far);
  padding: var(--space-6);
}

.theme-picker__color-themes span {
  font-size: 1.4rem;
  font-weight: 700;
}

.theme-picker__color-themes-title {
  display: flex;
  justify-content: flex-start;
}

.theme-picker__color-themes-buttons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  flex-wrap: wrap;
}

.theme-picker__color-theme {
  width: calc((100% / 4) - 6px);
  height: 32px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-4);
  border: solid 1px #ffffff33;
  box-shadow: inset 0 1px 0 0 #ffffff33;
  will-change: transform;
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-picker__color-theme:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

.theme-picker__color-theme:active {
  transform: translateY(0);
}

/* ========== FONT SIZE CONTROL ========== */

.theme-picker__font-size {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  height: 80px;
  border-radius: var(--radius-far);
  padding: var(--space-6);
}

.theme-picker__font-size-right {
  width: calc(50% - var(--space-2));
  flex-grow: 0;
  flex-shrink: 0;
}

.theme-picker__font-size-text--title {
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 700;
}

.theme-picker__font-size-text--size{
  width: 100%;
  text-align: center;
  font-size: 1.4rem;
  padding: 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 20px;
  will-change: width;
  font-weight: 600;
}

.theme-picker__font-size-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 50%;
  height: 50px;
  background: transparent;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-5);
  overflow: hidden;
}

.theme-picker__font-size-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
  height: 40px;
  padding: 6px 0 12px;
  line-height: 1;
  border-radius: var(--radius-2);
  background: transparent;
  color: #888;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 2rem;
  font-weight: 400;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  will-change: width, font-weight;
}

.theme-picker__font-size-button:active {
  width: 100%;
  font-weight: 600;
  scale: 1;
}

.theme-picker__font-size-button--plus {
  color: var(--color-success);
  border-radius: var(--radius-2) var(--radius-5) var(--radius-5) var(--radius-2);
}

.theme-picker__font-size-button--minus {
  color: var(--color-danger);
  border-radius: var(--radius-5) var(--radius-2) var(--radius-2) var(--radius-5);
}

/* ========== BLUR EFFECT TOGGLE ========== */

.theme-picker__blur-effect {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  height: 80px;
  border-radius: var(--radius-far) var(--radius-far) var(--radius-close) var(--radius-close);
  padding: var(--space-6);
}

.theme-picker__blur-effect-text {
  flex-basis: 50%;
  width: 100%;
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 700;
}

.theme-picker__blur-effect-text--title {
  font-size: 1.4rem;
}

.theme-picker__blur-effect-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-basis: 50%;
  width: 100%;
  height: 40px;
  border-radius: var(--radius-5);
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 1rem;
  overflow: hidden;
  cursor: pointer;
  border: none;
  transition: var(--transition-normal);
}

.theme-picker__blur-effect-button span {
  color: inherit;
  transform: translateY(0);
  transition: transform var(--transition-normal);
}

.theme-picker__blur-effect-button::after {
  content: 'غیرفعال';
  color: var(--color-danger);
  position: absolute;
  transform: translateY(36px);
  transition: transform var(--transition-normal);
}

.theme-picker__blur-effect-button.disable {
  background: var(--color-danger-bg);
}

.theme-picker__blur-effect-button.disable span {
  transform: translateY(-36px);
}

.theme-picker__blur-effect-button.disable::after {
  transform: translateY(0);
}

/* ========== ANIMATION TOGGLE ========== */

.theme-picker__animation {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  height: 80px;
  margin-top: -10px;
  border-radius: var(--radius-close) var(--radius-close) var(--radius-far) var(--radius-far);
  padding: var(--space-6);
}

.theme-picker__animation-text {
  flex-basis: 50%;
  width: 100%;
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 700;
}

.theme-picker__animation-text--title {
  font-size: 1.4rem;
}

.theme-picker__animation-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-basis: 50%;
  width: 100%;
  height: 40px;
  border-radius: var(--radius-5);
  background: var(--color-success-bg);
  color: var(--color-success);
  font-size: 1rem;
  overflow: hidden;
  cursor: pointer;
  border: none;
  transition: var(--transition-normal);
}

.theme-picker__animation-button span {
  color: inherit;
  transform: translateY(0);
  transition: transform var(--transition-normal);
}

.theme-picker__animation-button::after {
  content: 'غیرفعال';
  color: var(--color-danger);
  position: absolute;
  transform: translateY(36px);
  transition: transform var(--transition-normal);
}

.theme-picker__animation-button.disable {
  background: var(--color-danger-bg);
}

.theme-picker__animation-button.disable span {
  transform: translateY(-36px);
}

.theme-picker__animation-button.disable::after {
  transform: translateY(0);
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */

@media (max-width: 768px) {
  .theme-picker {
    width: 90vw;
    max-width: 380px;
  }

  .theme-picker__wrapper {
    padding: var(--space-4);
  }

  .theme-picker__color-themes,
  .theme-picker__font-size,
  .theme-picker__blur-effect,
  .theme-picker__animation {
    padding: var(--space-4);
  }
}
