/* /css/directory.css — small overrides to match viewchatcam styling */
:root {
  --dir-radius: 18px;
}

.sectionHead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 12px 0 22px;
}

.sectionHead .hint {
  margin: 6px 0 0;
  opacity: .85;
}

.lang-switch {
  position: relative;
  min-width: min(100%, 340px);
  flex: 0 1 340px;
}

.lang-switch__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 22px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,242,255,.98) 100%);
  box-shadow: 0 18px 40px rgba(85, 39, 170, .14);
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.lang-switch__trigger:hover,
.lang-switch.is-open .lang-switch__trigger {
  transform: translateY(-1px);
  border-color: rgba(255, 62, 144, .22);
  box-shadow: 0 22px 48px rgba(85, 39, 170, .18);
}

.lang-switch__trigger-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lang-switch__flag {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
  font-size: 1.35rem;
}

.lang-switch__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lang-switch__label {
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .66;
  margin-right: 0;
}

.lang-switch__value {
  font-size: 16px;
  line-height: 1.15;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-switch__caret {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-right: 2px solid #6f6f76;
  border-bottom: 2px solid #6f6f76;
  transform: rotate(45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
  margin-top: -2px;
}

.lang-switch:hover .lang-switch__caret {
  border-color: #ff4fa0;
}

.lang-switch.is-open .lang-switch__caret,
.lang-switch[aria-expanded="true"] .lang-switch__caret {
  transform: rotate(225deg);
  border-color: #ff4fa0;
}

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(100vw - 32px, 520px);
  padding: 12px;
  border-radius: 24px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 28px 60px rgba(16, 14, 43, .18);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
  z-index: 20;
}

.lang-switch.is-open .lang-switch__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.lang-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(248, 248, 252, .88);
  color: inherit;
  text-align: left;
  line-height: 1;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.lang-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 62, 144, .22);
  background: rgba(255, 242, 249, .96);
  box-shadow: 0 10px 24px rgba(255, 62, 144, .12);
}

.lang-item__flag {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, .05);
  font-size: 1.22rem;
}

.lang-item__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

.lang-item__name {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-item__sub {
  font-size: 12px;
  color: rgba(0, 0, 0, .58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-item__check {
  opacity: 0;
  color: #ff3e90;
  font-weight: 800;
  transition: opacity .16s ease;
}

.lang-item.is-selected {
  border-color: rgba(255, 62, 144, .26);
  background: linear-gradient(180deg, rgba(255, 242, 249, .98) 0%, rgba(247, 239, 255, .98) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 62, 144, .08);
}

.lang-item.is-selected .lang-item__check {
  opacity: 1;
}

.lang-item.is-selected .lang-item__name {
  color: #ff3e90;
}

html[dir="rtl"] .lang-switch__trigger,
html[dir="rtl"] .lang-item {
  text-align: right;
}

html[dir="rtl"] .lang-switch__trigger-main,
html[dir="rtl"] .lang-item {
  flex-direction: row-reverse;
}

html[dir="rtl"] .lang-item__copy {
  align-items: flex-end;
}


.directory-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--dir-radius);
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,.08);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.directory-poster {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(0,0,0,.04);
}

.directory-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.directory-poster-actions {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.directory-preview,
.directory-open {
  border-radius: 999px !important;
  padding: 10px 14px !important;
}

.directory-preview__icon {
  margin-right: 6px;
}

.directory-body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.directory-url {
  font-size: 14px;
  opacity: .95;
  word-break: break-all;
}

.directory-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge--soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0,0,0,.12);
  color: rgba(0,0,0,.78);
  border: 1px solid rgba(0,0,0,.10);
}

.tpl-card {
  border-radius: var(--dir-radius);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 14px 40px rgba(0,0,0,.08);
  background: #fff;
}

.tpl-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

@media (max-width: 575px) {
  .directory-body { padding: 16px; }
  .directory-poster-actions { left: 12px; bottom: 12px; }
}


.header-search .btn { white-space: nowrap; }

.tpl-actions {
  padding: 14px;
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.02);
}

@media (max-width: 575px) {
  .header-search .input-group { flex-wrap: nowrap; }
  .header-search .btn { padding-left: 14px; padding-right: 14px; }
}


@media (max-width: 991.98px) {
  .lang-switch {
    min-width: 100%;
    flex-basis: 100%;
  }

  .lang-switch__menu {
    width: 100%;
    right: 0;
  }
}

@media (max-width: 575.98px) {
  .lang-switch__trigger {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .lang-switch__flag {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .lang-switch__value {
    font-size: 15px;
  }

  .lang-switch__menu {
    grid-template-columns: 1fr;
    padding: 10px;
    border-radius: 20px;
  }

  .lang-item {
    padding: 11px 12px;
    border-radius: 16px;
  }
}

.lang-switch__flag img,
.lang-item__flag img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lang-switch__flag,
.lang-item__flag {
  width: 28px;
  height: 20px;
  flex: 0 0 28px;
  overflow: hidden;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.lang-switch__flag img,
.lang-item__flag img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0;
}

/* Preview modal */
#previewModal .btn-close {
  display: flex;
  align-items: center;
  justify-content: center;
}

#previewModal .btn-close::before {
  content: "\00d7";
  font-size: 1.5rem;
  line-height: 1;
  color: #111;
}
