/* ==========================================================================
   SELECT CUSTOM COMPONENT
   Based on: PHASE_7B_DESIGN_PREMIUM_SPEC.md - Select Section
   
   NU folosim native <select> (ugly, non-styleable)
   Implementare custom cu accessibility complet
   ========================================================================== */

.select-wrapper {
  position: relative;
  width: 100%;
}

/* ==========================================================================
   SELECT TRIGGER (button care deschide dropdown-ul)
   ========================================================================== */

.select-trigger {
  /* Dimensions (consistent cu input text) */
  width: 100%;
  height: 56px;
  padding: var(--space-md) 48px var(--space-md) var(--space-lg);  /* Right padding pentru chevron */
  
  /* Typography */
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  color: var(--color-gray-800);
  text-align: left;
  
  /* Appearance */
  background: var(--color-white);
  border: 2px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: none;
  cursor: pointer;
  
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  /* Behavior */
  transition: all var(--transition-base);
  appearance: none;
  -webkit-appearance: none;
}

/* Placeholder (când nu e selectat nimic) */
.select-value:empty::before {
  content: attr(data-placeholder);
  color: var(--color-gray-400);
}

/* ==========================================================================
   SELECT TRIGGER STATES
   ========================================================================== */

/* HOVER */
.select-trigger:hover:not([aria-expanded="true"]) {
  border-color: var(--color-gray-300);
  background: var(--color-gray-50);
}

/* OPEN/FOCUS */
.select-trigger[aria-expanded="true"],
.select-trigger:focus {
  border-color: var(--color-red-600);
  box-shadow: var(--shadow-focus);
  outline: none;
}

/* ==========================================================================
   CHEVRON ICON
   ========================================================================== */

.select-chevron {
  width: 20px;
  height: 20px;
  color: var(--color-gray-500);
  flex-shrink: 0;
  transition: transform var(--transition-base), color var(--transition-base);
}

/* Rotate când e deschis */
.select-trigger[aria-expanded="true"] .select-chevron {
  transform: rotate(180deg);
  color: var(--color-red-600);
}

/* ==========================================================================
   DROPDOWN PANEL
   ========================================================================== */

.select-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-large);
  z-index: 50;
  
  /* Animation */
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--transition-base) var(--ease-out),
              transform var(--transition-base) var(--ease-out);
  pointer-events: none;
}

/* Visible state */
.select-dropdown:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   OPTIONS CONTAINER
   ========================================================================== */

.select-options {
  max-height: 320px;
  overflow-y: auto;
  padding: var(--space-sm);
  
  /* Custom scrollbar (optional, pentru estetic) */
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-300) transparent;
}

.select-options::-webkit-scrollbar {
  width: 8px;
}

.select-options::-webkit-scrollbar-track {
  background: transparent;
}

.select-options::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: var(--radius-sm);
}

.select-options::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* ==========================================================================
   OPTION ITEMS
   ========================================================================== */

.select-option {
  /* Dimensions */
  width: 100%;
  padding: var(--space-sm) var(--space-md);  /* 12px 16px */
  
  /* Typography */
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  color: var(--color-gray-600);
  text-align: left;
  
  /* Appearance */
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  /* Behavior */
  transition: background var(--transition-fast);
}

/* HOVER */
.select-option:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-800);
}

/* SELECTED */
.select-option[aria-selected="true"] {
  background: var(--color-red-50);
  color: var(--color-red-600);
  font-weight: var(--font-weight-medium);
}

/* Checkmark icon pentru selected option */
.select-option[aria-selected="true"]::after {
  content: '✓';
  font-size: var(--font-size-base);
  color: var(--color-red-600);
  margin-left: var(--space-sm);
}

/* DISABLED */
.select-option:disabled {
  color: var(--color-gray-300);
  cursor: not-allowed;
  opacity: 0.5;
}

.select-option:disabled:hover {
  background: transparent;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.select-trigger:focus-visible {
  box-shadow: var(--shadow-focus-strong);
}

/* Screen reader only text */
.select-wrapper [role="status"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

