/* =========================================================
   Event Log Analyzer - language dropdown flags
   =========================================================
   The eight flags the dropdown uses, self-hosted from
   flag-icons 7.2.3 (MIT, flags/LICENSE.txt). Replaces the
   full flag-icons stylesheet that loaded from jsDelivr on
   every page.

   Markup keeps the upstream class names (.fi .fi-xx, set in
   tool.php and in updateTrigger() in event-log-analyzer.js),
   scoped here under the tool root. Size and display come from
   .zt-flag-dd .fi / .zt-flag-opt .fi further up this file, so
   only the background is set in the flag rules at the end.
   ========================================================= */

/* ── Moved from zaur-tools.css (tools phase A, task 3). These rules sat
   earlier in the cascade than the ones below, so they stay first. ── */

/* =========================================================
   22. Tool: Event Log Analyzer - flag language dropdown
   Flag images: the self-hosted rules at the end of this file.
   ========================================================= */

/* Hidden native select - JS reads .zt-ela__lang .value unchanged */
.zt-ela__lang--hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ── Trigger ───────────────────────────────────────── */

.zt-flag-dd {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px 0 8px;
  height: 38px;
  border: 1px solid var(--zt-border, #e2e8f0);
  border-radius: var(--zt-radius-sm, 6px);
  background: var(--zt-surface, #ffffff);
  cursor: pointer;
  position: relative;
  font-size: 13px;
  color: var(--zt-text, #334155);
  user-select: none;
  transition: border-color 0.15s ease;
  flex-shrink: 0;
}

.zt-flag-dd:hover,
.zt-flag-dd[aria-expanded="true"] {
  border-color: var(--zt-primary, #2563eb);
}

.zt-flag-dd:focus-visible {
  outline: 2px solid var(--zt-primary, #2563eb);
  outline-offset: 2px;
}

.zt-flag-dd .fi {
  width: 19px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
}

.zt-flag-dd__globe {
  display: block;
  color: var(--zt-text-muted, #64748b);
  flex-shrink: 0;
}

.zt-flag-dd__name {
  font-size: 12px;
  color: var(--zt-text-secondary, #475569);
  line-height: 1;
  white-space: nowrap;
}

.zt-flag-dd__chev {
  display: block;
  color: var(--zt-text-muted, #94a3b8);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.zt-flag-dd[aria-expanded="true"] .zt-flag-dd__chev {
  transform: rotate(180deg);
}

/* ── Dropdown panel ────────────────────────────────── */

.zt-flag-panel {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: var(--zt-surface, #ffffff);
  border: 1px solid var(--zt-border, #e2e8f0);
  border-radius: var(--zt-radius, 8px);
  box-shadow: var(--zt-shadow-md, 0 4px 20px rgba(0, 0, 0, 0.10));
  z-index: 300;
  padding: 4px;
  min-width: 148px;
}

.zt-flag-panel.is-open {
  display: block;
}

/* ── Option ────────────────────────────────────────── */

.zt-flag-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--zt-text, #334155);
  transition: background 0.1s ease;
}

.zt-flag-opt:hover {
  background: var(--zt-bg-hover, #f1f5f9);
}

.zt-flag-opt.is-sel {
  background: var(--zt-primary-pale, #eff6ff);
  color: var(--zt-primary, #2563eb);
}

.zt-flag-opt .fi {
  width: 19px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  display: block;
}

.zt-flag-opt__globe {
  display: block;
  color: currentColor;
  flex-shrink: 0;
}

/* Loading is the shared state component's loading state since task 5. */

/* Respect HTML hidden attribute */
.zt-ela__result[hidden] {
  display: none;
}

/* Result container */
.zt-ela__result {
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-lg);
  overflow: hidden;
  background: var(--zt-bg-page);
}

.zt-ela__result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--zt-bg-subtle);
  border-bottom: 1px solid var(--zt-border);
}

.zt-ela__result-body {
  padding: 20px 20px 24px;
}

/* Section titles */
.zt-ela__section-title {
  margin: 22px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--zt-border);
  font-size: 0.82rem;
  color: var(--zt-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.zt-ela__section-title:first-child {
  margin-top: 0;
}

/* Paragraphs */
.zt-ela__para {
  margin: 0 0 10px;
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--zt-text-primary);
}

/* Numbered list items */
.zt-ela__list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--zt-text-primary);
}

.zt-ela__list-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: var(--zt-primary);
  color: var(--zt-primary-ink);
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 1px;
  flex-shrink: 0;
}

/* Bullet items */
.zt-ela__bullet {
  position: relative;
  padding-left: 16px;
  margin: 5px 0;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--zt-text-primary);
}

.zt-ela__bullet::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--zt-primary);
  font-weight: 700;
}

/* Inline code */
.zt-ela__code {
  font-family: var(--zt-font-mono);
  font-size: 0.875rem;
  background: var(--zt-bg-muted);
  color: var(--zt-primary-deep);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--zt-border);
  white-space: nowrap;
}

.zt-ela__result-body .zt-code-block {
  margin: 8px 0 14px;
}

@media (max-width: 600px) {
  .zt-flag-panel {
    left: auto;
    right: 0;
  }
}

/* Microsoft Learn search link */
.zt-ela__ms-link-wrap {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--zt-border);
}

.zt-ela__ms-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--zt-primary);
  text-decoration: none;
  line-height: 1.4;
}

.zt-ela__ms-link:hover {
  text-decoration: underline;
  color: var(--zt-primary-hover);
}

.zt-ela__ms-link svg {
  flex-shrink: 0;
  opacity: 0.8;
}

/* ── Original event-log-analyzer.css rules ── */

.zt-tool[data-zt-tool="event-log-analyzer"] .fi {
  background-size: contain;
  background-position: 50%;
  background-repeat: no-repeat;
}

.zt-tool[data-zt-tool="event-log-analyzer"] .fi::before {
  content: " ";
}

.zt-tool[data-zt-tool="event-log-analyzer"] .fi-gb { background-image: url(flags/gb.svg); }
.zt-tool[data-zt-tool="event-log-analyzer"] .fi-ru { background-image: url(flags/ru.svg); }
.zt-tool[data-zt-tool="event-log-analyzer"] .fi-de { background-image: url(flags/de.svg); }
.zt-tool[data-zt-tool="event-log-analyzer"] .fi-fr { background-image: url(flags/fr.svg); }
.zt-tool[data-zt-tool="event-log-analyzer"] .fi-es { background-image: url(flags/es.svg); }
.zt-tool[data-zt-tool="event-log-analyzer"] .fi-it { background-image: url(flags/it.svg); }
.zt-tool[data-zt-tool="event-log-analyzer"] .fi-pl { background-image: url(flags/pl.svg); }
.zt-tool[data-zt-tool="event-log-analyzer"] .fi-tr { background-image: url(flags/tr.svg); }
