/* ==========================================================================
   1. Custom Select Component with Liquid Glass Dropdown
   ========================================================================== */
.custom-select-group {
  position: relative;
  display: flex;
  flex-direction: column;
}

.custom-select-box {
  position: relative;
  width: 100%;
  border-radius: 10px;
  user-select: none;
  z-index: 1;
}

.custom-select-box.is-open {
  z-index: 100;
}

/* Hidden native select for form serialization */
.custom-select-box select.custom-select-native-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  clip: rect(0, 0, 0, 0) !important;
}

/* Custom Trigger Button */
.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-slate-dark);
  text-align: start;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.custom-select-trigger:hover {
  border-color: var(--brand-gold-metallic, #d4af37);
  background: #FFFFFF;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.15);
}

.custom-select-box.is-open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--brand-gold-metallic, #d4af37);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

/* Form validation error indicator on trigger */
.custom-select-box select.form-input-error ~ .custom-select-trigger,
.custom-select-box:has(select.form-input-error) .custom-select-trigger {
  border-color: #DC2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25) !important;
}

.custom-select-trigger-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.custom-select-lead-icon {
  color: var(--brand-teal, #25605a);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custom-select-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--brand-slate-dark, #0f172a);
}

.custom-select-label.is-placeholder {
  color: var(--brand-slate-muted, #64748b);
  font-weight: 500;
}

.custom-select-chevron {
  color: var(--brand-gold-metallic, #d4af37);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-box.is-open .custom-select-chevron {
  transform: rotate(180deg);
}

/* Custom Dropdown Menu Panel */
.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  inset-inline-end: 0;
  width: 100%;
  z-index: 1050;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16), 0 4px 10px rgba(0, 0, 0, 0.04);
  padding: 8px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
  pointer-events: none;
}

.custom-select-box.is-open .custom-select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Search Box inside Custom Dropdown */
.custom-select-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 8px;
  margin-bottom: 6px;
}

.custom-select-search i {
  color: var(--brand-slate-muted, #64748b);
  font-size: 12px;
}

.custom-select-search-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 13px;
  color: var(--brand-slate-dark, #0f172a);
}

.custom-select-search-input::placeholder {
  color: #94A3B8;
}

/* Options List */
.custom-select-options {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

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

.custom-select-options::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 4px;
}

/* Individual Option Item */
.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-slate-dark, #0f172a);
  transition: all 0.15s ease;
  text-align: start;
}

.custom-select-option:hover,
.custom-select-option.is-focused {
  background: rgba(37, 96, 90, 0.09);
  color: var(--brand-emerald, #1b4d3e);
}

.custom-select-option.is-selected {
  background: rgba(212, 175, 55, 0.14);
  color: var(--brand-emerald, #1b4d3e);
  font-weight: 800;
}

.custom-option-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.custom-option-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-option-check {
  color: var(--brand-gold-metallic, #d4af37);
  font-size: 12px;
  display: none;
  flex-shrink: 0;
}

.custom-select-option.is-selected .custom-option-check {
  display: inline-flex;
}

.custom-select-empty {
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--brand-slate-muted, #64748b);
  font-style: italic;
}

/* ==========================================================================
   2. File & Image Upload Component with Live Preview
   ========================================================================== */
.custom-upload-component {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.upload-dropzone {
  position: relative;
  border: 2px dashed rgba(37, 96, 90, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.upload-dropzone:hover {
  border-color: var(--brand-gold-metallic);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(27, 77, 62, 0.08);
}

.upload-dropzone.is-dragover {
  border-color: var(--brand-emerald);
  border-style: solid;
  background: rgba(37, 96, 90, 0.08);
  box-shadow: 0 0 0 4px rgba(37, 96, 90, 0.15);
  transform: scale(1.01);
}

.upload-dropzone.has-file {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(255, 255, 255, 0.95);
  padding: 16px;
}

.upload-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.upload-dropzone.has-file .upload-file-input {
  pointer-events: none;
}

/* Prompt State */
.upload-dropzone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.upload-dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(27, 77, 62, 0.08);
  color: var(--brand-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.25s ease;
}

.upload-dropzone:hover .upload-dropzone-icon {
  background: var(--brand-emerald);
  color: var(--brand-gold-metallic);
  transform: translateY(-2px);
}

.upload-dropzone-text {
  font-size: 14px;
  color: var(--brand-slate-dark);
}

.upload-dropzone-text strong {
  color: var(--brand-emerald);
}

/* Live Preview Card */
.upload-preview-card {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: start;
  position: relative;
  z-index: 2;
  animation: fadeInPreview 0.25s ease;
}

@keyframes fadeInPreview {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.upload-preview-media {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(37, 96, 90, 0.06);
  border: 1px solid var(--brand-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upload-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-preview-doc-icon {
  font-size: 26px;
}

.upload-preview-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.upload-preview-name {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--brand-slate-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  position: relative;
  z-index: 3;
}

.upload-remove-btn:hover {
  background: #DC2626;
  color: #FFFFFF;
  border-color: #DC2626;
  transform: scale(1.05);
}
