/* ================================================
   AI Translate Pro — Frontend Switcher CSS
   ================================================ */

/* ── Switcher Container ───────────────────────── */
.aitp-switcher {
  display: inline-flex;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
  z-index: 999;
}

/* ── Dropdown Switcher ────────────────────────── */
.aitp-switcher__dropdown {
  position: relative;
}

.aitp-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.aitp-switcher__toggle:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
}

.aitp-switcher__chevron {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.aitp-switcher__dropdown:hover .aitp-switcher__chevron {
  transform: rotate(180deg);
}

/* Dropdown list */
.aitp-switcher__list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: #1e2233;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  list-style: none;
  margin: 0;
  z-index: 9999;
  animation: aitp-dropdown-in 0.15s ease;
}

.aitp-switcher__dropdown:hover .aitp-switcher__list,
.aitp-switcher__toggle[aria-expanded="true"] + .aitp-switcher__list {
  display: block;
}

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

.aitp-switcher__item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  transition: all 0.15s;
}

.aitp-switcher__item a:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.aitp-switcher__item--active a {
  background: rgba(99,102,241,0.2);
  color: #818cf8;
  font-weight: 600;
}

/* ── Horizontal List Switcher ─────────────────── */
.aitp-switcher__list--horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  position: static;
  background: none;
  border: none;
  box-shadow: none;
  animation: none;
}

.aitp-switcher__list--horizontal .aitp-switcher__item a {
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
}

.aitp-switcher__list--horizontal .aitp-switcher__item--active a {
  border-color: #6366f1;
  background: rgba(99,102,241,0.15);
}

/* ── Flag Image ───────────────────────────────── */
.aitp-flag {
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

/* ── Floating Switcher ────────────────────────── */
.aitp-switcher--floating {
  position: fixed;
  z-index: 9990;
}

body.aitp-rtl .aitp-switcher--floating {
  left: 24px !important;
  right: auto !important;
}

.aitp-floating-bottom-right {
  bottom: 24px;
  right: 24px;
}

.aitp-floating-bottom-left {
  bottom: 24px;
  left: 24px;
}

.aitp-floating-top-right {
  top: 24px;
  right: 24px;
}

.aitp-floating-top-left {
  top: 24px;
  left: 24px;
}

/* ── Light Mode Overrides ─────────────────────── */
.aitp-switcher--light .aitp-switcher__toggle {
  background: white;
  border-color: rgba(0,0,0,0.12);
  color: #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.aitp-switcher--light .aitp-switcher__list {
  background: white;
  border-color: rgba(0,0,0,0.1);
}

.aitp-switcher--light .aitp-switcher__item a {
  color: #444;
}

.aitp-switcher--light .aitp-switcher__item a:hover {
  background: #f5f5f5;
  color: #000;
}

.aitp-switcher--light .aitp-switcher__item--active a {
  background: #eef2ff;
  color: #4f46e5;
}

/* ── Admin Bar Integration ────────────────────── */
#wp-admin-bar-aitp-language-switcher .aitp-switcher {
  display: flex;
  align-items: center;
  height: 32px;
}

#wp-admin-bar-aitp-language-switcher .aitp-switcher__toggle {
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 4px;
}
