/* ===================================================
   Arabic Fonts Explorer — Plugin Styles
   =================================================== */
:root {
  --afe-bg:       #060810;
  --afe-surface:  #0c1120;
  --afe-surface2: #111827;
  --afe-border:   #1b2438;
  --afe-border2:  #232f47;
  --afe-accent:   #4080f5;
  --afe-accent2:  #7c5cfc;
  --afe-accent3:  #0ecfaa;
  --afe-text:     #e8edf8;
  --afe-text2:    #9aabc4;
  --afe-muted:    #556070;
  --afe-radius:   12px;
}

/* ── BASE ── */
.afe-wrap, .afe-single-wrap {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  background: var(--afe-bg);
  color: var(--afe-text);
  min-height: 100vh;
  padding: 0;
}

/* ── HEADER ── */
.afe-header {
  text-align: center;
  padding: 52px 24px 40px;
  border-bottom: 1px solid var(--afe-border);
  background: radial-gradient(ellipse at top, rgba(64,128,245,.07) 0%, transparent 70%);
}
.afe-title {
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--afe-accent), var(--afe-accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 10px;
}
.afe-subtitle { color: var(--afe-text2); font-size: 1rem; margin-bottom: 18px; }

/* ── BADGES ── */
.afe-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.afe-badge {
  padding: 5px 16px; border-radius: 20px; font-size: .78rem; font-weight: 700;
  border: 1px solid;
}
.afe-badge-blue   { color: var(--afe-accent);  border-color: rgba(64,128,245,.4);  background: rgba(64,128,245,.08); }
.afe-badge-green  { color: var(--afe-accent3); border-color: rgba(14,207,170,.4);  background: rgba(14,207,170,.08); }
.afe-badge-purple { color: #a78bfa;            border-color: rgba(167,139,250,.4); background: rgba(167,139,250,.08); }

/* ── TOOLBAR ── */
.afe-bar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(6,8,16,.95); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--afe-border);
  padding: 13px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.afe-search-wrap { position: relative; flex: 1; max-width: 320px; min-width: 180px; }
.afe-search-wrap input {
  width: 100%; background: var(--afe-surface); border: 1px solid var(--afe-border2);
  color: var(--afe-text); padding: 9px 14px 9px 36px; border-radius: 10px;
  font-family: 'Cairo', sans-serif; font-size: .88rem; outline: none;
  transition: border-color .2s; text-align: right; direction: rtl;
}
.afe-search-wrap input:focus { border-color: var(--afe-accent); box-shadow: 0 0 0 3px rgba(64,128,245,.1); }
.afe-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--afe-muted); pointer-events: none; }
.afe-size-wrap { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.afe-size-wrap label { color: var(--afe-muted); font-size: .8rem; }
.afe-size-wrap input[type=range] { width: 90px; accent-color: var(--afe-accent); cursor: pointer; }
#afeSizeVal, #afeSingleSizeVal { color: var(--afe-accent); font-size: .8rem; font-weight: 700; min-width: 38px; }
.afe-preview-input {
  background: var(--afe-surface); border: 1px solid var(--afe-border2); color: var(--afe-text);
  padding: 9px 13px; border-radius: 10px; font-family: 'Cairo',sans-serif; font-size: .88rem;
  outline: none; width: 200px; transition: border-color .2s; text-align: right; direction: rtl;
}
.afe-preview-input:focus { border-color: var(--afe-accent); }

/* ── FILTER PILLS ── */
.afe-cats {
  display: flex; gap: 7px; flex-wrap: wrap; justify-content: center;
  padding: 11px 20px; border-bottom: 1px solid var(--afe-border);
  background: var(--afe-bg);
}
.afe-pill {
  background: var(--afe-surface); border: 1px solid var(--afe-border2); color: var(--afe-muted);
  padding: 5px 16px; border-radius: 20px; font-size: .76rem; font-weight: 700;
  cursor: pointer; transition: all .2s; font-family: 'Cairo',sans-serif;
}
.afe-pill:hover  { color: var(--afe-text2); }
.afe-pill.active { background: var(--afe-accent); border-color: var(--afe-accent); color: #fff; }

/* ── COUNT BAR ── */
.afe-cbar {
  padding: 10px 24px; color: var(--afe-muted); font-size: .78rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  background: var(--afe-surface); border-bottom: 1px solid var(--afe-border);
}
.afe-cbar strong { color: var(--afe-accent); }

/* ── GRID ── */
.afe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1px; background: var(--afe-border);
}

/* ── CARD ── */
.afe-card {
  background: var(--afe-bg); padding: 26px 28px;
  display: flex; flex-direction: column; gap: 0;
  transition: background .18s; position: relative;
  cursor: pointer;
}
.afe-card:hover { background: var(--afe-surface); }
.afe-card-num {
  position: absolute; top: 14px; left: 18px;
  font-size: .68rem; color: var(--afe-border2); font-family: monospace; font-weight: 700;
}
.afe-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.afe-card-meta { flex: 1; min-width: 0; }
.afe-fname {
  font-size: .82rem; color: var(--afe-text); font-weight: 700; margin-bottom: 3px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.afe-cpill {
  font-size: .63rem; font-weight: 700; padding: 2px 9px; border-radius: 10px;
  border: 1px solid; text-transform: uppercase; letter-spacing: .03em; flex-shrink: 0;
}
.afe-p-sans    { color: #4080f5; border-color: rgba(64,128,245,.35);  background: rgba(64,128,245,.08); }
.afe-p-serif   { color: #f5c03d; border-color: rgba(245,192,61,.35);  background: rgba(245,192,61,.08); }
.afe-p-display { color: #f53d8a; border-color: rgba(245,61,138,.35);  background: rgba(245,61,138,.08); }
.afe-p-kufi    { color: #0ecfaa; border-color: rgba(14,207,170,.35);  background: rgba(14,207,170,.08); }
.afe-p-mono    { color: #f59e0b; border-color: rgba(245,158,11,.35);  background: rgba(245,158,11,.08); }

.afe-cdes { font-size: .7rem; color: var(--afe-muted); margin-top: 2px; }
.afe-card-actions { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; flex-shrink: 0; }
.afe-prev-main {
  font-size: 32px; font-weight: 600; line-height: 1.65;
  color: var(--afe-text); margin-bottom: 8px; word-break: break-word;
  transition: font-size .1s;
}
.afe-prev-sub { font-size: .9rem; font-weight: 400; color: var(--afe-muted); line-height: 1.9; }
.afe-card-footer {
  margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--afe-border);
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.afe-cfl { font-size: .65rem; color: var(--afe-muted); }
.afe-wp {
  font-size: .63rem; color: var(--afe-muted); background: var(--afe-surface2);
  border: 1px solid var(--afe-border); border-radius: 4px; padding: 2px 7px;
}
.afe-empty { grid-column: 1/-1; text-align: center; padding: 80px; color: var(--afe-muted); font-size: 1.1rem; }

/* ── BUTTONS ── */
.afe-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px; font-size: .75rem; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: all .18s;
  font-family: 'Cairo',sans-serif; white-space: nowrap; border: 1px solid;
}
.afe-btn-lg { padding: 12px 28px; font-size: .95rem; border-radius: 10px; }
.afe-btn-primary { background: var(--afe-accent); border-color: var(--afe-accent); color: #fff; }
.afe-btn-primary:hover { background: #5590ff; border-color: #5590ff; color: #fff; }
.afe-btn-ghost { background: none; border-color: var(--afe-border2); color: var(--afe-text2); }
.afe-btn-ghost:hover { border-color: var(--afe-text2); color: var(--afe-text); }

/* ── TOAST ── */
.afe-toast {
  position: fixed; bottom: 26px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, var(--afe-accent), var(--afe-accent2));
  color: #fff; padding: 11px 28px; border-radius: 12px; font-size: .87rem; font-weight: 700;
  transition: transform .35s cubic-bezier(.175,.885,.32,1.275);
  pointer-events: none; z-index: 9999; box-shadow: 0 6px 24px rgba(64,128,245,.5);
}
.afe-toast.show { transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════
   SINGLE FONT PAGE
   ═══════════════════════════════════════════════ */
.afe-single-nav {
  padding: 16px 32px;
  background: var(--afe-surface);
  border-bottom: 1px solid var(--afe-border);
}
.afe-back-btn {
  color: var(--afe-accent); font-size: .85rem; font-weight: 700; text-decoration: none;
}
.afe-back-btn:hover { text-decoration: underline; color: var(--afe-accent); }

.afe-single-hero {
  background: radial-gradient(ellipse at top, rgba(64,128,245,.1) 0%, transparent 60%);
  border-bottom: 1px solid var(--afe-border);
  padding: 56px 32px 40px;
  text-align: center;
}
.afe-single-hero-inner { max-width: 800px; margin: 0 auto; }
.afe-single-badges { margin-bottom: 16px; }
.afe-single-title { font-size: clamp(2.5rem,7vw,4.5rem); margin: 0 0 12px; color: var(--afe-text); }
.afe-single-designer { color: var(--afe-muted); font-size: .9rem; margin-bottom: 10px; }
.afe-single-info { color: var(--afe-text2); font-size: 1rem; margin-bottom: 28px; }
.afe-single-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.afe-single-body { max-width: 900px; margin: 0 auto; padding: 40px 24px; }

.afe-single-section { margin-bottom: 48px; }
.afe-section-title {
  font-size: 1.15rem; font-weight: 700; color: var(--afe-text);
  margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--afe-border);
}

/* LIVE PREVIEW */
.afe-preview-controls {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 16px;
}
.afe-preview-controls .afe-preview-input { flex: 1; min-width: 200px; }
.afe-live-preview {
  background: var(--afe-surface); border: 1px solid var(--afe-border);
  border-radius: var(--afe-radius); padding: 32px 24px;
  color: var(--afe-text); line-height: 1.8; word-break: break-word;
  min-height: 120px; text-align: center;
  transition: font-size .15s;
}

/* WEIGHTS GRID */
.afe-weights-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px;
}
.afe-weight-card {
  background: var(--afe-surface); border: 1px solid var(--afe-border);
  border-radius: var(--afe-radius); padding: 16px 20px;
  transition: border-color .18s;
}
.afe-weight-card:hover { border-color: var(--afe-accent); }
.afe-weight-sample { font-size: 1.6rem; color: var(--afe-text); margin-bottom: 10px; line-height: 1.6; }
.afe-weight-meta { display: flex; align-items: center; gap: 8px; }
.afe-weight-name { font-size: .72rem; color: var(--afe-muted); }

/* SAMPLE TEXTS */
.afe-samples { background: var(--afe-surface); border: 1px solid var(--afe-border); border-radius: var(--afe-radius); overflow: hidden; }
.afe-sample-row {
  padding: 18px 24px; border-bottom: 1px solid var(--afe-border); color: var(--afe-text);
  line-height: 1.9;
}
.afe-sample-row:last-child { border-bottom: none; }

/* CODE BLOCKS */
.afe-code-block {
  background: #0a0f1e; border: 1px solid var(--afe-border);
  border-radius: var(--afe-radius); overflow: hidden; margin-bottom: 12px;
}
.afe-code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--afe-surface); border-bottom: 1px solid var(--afe-border);
  font-size: .78rem; color: var(--afe-text2);
}
.afe-copy-btn {
  background: none; border: 1px solid var(--afe-border2); color: var(--afe-muted);
  padding: 3px 12px; border-radius: 6px; font-size: .72rem; font-weight: 700;
  cursor: pointer; font-family: 'Cairo',sans-serif; transition: all .18s;
}
.afe-copy-btn:hover { border-color: var(--afe-accent); color: var(--afe-accent); }
.afe-code-block pre {
  margin: 0; padding: 14px 18px; font-size: .78rem; color: #7dd3fc;
  font-family: 'Courier New', monospace; white-space: pre-wrap; word-break: break-all;
  direction: ltr; text-align: left;
  overflow-x: auto;
}

/* INFO TABLE */
.afe-info-table { width: 100%; border-collapse: collapse; }
.afe-info-table th, .afe-info-table td {
  padding: 12px 16px; border: 1px solid var(--afe-border);
  font-size: .85rem; text-align: right;
}
.afe-info-table th { background: var(--afe-surface); color: var(--afe-text2); font-weight: 700; width: 180px; }
.afe-info-table td { background: var(--afe-bg); color: var(--afe-text); }
.afe-info-table a { color: var(--afe-accent); text-decoration: none; }
.afe-info-table a:hover { text-decoration: underline; }

/* DOWNLOAD CTA */
.afe-download-cta {
  background: linear-gradient(135deg, rgba(64,128,245,.12), rgba(124,92,252,.12));
  border: 1px solid rgba(64,128,245,.3); border-radius: 16px;
  padding: 36px 24px; text-align: center;
}
.afe-download-cta h3 { font-size: 1.4rem; margin: 0 0 8px; color: var(--afe-text); }
.afe-download-cta p  { color: var(--afe-text2); margin: 0 0 20px; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .afe-grid { grid-template-columns: 1fr; }
  .afe-weights-grid { grid-template-columns: 1fr 1fr; }
  .afe-single-title { font-size: 2rem; }
  .afe-bar { padding: 10px; }
}
