/*
Theme Name: بطاقتي
Theme URI: https://your-site.com
Author: بطاقتي
Description: ثيم متخصص لصانع البطاقات الرقمية العربية - مُحسَّن للجوّال
Version: 1.0
Text Domain: bataqati
*/

/* ═══════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════ */
:root {
  --gold: #c9a84c;
  --gold2: #e8c96a;
  --dark: #0a0a12;
  --dark2: #10101c;
  --card: #16162a;
  --card2: #1e1e36;
  --border: rgba(201,168,76,0.18);
  --muted: #7a7a9a;
  --text: #f0eee8;
  --green: #3dba87;
  --radius: 16px;
  --max-w: 480px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════
   TYPOGRAPHY
═══════════════════════════════════════ */
h1, h2, h3, h4 { font-weight: 900; line-height: 1.3; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold2); }

/* ═══════════════════════════════════════
   LAYOUT WRAPPER
═══════════════════════════════════════ */
.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ═══════════════════════════════════════
   TOP NAV
═══════════════════════════════════════ */
#masthead {
  position: fixed;
  top: 0;
  width: 100%;
  max-width: var(--max-w);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(10,10,18,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.site-branding { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #8a5e1a);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.site-title { font-size: 1.2rem; font-weight: 900; color: var(--gold); }
.site-tagline { font-size: 0.62rem; color: var(--muted); }

.nav-search-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; color: var(--muted);
  transition: all 0.2s;
}
.nav-search-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ═══════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════ */
#content {
  padding-top: 60px;
  padding-bottom: 70px;
}

/* ═══════════════════════════════════════
   HERO BANNER
═══════════════════════════════════════ */
.hero-banner {
  margin: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1a1228 0%, #0f1a2e 50%, #1a1228 100%);
  border: 1px solid var(--border);
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
}
.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 80% at 80% 50%, rgba(201,168,76,0.12) 0%, transparent 60%),
              radial-gradient(ellipse 60% 60% at 20% 30%, rgba(91,60,180,0.1) 0%, transparent 60%);
}
.hero-banner h1 { font-size: 1.5rem; position: relative; z-index: 1; }
.hero-banner h1 span { color: var(--gold); }
.hero-banner p { font-size: 0.82rem; color: var(--muted); margin: 8px 0 16px; position: relative; z-index: 1; }
.hero-emoji { position: absolute; left: 16px; bottom: -8px; font-size: 5rem; opacity: 0.12; z-index: 0; }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: 30px;
  background: linear-gradient(135deg, var(--gold), #8a5e1a);
  color: #1a1000; font-weight: 700; font-size: 0.85rem;
  border: none; cursor: pointer; font-family: 'Cairo', sans-serif;
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
  transition: all 0.25s; text-decoration: none;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(201,168,76,0.45); color: #1a1000; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 30px;
  background: transparent; color: var(--text); font-weight: 600; font-size: 0.85rem;
  border: 1.5px solid var(--border); cursor: pointer; font-family: 'Cairo', sans-serif;
  transition: all 0.25s;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

/* ═══════════════════════════════════════
   STATS ROW
═══════════════════════════════════════ */
.stats-row {
  display: flex; gap: 10px;
  padding: 0 16px; margin-bottom: 8px;
}
.stat-pill {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 8px; text-align: center;
}
.stat-num { font-size: 1.2rem; font-weight: 900; color: var(--gold); }
.stat-lbl { font-size: 0.65rem; color: var(--muted); margin-top: 2px; }

/* ═══════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════ */
.sec-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 10px;
}
.sec-header h2 { font-size: 1rem; font-weight: 700; }
.sec-header a { font-size: 0.78rem; color: var(--gold); }

/* ═══════════════════════════════════════
   CATEGORY CHIPS
═══════════════════════════════════════ */
.cat-scroll {
  display: flex; gap: 10px;
  padding: 0 16px 8px;
  overflow-x: auto; scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; gap: 5px; cursor: pointer; text-decoration: none;
}
.cat-chip-icon {
  width: 58px; height: 58px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; border: 1.5px solid transparent;
  transition: all 0.25s;
}
.cat-chip.active .cat-chip-icon,
.cat-chip:hover .cat-chip-icon { border-color: var(--gold); box-shadow: 0 0 14px rgba(201,168,76,0.25); }
.cat-chip-lbl { font-size: 0.68rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.cat-chip.active .cat-chip-lbl { color: var(--gold); }

/* ═══════════════════════════════════════
   TEMPLATES GRID
═══════════════════════════════════════ */
.templates-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; padding: 4px 16px 16px;
}
.tpl-card {
  border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1.5px solid transparent;
  cursor: pointer; transition: all 0.25s; position: relative;
  text-decoration: none; display: block;
}
.tpl-card:hover, .tpl-card:active { transform: scale(0.98); border-color: var(--border); }
.tpl-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.tpl-card-placeholder {
  width: 100%; aspect-ratio: 1; background: var(--card2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
}
.tpl-card-placeholder span { font-size: 2.5rem; }
.tpl-card-placeholder p { font-size: 0.75rem; color: var(--muted); }
.tpl-card-body { padding: 10px 12px; }
.tpl-card-body h3 { font-size: 0.82rem; font-weight: 700; }
.tpl-card-body p { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.tpl-badge {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 0.62rem; font-weight: 700;
  background: linear-gradient(135deg, var(--gold), #8a5e1a); color: #1a1000;
}
.tpl-badge.new { background: linear-gradient(135deg, #3dba87, #1a6e4a); color: white; }

/* ═══════════════════════════════════════
   ADSENSE SLOTS
═══════════════════════════════════════ */
.ad-slot {
  margin: 12px 16px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card2);
  border: 1px dashed var(--border);
  min-height: 90px;
  display: flex; align-items: center; justify-content: center;
}
.ad-slot-label { font-size: 0.7rem; color: var(--muted); }

/* ═══════════════════════════════════════
   SINGLE POST / PAGE
═══════════════════════════════════════ */
.post-header { padding: 20px 16px 0; }
.post-cat-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  background: rgba(201,168,76,0.12); color: var(--gold);
  font-size: 0.72rem; font-weight: 700; margin-bottom: 10px;
}
.post-title { font-size: 1.4rem; margin-bottom: 8px; }
.post-meta { font-size: 0.75rem; color: var(--muted); }
.post-thumbnail { margin: 16px; border-radius: var(--radius); overflow: hidden; }
.post-thumbnail img { width: 100%; height: auto; display: block; }
.post-content { padding: 0 16px 24px; }
.post-content p { margin-bottom: 14px; font-size: 0.9rem; color: #ccc8e0; line-height: 1.8; }

/* ═══════════════════════════════════════
   BOTTOM NAV
═══════════════════════════════════════ */
#bottom-nav {
  position: fixed; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--max-w);
  background: rgba(10,10,18,0.97); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
  z-index: 1000;
}
.bot-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; cursor: pointer; text-decoration: none;
  transition: all 0.2s;
}
.bot-nav-icon { font-size: 1.3rem; transition: transform 0.2s; }
.bot-nav-lbl { font-size: 0.6rem; color: var(--muted); font-weight: 600; }
.bot-nav-item.current-menu-item .bot-nav-icon,
.bot-nav-item.active .bot-nav-icon { transform: scale(1.15); }
.bot-nav-item.current-menu-item .bot-nav-lbl,
.bot-nav-item.active .bot-nav-lbl { color: var(--gold); }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
#colophon {
  background: var(--dark2);
  border-top: 1px solid var(--border);
  padding: 20px 16px;
  text-align: center;
  font-size: 0.78rem; color: var(--muted);
}
#colophon a { color: var(--gold); }

/* ═══════════════════════════════════════
   SEARCH OVERLAY
═══════════════════════════════════════ */
.search-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(10,10,18,0.97); backdrop-filter: blur(10px);
  padding: 20px 16px;
  display: none; flex-direction: column;
}
.search-overlay.open { display: flex; }
.search-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-close { font-size: 1.4rem; color: var(--muted); cursor: pointer; }
.search-input-wrap { flex: 1; }
.search-input-wrap input {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  background: var(--card2); border: 1.5px solid var(--border);
  color: var(--text); font-size: 1rem; font-family: 'Cairo', sans-serif;
  outline: none; direction: rtl;
}
.search-input-wrap input:focus { border-color: var(--gold); }

/* ═══════════════════════════════════════
   TOAST NOTIFICATION
═══════════════════════════════════════ */
.btq-toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card2); border: 1px solid rgba(201,168,76,0.3);
  color: var(--text); padding: 10px 22px;
  border-radius: 30px; font-size: 0.85rem; font-weight: 600;
  z-index: 9999; opacity: 0;
  transition: all 0.35s;
  white-space: nowrap; pointer-events: none;
}
.btq-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════
   GENERATOR PAGE (plugin output)
═══════════════════════════════════════ */
.btq-generator-wrap { padding: 0 16px 24px; }

.btq-canvas-preview {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; border: 1px solid var(--border);
  text-align: center; margin-bottom: 16px;
}
.btq-canvas-preview canvas {
  max-width: 100%; border-radius: 12px;
  box-shadow: 0 6px 30px rgba(0,0,0,0.5);
}

.btq-controls { background: var(--card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); }

.btq-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.btq-tabs::-webkit-scrollbar { display: none; }
.btq-tab {
  padding: 8px 16px; font-size: 0.8rem; font-weight: 700;
  color: var(--muted); border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  font-family: 'Cairo', sans-serif; background: none;
  border-top: none; border-left: none; border-right: none;
  transition: all 0.2s;
}
.btq-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.btq-panel { display: none; }
.btq-panel.active { display: block; }

.btq-field { margin-bottom: 14px; }
.btq-field label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.btq-field input, .btq-field select, .btq-field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  background: var(--dark3, #0f0f20); border: 1.5px solid var(--border);
  color: var(--text); font-size: 0.9rem; font-family: 'Cairo', sans-serif;
  outline: none; direction: rtl; transition: border-color 0.2s;
  -webkit-appearance: none;
}
.btq-field input:focus, .btq-field select:focus, .btq-field textarea:focus { border-color: var(--gold); }
.btq-field textarea { resize: none; height: 70px; }

.btq-color-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.btq-clr {
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.2s;
}
.btq-clr.active { border-color: white; transform: scale(1.2); }

.btq-font-list { display: flex; flex-direction: column; gap: 8px; }
.btq-font-opt {
  padding: 11px 14px; border-radius: 10px;
  background: var(--card2); border: 1.5px solid var(--border);
  cursor: pointer; transition: all 0.2s;
}
.btq-font-opt.active { border-color: var(--gold); background: rgba(201,168,76,0.08); }
.btq-font-opt span { font-size: 1rem; }
.btq-font-opt small { display: block; font-size: 0.68rem; color: var(--muted); }

.btq-frame-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.btq-frame-opt {
  aspect-ratio: 1; border-radius: 10px;
  background: var(--card2); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; cursor: pointer; transition: all 0.2s;
}
.btq-frame-opt.active { border-color: var(--gold); background: rgba(201,168,76,0.1); }

.btq-dl-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btq-dl-btn {
  padding: 13px; border-radius: 12px; font-size: 0.92rem; font-weight: 700;
  border: none; cursor: pointer; font-family: 'Cairo', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s;
}
.btq-dl-btn:active { transform: scale(0.98); }
.btq-dl-primary { background: linear-gradient(135deg,var(--gold),#8a5e1a); color: #1a1000; box-shadow: 0 4px 16px rgba(201,168,76,0.3); }
.btq-dl-wa { background: #128C7E; color: white; }
.btq-dl-copy { background: var(--card2); color: var(--text); border: 1.5px solid var(--border) !important; }
