/**
 * 组合的语言和货币选择器
 * 一个按钮触发，一个弹窗内两个独立选择器
 */

/* 主容器 */
.lang-currency-combined {
  position: relative;
  display: inline-block;
}

/* 触发按钮 */
.lc-trigger {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.lc-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.lc-trigger .flag {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lc-trigger .flag .flag-img {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
}

.lc-trigger .flag .flag-emoji {
  font-size: 18px;
  line-height: 1;
}

.lc-trigger .currency {
  font-weight: 600;
}

.lc-trigger .lc-separator {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
  font-size: 14px;
}

.lc-trigger .arrow {
  margin-left: 4px;
  transition: transform 0.3s ease;
  display: none;
}

.lc-trigger-line {
  opacity: 0.1;
}

.lang-currency-combined:hover .lc-trigger .arrow {
  transform: rotate(180deg);
}

/* 弹出框 */
.lc-popup {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  max-width: 176px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

/* 弹窗内的区块 */
.lc-section {
  padding: 12px;
}

.lc-section:first-child {
  border-bottom: 1px solid #f0f0f0;
}

/* 区块标题 */
.lc-section-header {
  font-family:
    Source Han Sans,
    Source Han Sans;
  font-weight: bold;
  font-size: 16px;
  color: #19264d;
  font-style: normal;
  text-transform: none;
}

.lc-section-header:hover {
  background: #eeeeee;
  border-color: #d0d0d0;
}

.lc-section-header .flag,
.lc-section-header .symbol {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lc-section-header .flag .flag-img {
  width: 24px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
}

.lc-section-header .flag .flag-emoji {
  font-size: 18px;
  line-height: 1;
}

.lc-section-header .name {
  font-size: 14px;
}

.lc-section-header .arrow-down {
  position: absolute;
  right: 10px;
  transition: transform 0.3s ease;
}

/* 展开/收起效果 */
.lc-section.expanded .arrow-down {
  transform: rotate(180deg);
}

.lc-section-content {
  transition: max-height 0.3s ease;
}

.lc-section.expanded .lc-section-content {
}

/* 选项列表 */
.lc-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin: 3px 0;
}

.lc-option:hover {
  background: linear-gradient(
    90deg,
    rgba(33, 150, 243, 0.12) 0%,
    rgba(25, 118, 210, 0.12) 100%
  );
  transform: translateX(4px);
}

/* 当前选中的选项 */
.lc-option.active {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  color: white;
  font-weight: 600;
}

.lc-option.active:hover {
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
  transform: translateX(4px);
}

.lc-option .flag {
  font-size: 20px;
  width: 24px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lc-option .flag .flag-img {
  width: 28px;
  height: 21px;
  object-fit: cover;
  border-radius: 2px;
}

.lc-option .flag .flag-emoji {
  font-size: 20px;
  line-height: 1;
}

.lc-option span:first-child {
  font-size: 16px;
  width: 24px;
  text-align: center;
  font-weight: 600;
}

.lc-option .name,
.lc-option span:last-child {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .lc-trigger {
    padding: 6px 12px;
    font-size: 13px;
  }

  .lc-popup {
    min-width: 144px;
    max-width: 160px;
    right: -20px;
  }

  .lc-section {
    padding: 10px;
  }
}

/* 滚动条样式 */
.lc-section-content::-webkit-scrollbar {
  width: 6px;
}

.lc-section-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.lc-section-content::-webkit-scrollbar-thumb {
  background: #2196f3;
  border-radius: 4px;
}

.lc-section-content::-webkit-scrollbar-thumb:hover {
  background: #1976d2;
}

/* lc-custom-dropdown 滚动条 — 与 lc-popup 弹窗风格一致 */
.lc-custom-dropdown::-webkit-scrollbar {
  width: 4px;
}

.lc-custom-dropdown::-webkit-scrollbar-track {
  background: #f0f7fb;
  border-radius: 4px;
}

.lc-custom-dropdown::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2f97e6, #33e0c1);
  border-radius: 4px;
}

.lc-custom-dropdown::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2589d0, #2bc8ac);
}

/* Centered lc-popup styles */
.lc-centered-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1998;
}
.lc-centered-overlay.show {
  display: block;
}
.lc-popup-centered {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  width: 380px;
  max-width: 92%;
  background: transparent;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.6);
  overflow: visible;
  opacity: 1;
  visibility: visible;
}
.lang-ar .lc-popup-centered {
  left: unset;
  top: unset;
  right: 50%;
  bottom: 50%;
  transform: translate(50%, 50%) !important;
}
.lc-popup-centered .lc-card {
  background: #fff;
  border-radius: 12px;
}
.lc-popup-centered .lc-header {
  height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #a7e9f2, #6ab9e8);
  color: #19264d;
  font-weight: 800;
  font-size: 20px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.lc-popup-centered .lc-body {
  padding: 18px;
  background: #fff;
}
.lc-popup-centered .lc-section {
  padding: 8px 0;
}
.lc-centered-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100000;
  background: transparent;
  border: none;
  color: #0b2b35;
  font-size: 18px;
}
.lc-popup-centered .confirm-btn {
  display: block;
  width: 100%;
  padding: 12px 18px;
  border-radius: 8px;
  background: linear-gradient(90deg, #33e0c1, #2f97e6);
  color: #fff;
  border: none;
  margin-top: 14px;
  font-size: 18px;
  font-weight: 700;
}
.lc-popup-centered .lc-footer {
  padding: 12px 18px;
  background: transparent;
}
.lc-popup-centered .lc-section .lc-section-header {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 8px;
}

/* Select styling for modal */
.lc-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e6eef3;
  border-radius: 8px;
  background: #fbfeff;
  font-size: 15px;
  color: #07313a;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}
.lc-select:focus {
  box-shadow: 0 6px 18px rgba(47, 151, 230, 0.12);
  border-color: #2f97e6;
}
.lc-select-wrapper {
  position: relative;
}
.lc-select-wrapper:after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background-image: url("__STATIC__/themes/__THEME__/image/select-arrow.svg");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* Fake select display to mimic native select but allow HTML content */
.lc-fake-select {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e6eef3;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.lc-fake-select .selected-flag {
  display: inline-block;
  color: #2c4247;
}
.lc-fake-select .selected-name {
  flex: 1;
  color: #2c4247;
}
.lc-fake-select .fake-arrow {
  width: 10px;
  height: 10px;
  background-image: url("__STATIC__/themes/__THEME__/image/select-arrow.svg");
  background-size: contain;
  background-repeat: no-repeat;
}
.lc-select-wrapper.open .lc-custom-dropdown {
  display: flex;
}
.lc-select-wrapper .lc-custom-dropdown {
  display: none;
}

/* Custom dropdown list */
.lc-custom-dropdown {
  max-height: calc(50vh - 110px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e6eef3;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(2, 6, 23, 0.12);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}
.lc-custom-dropdown .lang-item,
.lc-custom-dropdown .currency-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: #07313a;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}
.lc-custom-dropdown .lang-item:hover,
.lc-custom-dropdown .currency-item:hover {
  background: linear-gradient(90deg, rgba(47, 151, 230, 0.1), rgba(51, 224, 193, 0.1));
  color: #2f97e6;
}
.lc-custom-dropdown .lang-item .flag {
  width: 36px;
  height: 24px;
  display: inline-block;
}
.lc-custom-dropdown .lang-item .name,
.lc-custom-dropdown .currency-item .name {
  flex: 1;
}
.lc-custom-dropdown .lang-item.active,
.lc-custom-dropdown .currency-item.active {
  background: linear-gradient(90deg, #2f97e6, #33e0c1);
  color: #fff;
}
.lc-custom-dropdown .lang-item.active:hover,
.lc-custom-dropdown .currency-item.active:hover {
  background: linear-gradient(90deg, #2589d0, #2bc8ac);
  color: #fff;
}
.lc-custom-dropdown .currency-item .symbol {
  font-weight: 800;
  font-size: 18px;
  width: 48px;
}

/* Fake select display to mimic native select but allow HTML content */
.lc-fake-select {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e6eef3;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.lc-fake-select .selected-flag {
  display: inline-block;
}
.lc-fake-select .selected-name {
  flex: 1;
  color: #07313a;
}
.lc-fake-select .fake-arrow {
  width: 10px;
  height: 10px;
  background-image: url("__STATIC__/themes/__THEME__/image/select-arrow.svg");
  background-size: contain;
  background-repeat: no-repeat;
}
.lc-select-wrapper.open .lc-custom-dropdown {
  display: flex;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lc-select-wrapper .lc-custom-dropdown {
  display: none;
}

@media (max-width: 480px) {
  .lc-popup-centered {
    width: 320px;
  }
  .lc-popup-centered .lc-header {
    height: 64px;
    font-size: 18px;
  }
}
