/* =====================================================================
   ادعيلي — style.css
   ===================================================================== */

:root {
  --bg: #1b2333;
  --bg-soft: #232c40;
  --bg-card: #232c40;
  --border-color: #38425a;
  --paper: #f4efe1;
  --paper-shadow: rgba(0, 0, 0, 0.25);
  --paper-shadow-hover: rgba(0, 0, 0, 0.35);
  --ink: #1b2333;
  --cream-text: #f4efe1;
  --gold: #c9a227;
  --rose: #b5566a;
  --muted: #8b93a7;
  --modal-overlay: rgba(10, 14, 22, 0.85);

  --font-display: "Reem Kufi", sans-serif;
  --font-body: "IBM Plex Sans Arabic", sans-serif;
}

body.light-theme {
  --bg: #f7f4ec;
  --bg-soft: #ede7d8;
  --bg-card: #ffffff;
  --border-color: #ded5c2;
  --paper: #ffffff;
  --paper-shadow: rgba(43, 33, 14, 0.08);
  --paper-shadow-hover: rgba(43, 33, 14, 0.15);
  --ink: #222938;
  --cream-text: #1b2333;
  --gold: #b38814;
  --rose: #a34458;
  --muted: #6e7687;
  --modal-overlay: rgba(27, 35, 51, 0.65);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream-text);
  font-family: var(--font-body);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 0.5em 0;
}

a {
  color: var(--gold);
}

/* الهيدر واللوجو */
.site-header {
  padding: 1rem 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.site-logo:hover {
  transform: scale(1.05);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.theme-toggle-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  color: var(--cream-text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.btn-link {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0;
  text-decoration: underline;
}

/* الأزرار */
.btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  border-radius: 4px;
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gold);
  color: #1b2333;
}

.btn-google {
  background: #fff;
  color: #3c4043;
  border: 1px solid #d3d3d3;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.create-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 2.2rem 1.8rem 1.8rem;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.create-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 28px 28px 0 0;
  border-color: rgba(201, 162, 39, 0.5) transparent transparent transparent;
}

.step-hint {
  color: var(--muted);
  margin-bottom: 1rem;
}

.checkbox-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  color: var(--cream-text) !important;
  cursor: pointer;
}

.checkbox-row input {
  width: auto;
}

/* قسم الهيرو */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3rem;
  padding: 3rem 6vw 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-text {
  flex: 1 1 380px;
  max-width: 46ch;
}

.hero-text h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  line-height: 1.25;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.hero-notes {
  position: relative;
  flex: 1 1 320px;
  min-height: 320px;
}

.note {
  position: absolute;
  width: 240px;
  background: #f4efe1;
  color: #1b2333;
  padding: 1.4rem 1.3rem 1.1rem;
  border-radius: 2px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  font-size: 0.95rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.note p {
  margin: 0 0 0.6rem;
}

.note-from {
  display: block;
  text-align: left;
  font-size: 0.85rem;
  color: #6a6252;
}

.note-1 { top: 0; right: 10%; transform: rotate(-6deg); z-index: 3; }
.note-2 { top: 90px; right: 38%; transform: rotate(4deg); z-index: 2; }
.note-3 { top: 190px; right: 5%; transform: rotate(-2deg); z-index: 1; }

/* قسم إزاي بيشتغل */
.how {
  background: var(--bg-soft);
  padding: 4rem 6vw;
  transition: background-color 0.3s ease;
}

.how h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2.5rem;
}

.how-steps {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.how-num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.how-steps h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.how-steps p {
  color: var(--muted);
  margin: 0;
}

/* الفورمات */
.create {
  padding: 4rem 6vw;
  max-width: 480px;
  margin: 0 auto;
}

.create h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.board-form,
.wish-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.board-form label,
.wish-form label {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.8rem;
}

.board-form input,
.wish-form input,
.wish-form textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.8rem;
  color: var(--cream-text);
  font-family: var(--font-body);
  font-size: 1rem;
}

.board-form input:focus,
.wish-form input:focus,
.wish-form textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.slug-row {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.slug-row .slug-prefix {
  padding: 0 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.slug-row input {
  border: none;
  background: transparent;
  flex: 1;
  direction: ltr;
  text-align: right;
}

.board-form button,
.wish-form button {
  margin-top: 1.5rem;
}

.form-msg {
  min-height: 1.4em;
  font-size: 0.9rem;
  color: var(--rose);
}

/* صفحة الـ Board */
#board-view {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 6vw 5rem;
  text-align: center;
}

.owner-banner {
  background: var(--bg-card);
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 0.8rem 1.4rem;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.board-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.board-sub {
  color: var(--muted);
}

.occasion-badge {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.5rem 1.2rem;
  background: var(--rose);
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.9rem;
}

.wish-section {
  text-align: right;
  margin-top: 2rem;
}

.wish-success {
  text-align: center;
  padding: 3rem 1rem;
}

.wish-success p {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.wish-success span {
  color: var(--muted);
}

/* كارت الصفحة الخاصة (عند إخفاء الدعوات) */
.private-board-card {
  margin-top: 3.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.private-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

.private-board-card h3 {
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.private-board-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

/* لوحة الدعوات المعتمدة */
.approved-wishes-section {
  margin-top: 3.5rem;
  text-align: right;
}

.approved-wishes-section h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--gold);
}

.approved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.8rem;
  padding: 1rem 0;
}

.board-note {
  background: var(--paper);
  color: var(--ink);
  padding: 1.4rem 1.2rem;
  border-radius: 2px;
  box-shadow: 0 8px 18px var(--paper-shadow);
  border: 1px solid var(--border-color);
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.board-note:hover {
  transform: scale(1.03) rotate(0deg);
  box-shadow: 0 12px 24px var(--paper-shadow-hover);
  z-index: 5;
}

.board-note-msg {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1rem;
  word-break: break-word;
}

.board-note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  border-top: 1px dashed rgba(100, 100, 100, 0.2);
  padding-top: 0.6rem;
}

.board-note-from {
  font-weight: 700;
  color: var(--muted);
}

.board-note-actions {
  margin-top: 0.8rem;
  display: flex;
  justify-content: flex-end;
}

.btn-ameen {
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  color: var(--cream-text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.btn-ameen:hover {
  transform: scale(1.05);
}

.btn-ameen.reacted {
  background: var(--gold);
  color: #1b2333;
  border-color: var(--gold);
  cursor: default;
}

/* Dashboard */
#dashboard-view {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 6vw 5rem;
}

.my-link-section {
  margin-bottom: 1.5rem;
}

.my-link-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px 8px 0 0;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.my-link-box code {
  color: var(--gold);
  direction: ltr;
}

.visit-link {
  margin-inline-start: auto;
}

.quick-share-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.share-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: transform 0.15s ease;
}

.share-btn:hover {
  transform: translateY(-1px);
}

.share-whatsapp {
  background: #25D366;
  color: #0b2e15;
}

.share-telegram {
  background: #2AABEE;
  color: #052638;
}

.share-qr {
  background: var(--bg-card);
  color: var(--cream-text);
  border: 1px solid var(--border-color);
}

/* شريط الإحصائيات */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 0.5rem;
  text-align: center;
}

.stat-val {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  font-weight: 700;
  line-height: 1.2;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--muted);
}

/* كارت إعداد الخصوصية */
.privacy-settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.privacy-text strong {
  display: block;
  color: var(--cream-text);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.privacy-text p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-color);
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--gold);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.ad-container {
  max-width: 728px;
  min-height: 90px;
  margin: 2rem auto;
  background: var(--bg-soft);
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
  opacity: 0.7;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.8rem 0.4rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--cream-text);
  border-bottom-color: var(--gold);
}

.empty-hint {
  color: var(--muted);
  text-align: center;
  padding: 2rem 0;
}

.wish-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wish-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.2rem;
}

.wish-card-msg {
  margin: 0 0 0.7rem;
}

.wish-card-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
}

.wish-tag {
  background: var(--rose);
  color: #ffffff;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
}

.wish-status {
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
}

.wish-status-pending {
  background: #4a4020;
  color: #e5c76b;
}

body.light-theme .wish-status-pending {
  background: #fdf3d8;
  color: #8f6700;
}

.wish-status-approved {
  background: #204a2c;
  color: #7fd996;
}

body.light-theme .wish-status-approved {
  background: #e6f7ec;
  color: #1b7a37;
}

.ameen-badge {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
}

.wish-card-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn-small {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
}

.btn-approve {
  background: var(--gold);
  color: #1b2333;
}

.btn-reject {
  background: transparent;
  border: 1px solid #6a3743;
  color: #d98a9a;
}

body.light-theme .btn-reject {
  border-color: #d88998;
  color: #a3384f;
}

.btn-story {
  background: var(--bg-soft);
  color: var(--cream-text);
  border: 1px solid var(--border-color);
}

.btn-story:hover {
  background: var(--border-color);
}

.sent-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.sent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  color: var(--cream-text);
  text-decoration: none;
}

.sent-item-cta {
  color: var(--gold);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* نافذة المودال */
.modal {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.8rem 1.5rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  text-align: center;
}

.modal-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: -0.3rem;
  margin-bottom: 1.2rem;
}

.modal-close {
  position: absolute;
  top: 10px;
  left: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--muted);
  cursor: pointer;
}

.canvas-preview-wrapper {
  margin: 1.2rem auto;
  max-width: 250px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.canvas-preview-wrapper canvas {
  width: 100%;
  height: auto;
  display: block;
}

.qrcode-wrapper {
  background: #ffffff;
  padding: 1.2rem;
  border-radius: 8px;
  display: inline-block;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
}

.qrcode-wrapper img {
  display: block;
  margin: 0 auto;
}

/* بوت داعي */
.bot-wish {
  margin: 2rem auto;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-align: right;
  max-width: 440px;
}

.bot-avatar {
  flex-shrink: 0;
}

.bot-bubble {
  background: #f4efe1;
  color: #1b2333;
  border-radius: 4px 16px 16px 16px;
  padding: 1rem 1.2rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.bot-wish-intro {
  font-size: 0.85rem;
  color: #6a6252;
  margin: 0 0 0.5rem;
}

.bot-wish-say {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
}

.bot-wish-text {
  margin: 0;
  font-weight: 700;
}

.wish-success:not([hidden]) {
  animation: rise 0.5s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.site-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .hero {
    padding-top: 1rem;
  }
  .hero-notes {
    min-height: 260px;
  }
  .note {
    width: 190px;
  }
  .approved-grid {
    grid-template-columns: 1fr;
  }
  .quick-share-row {
    justify-content: center;
  }
  .stats-grid {
    gap: 0.5rem;
  }
  .stat-val {
    font-size: 1.3rem;
  }
  .stat-lbl {
    font-size: 0.7rem;
  }
}
/* تصميم كارت تنبيه مانع الإعلانات */
.adblock-warning {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid #ef4444;
  border-radius: 10px;
  padding: 14px 18px;
  text-align: center;
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.6;
  margin: 12px auto;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.15);
}

.adblock-warning strong {
  color: #ef4444;
  font-size: 14px;
}
.hs-slot:has(> :not(script)) { margin: 24px auto; text-align: center; max-width: 100%; overflow: hidden; }
.hs-slot:has(> :not(script))::before { content: "إعلان"; display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }