/* ==========================================================================
   MOCRA ENGINE — International Telephone Input Component
   Clean SaaS Style with Country Code Selector & Search Popover
   Strictly Zero Emojis, 100% Crisp Vector SVG
   ========================================================================== */

.intl-phone-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 42px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  transition: border-color 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 160ms cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.intl-phone-wrapper:hover {
  border-color: #94A3B8;
}

.intl-phone-wrapper.focused {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Country Selector Button */
.intl-phone-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: #F8FAFC;
  border: none;
  border-top-left-radius: 7px;
  border-bottom-left-radius: 7px;
  cursor: pointer;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0F172A;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 140ms ease;
}

.intl-phone-trigger:hover {
  background: #F1F5F9;
}

.intl-phone-iso {
  display: inline-block;
  font-weight: 800;
  color: #0F172A;
  font-size: 0.85rem;
}

.intl-phone-dial {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-weight: 600;
  color: #2563EB;
  font-size: 0.82rem;
}

.intl-phone-chevron {
  width: 12px;
  height: 12px;
  fill: #64748B;
  transition: transform 180ms ease;
  flex-shrink: 0;
}

.intl-phone-wrapper.open .intl-phone-chevron {
  transform: rotate(180deg);
}

/* Vertical Separator Divider */
.intl-phone-divider {
  width: 1px;
  background: #E2E8F0;
  margin: 6px 0;
  flex-shrink: 0;
}

/* Phone Number Input */
.intl-phone-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0 14px;
  color: #0F172A;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  outline: none;
  border-top-right-radius: 7px;
  border-bottom-right-radius: 7px;
  box-sizing: border-box;
}

.intl-phone-input::placeholder {
  color: #94A3B8;
  font-weight: 400;
}

/* Dropdown Menu Popover */
.intl-phone-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  box-shadow: 0 14px 34px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  z-index: 10000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: intlPhoneFadeIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes intlPhoneFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Search Box Container */
.intl-phone-search-box {
  position: relative;
  padding: 8px 10px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
}

.intl-phone-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  fill: #64748B;
  pointer-events: none;
}

.intl-phone-search-input {
  width: 100%;
  height: 32px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 0 10px 0 32px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.82rem;
  color: #0F172A;
  outline: none;
  box-sizing: border-box;
  transition: border-color 140ms ease;
}

.intl-phone-search-input:focus {
  border-color: #2563EB;
}

/* Scrollable Country List - Fixed to display exactly 3 countries (38px x 3 = 114px) */
.intl-phone-list {
  max-height: 114px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  list-style: none;
  overscroll-behavior: contain;
}

.intl-phone-list::-webkit-scrollbar {
  width: 5px;
}

.intl-phone-list::-webkit-scrollbar-track {
  background: #F8FAFC;
}

.intl-phone-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 3px;
}

.intl-phone-list::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Country Option Item - Exactly 38px each */
.intl-phone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  box-sizing: border-box;
  font-size: 0.84rem;
  color: #1E293B;
  cursor: pointer;
  transition: background-color 100ms ease, color 100ms ease;
  user-select: none;
}

.intl-phone-item:hover,
.intl-phone-item.highlighted {
  background: #EFF6FF;
  color: #1D4ED8;
}

.intl-phone-item.selected {
  background: #DBEAFE;
  color: #1E40AF;
  font-weight: 700;
}

.intl-phone-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.intl-phone-item-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 18px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #475569;
  flex-shrink: 0;
}

.intl-phone-item.selected .intl-phone-item-badge {
  background: #BFDBFE;
  border-color: #93C5FD;
  color: #1E40AF;
}

.intl-phone-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intl-phone-item-dial {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748B;
  flex-shrink: 0;
  margin-left: 12px;
}

.intl-phone-item.selected .intl-phone-item-dial {
  color: #1D4ED8;
}

/* Empty Result */
.intl-phone-empty {
  padding: 16px;
  text-align: center;
  font-size: 0.82rem;
  color: #64748B;
}
