/* ── eureach.eu — AI Visibility Audit ───────────────────── */

.au-page {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 56px);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.au-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--navy2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 20px;
}

.au-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ── Audit form ─────────────────────────────────────────── */
.au-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.au-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.au-input {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.87rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.au-input:focus {
  outline: none;
  border-color: var(--blue2);
}
.au-input::placeholder { color: var(--muted); }

.au-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.au-run-btn {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  border: none;
  border-radius: var(--radius2);
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 2px;
}
.au-run-btn:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.au-run-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.au-form-err {
  font-size: 0.8rem;
  color: #f87171;
  display: none;
  padding: 6px 10px;
  background: rgba(248,113,113,0.1);
  border-radius: 6px;
  border: 1px solid rgba(248,113,113,0.25);
}
.au-form-err.visible { display: block; }

/* ── Audit limit banner ─────────────────────────────────── */
.au-limit-banner {
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.4;
}
.au-limit-banner a { color: var(--blue2); }

/* ── History list ────────────────────────────────────────── */
.au-history-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
}

.au-history-empty {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
}

.au-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
  border: 1px solid transparent;
  margin-bottom: 4px;
}
.au-history-item:hover { background: var(--glass); }
.au-history-item.active {
  background: rgba(37,99,235,0.1);
  border-color: rgba(37,99,235,0.25);
}

.au-hist-score {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.au-hist-score.score-green  { background: rgba(74,222,128,0.15); color: #4ade80; }
.au-hist-score.score-orange { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.au-hist-score.score-red    { background: rgba(248,113,113,0.15); color: #f87171; }

.au-hist-info { flex: 1; min-width: 0; }
.au-hist-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.au-hist-meta {
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 1px;
}

.au-hist-views {
  font-size: 0.7rem;
  color: var(--blue2);
  white-space: nowrap;
  flex-shrink: 0;
}

.au-hist-delete {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}
.au-history-item:hover .au-hist-delete { opacity: 1; }
.au-hist-delete:hover { color: #f87171; }

/* ── Main panel ─────────────────────────────────────────── */
.au-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 32px;
}

/* Empty state */
.au-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--muted);
}
.au-empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.au-empty-title { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.au-empty-sub { font-size: 0.88rem; max-width: 320px; line-height: 1.5; }

/* Loading state */
.au-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
  color: var(--muted);
}
.au-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--glass2);
  border-top-color: var(--blue2);
  border-radius: 50%;
  animation: auSpin 0.7s linear infinite;
}
@keyframes auSpin { to { transform: rotate(360deg); } }
.au-loading-title { font-size: 1rem; font-weight: 600; color: var(--white); }
.au-loading-sub   { font-size: 0.85rem; }

/* Report */
.au-report { max-width: 720px; }

.au-report-header {
  margin-bottom: 24px;
}
.au-report-biz-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 4px;
}
.au-report-biz-url {
  font-size: 0.85rem;
  color: var(--muted);
}
.au-report-biz-url a { color: var(--muted); text-decoration: none; }
.au-report-biz-url a:hover { color: var(--blue2); }

.au-report-meta {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.au-meta-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--glass2);
  border-radius: 6px;
  padding: 3px 10px;
  color: var(--muted);
}

/* Score hero */
.au-score-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.au-score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 4px solid;
  transition: border-color 0.2s;
}
.au-score-circle.score-green  { border-color: #4ade80; }
.au-score-circle.score-orange { border-color: #fbbf24; }
.au-score-circle.score-red    { border-color: #f87171; }

.au-score-num {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}
.au-score-num.score-green  { color: #4ade80; }
.au-score-num.score-orange { color: #fbbf24; }
.au-score-num.score-red    { color: #f87171; }

.au-score-denom {
  font-size: 0.75rem;
  color: var(--muted);
}

.au-score-desc { flex: 1; }
.au-score-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.au-score-blurb {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Breakdown */
.au-section { margin-bottom: 24px; }
.au-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.au-bd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}
.au-bd-label { width: 152px; flex-shrink: 0; color: var(--text); }
.au-bd-track { flex: 1; height: 8px; background: var(--glass2); border-radius: 4px; overflow: hidden; }
.au-bd-fill  { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.au-bd-fill.score-green  { background: #4ade80; }
.au-bd-fill.score-orange { background: #fbbf24; }
.au-bd-fill.score-red    { background: #f87171; }
.au-bd-val {
  width: 30px;
  text-align: right;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.au-bd-val.score-green  { color: #4ade80; }
.au-bd-val.score-orange { color: #fbbf24; }
.au-bd-val.score-red    { color: #f87171; }

/* Lists */
.au-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.au-list li {
  font-size: 0.85rem;
  color: var(--text);
  padding: 9px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  line-height: 1.4;
}
.au-list.au-recs li::before  { content: "→ "; color: var(--blue2); font-weight: 700; }
.au-list.au-strengths li::before  { content: "✓ "; color: #4ade80; font-weight: 700; }
.au-list.au-weaknesses li::before { content: "✗ "; color: #f87171; font-weight: 700; }

/* ── Share panel ─────────────────────────────────────────── */
.au-share-panel {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.au-share-panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

.au-share-pre {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.au-share-btn {
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.35);
  color: var(--blue2);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.au-share-btn:hover { background: rgba(37,99,235,0.25); }
.au-share-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.au-share-active { display: none; flex-direction: column; gap: 14px; }
.au-share-active.visible { display: flex; }

.au-share-url-row {
  display: flex;
  gap: 8px;
}
.au-share-url-input {
  flex: 1;
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-family: monospace;
  cursor: text;
}
.au-share-url-input:focus { outline: none; border-color: var(--blue2); }

.au-copy-btn {
  background: var(--blue);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.12s;
}
.au-copy-btn:hover { opacity: 0.85; }
.au-copy-btn.copied { background: #4ade80; color: #0f172a; }

.au-share-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.au-view-badge {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.au-view-badge strong { color: var(--text); }

.au-disable-btn {
  font-size: 0.78rem;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.au-disable-btn:hover { color: #f87171; }

/* Outreach messages */
.au-outreach-box {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.au-outreach-box-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}
.au-lang-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.au-lang-btn {
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.12s;
}
.au-lang-btn.active {
  background: rgba(37,99,235,0.15);
  border-color: rgba(37,99,235,0.4);
  color: var(--blue2);
}
.au-outreach-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Score color helpers */
.score-green  { color: #4ade80; }
.score-orange { color: #fbbf24; }
.score-red    { color: #f87171; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .au-page { flex-direction: column; }
  .au-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .au-main { padding: 20px 16px; }
  .au-score-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .au-score-circle { width: 80px; height: 80px; }
  .au-score-num { font-size: 1.9rem; }
}
