/* ============================================
   Theme Selector UI - ממשק בחירת תמה
   ============================================ */

@layer components {
  /* Theme Selector Container */
  .theme-selector {
    position: relative;
    display: inline-block;
  }

  /* כפתור בחירת תמה - מוסתר זמנית */
  .theme-selector-btn {
    display: none; /* מוסתר זמנית */
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: -9999px;
  }

  .theme-selector-btn:hover {
    background: var(--primary-soft);
    border-color: var(--primary-300);
    color: var(--primary-700);
  }

  .theme-selector-btn i {
    font-size: 1rem;
  }

  .theme-selector-label {
    display: none;
  }

  @media (min-width: 768px) {
    .theme-selector-label {
      display: inline;
    }
  }

  /* Dropdown */
  .theme-selector-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    inset-inline-end: 0;
    min-width: 280px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity var(--transition-base), visibility var(--transition-base), transform var(--transition-base);
    z-index: var(--z-dropdown);
  }

  .theme-selector-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Theme Option */
  .theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
  }

  .theme-option:hover {
    background: var(--primary-soft);
  }

  .theme-option.active {
    background: var(--primary-soft-strong);
  }

  /* תצוגה מקדימה */
  .theme-option-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
  }

  .theme-preview-light {
    background: linear-gradient(135deg, var(--secondary-50) 0%, var(--secondary-200) 55%, var(--secondary-300) 100%);
  }

  .theme-preview-light::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  }

  .theme-preview-light::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: var(--bg-surface);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .theme-preview-dark {
    background: linear-gradient(135deg, var(--secondary-900) 0%, var(--secondary-800) 50%, var(--secondary-700) 100%);
  }

  .theme-preview-dark::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: rgba(44, 62, 80, 0.95);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  }

  .theme-preview-dark::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: var(--secondary-700);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .theme-preview-auto {
    background: linear-gradient(135deg, var(--secondary-50) 0%, var(--secondary-900) 100%);
    position: relative;
  }

  .theme-preview-auto::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  }

  .theme-preview-auto::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--secondary-700);
  }


  /* מידע על תמה */
  .theme-option-info {
    flex: 1;
    min-width: 0;
  }

  .theme-option-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-main);
    margin-bottom: 0.15rem;
  }

  .theme-option-desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
  }

  /* סימן בחירה */
  .theme-option-check {
    color: var(--primary-600);
    font-size: 1rem;
    display: none;
  }

  .theme-option.active .theme-option-check {
    display: block;
  }

  /* RTL Support */
  html[dir="rtl"] .theme-selector-dropdown {
    inset-inline-end: 0;
    inset-inline-start: auto;
  }

  /* Responsive */
  @media (max-width: 767px) {
    .theme-selector-dropdown {
      min-width: 240px;
    }
    
    .theme-selector-label {
      display: none;
    }
  }
}

/* ============================================
   Dark Theme - עיצוב כפתור בחירת תמה
   ============================================ */

[data-theme="dark"] .theme-selector-btn {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

[data-theme="dark"] .theme-selector-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-300);
  color: var(--primary);
}

[data-theme="dark"] .theme-selector-dropdown {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .theme-option:hover {
  background: var(--primary-soft);
}

[data-theme="dark"] .theme-option.active {
  background: var(--primary-soft-strong);
}

[data-theme="dark"] .theme-option-name {
  color: var(--text-main);
}

[data-theme="dark"] .theme-option-desc {
  color: var(--text-muted);
}

/* ============================================
   Light Theme - הוסר - רק dark mode נתמך
   ============================================ */
  
  /* כל ההגדרות של [data-theme="light"] הוסרו - רק dark mode נתמך */

