/**
 * Theme UI Controls Styles
 */

.theme-toggle-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  backdrop-filter: blur(8px);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-base);
}

.theme-toggle-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.theme-toggle-label {
  display: none;
}

@media (min-width: 768px) {
  .theme-toggle-label {
    display: inline;
  }
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 280px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  backdrop-filter: blur(20px);
  pointer-events: none;
}

.theme-dropdown[aria-hidden="false"],
.theme-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.theme-dropdown-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.theme-dropdown-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.theme-dropdown-content {
  padding: 1.25rem;
}

.theme-auto-toggle {
  margin-bottom: 1.5rem;
}

.theme-switch-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.theme-switch-input {
  position: relative;
  width: 44px;
  height: 24px;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.theme-switch-input:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.theme-switch-input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-base);
}

.theme-switch-input:checked::before {
  transform: translateX(20px);
}

.theme-switch-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.theme-switch-desc {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin: 0;
  margin-left: 52px;
}

.theme-manual-select {
  margin-bottom: 1.5rem;
}

.theme-select-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.theme-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

.theme-select:hover:not(:disabled) {
  background: var(--color-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 12px;
  border-color: var(--color-primary);
}

.theme-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.theme-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Style select dropdown options - Note: Browser limitations apply */
.theme-select option {
  background: var(--color-card);
  color: var(--color-text);
  padding: 0.5rem;
}

/* Webkit browsers (Chrome, Safari, Edge) */
.theme-select option {
  background: var(--color-card);
  color: var(--color-text);
}

/* Firefox */
@-moz-document url-prefix() {
  .theme-select option {
    background: var(--color-card);
    color: var(--color-text);
  }
}

.theme-current-info {
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.theme-current-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem 0;
}

.theme-current-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
  text-transform: capitalize;
}

/* Theme-specific colors for current theme name */
.theme-current-name.theme-halloween {
  color: #ff6f3c;
}

.theme-current-name.theme-winter {
  color: #4a9eff;
}

.theme-current-name.theme-christmas {
  color: #e63946;
}

.theme-current-name.theme-easter {
  color: #ff6b9d;
}

.theme-current-name.theme-fourth-of-july {
  color: #e63946;
}

.theme-current-name.theme-default {
  color: #6b8eff;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .theme-dropdown {
    width: calc(100vw - 2rem);
    right: -1rem;
  }

  .theme-toggle-container {
    margin-left: auto;
  }
}

