/* ===== GLOBAL RESET & RTL ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a5276;
  --primary-light: #2980b9;
  --primary-dark: #0e3750;
  --accent: #e74c3c;
  --accent-light: #ff6b6b;
  --gold: #f39c12;
  --gold-light: #f5b041;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #e0e0e0;
  --success: #27ae60;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Heebo', 'Segoe UI', Tahoma, sans-serif;
  direction: rtl;
  text-align: right;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

img { max-width: 100%; height: auto; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }

/* ===== LAYOUT ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(231, 76, 60, 0.45);
  color: white;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: white;
  box-shadow: 0 4px 15px rgba(243, 156, 18, 0.35);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(243, 156, 18, 0.45);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-lg {
  padding: 18px 44px;
  font-size: 1.2rem;
  border-radius: var(--radius-lg);
}

/* ===== HEADER / NAV ===== */
.site-header {
  background: var(--primary-dark);
  color: white;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
}

.site-logo span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.nav-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  transition: color var(--transition);
}
.nav-links a:hover { color: white; }

/* ===== ARTICLE PAGE (index.html) ===== */
.article-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: 50px 0 40px;
  text-align: center;
}

.article-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.article-hero .meta {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

.article-body {
  background: var(--card-bg);
  padding: 40px;
  margin: -20px auto 40px;
  max-width: 800px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.article-body p {
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.article-body .highlight {
  background: linear-gradient(to left, rgba(243, 156, 18, 0.1), transparent);
  border-right: 4px solid var(--gold);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
  font-weight: 600;
}

/* Campaign Banner */
.campaign-banner {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin: 36px 0;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.campaign-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(243, 156, 18, 0.1) 0%, transparent 60%);
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.campaign-banner h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  position: relative;
}

.campaign-banner p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 20px;
  position: relative;
}

.campaign-banner .btn {
  position: relative;
  animation: subtle-bounce 2s ease-in-out infinite;
}

@keyframes subtle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ===== ENGAGE PAGE (engage.html) ===== */
.engage-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 50%, #16213e 100%);
  color: white;
  padding: 40px 0 30px;
  text-align: center;
  position: relative;
}

.engage-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

.engage-hero .org-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.15);
}

.engage-hero .org-badge .verified {
  color: var(--success);
}

.engage-hero h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.engage-hero p {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
}

/* Campaign stats bar */
.campaign-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}
.stat-item .stat-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--gold);
}
.stat-item .stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

/* Chat Section */
.chat-section {
  max-width: 700px;
  margin: 30px auto 0;
  padding: 0 16px 100px;
}

.chat-container {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chat-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.chat-header-info h4 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.chat-header-info span {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
}

.online-dot {
  width: 8px;
  height: 8px;
  background: #2ecc71;
  border-radius: 50%;
  display: inline-block;
  margin-left: 6px;
  animation: blink-dot 2s infinite;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Messages area */
.chat-messages {
  height: 420px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f0f2f5;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.message {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  animation: msg-in 0.3s ease-out;
  word-wrap: break-word;
}

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

.message.bot {
  background: white;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.message.user {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message.typing {
  background: white;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  padding: 16px 24px;
}

.typing-dots {
  display: flex;
  gap: 4px;
}
.typing-dots span {
  width: 8px;
  height: 8px;
  background: #bbb;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Quick replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 12px;
  background: #f0f2f5;
}

.quick-reply-btn {
  background: white;
  border: 1.5px solid var(--primary-light);
  color: var(--primary);
  padding: 8px 18px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.quick-reply-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

/* Chat input */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: white;
}

.chat-input-area input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  direction: rtl;
  outline: none;
  transition: border-color var(--transition);
}

.chat-input-area input:focus {
  border-color: var(--primary-light);
}

.chat-input-area button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-input-area button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(41, 128, 185, 0.4);
}

/* Donation amount selector */
.donation-selector {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  display: none;
}

.donation-selector.visible {
  display: block;
  animation: msg-in 0.4s ease-out;
}

.donation-selector h3 {
  margin-bottom: 6px;
  color: var(--primary-dark);
}

.donation-selector p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.amount-btn {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  text-align: center;
}

.amount-btn:hover, .amount-btn.selected {
  border-color: var(--primary-light);
  background: rgba(41, 128, 185, 0.05);
}

.amount-btn.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(41, 128, 185, 0.2);
}

.amount-btn .amount {
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 4px;
}

.amount-btn .impact {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.3;
}

.custom-amount-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.custom-amount-wrap input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  direction: ltr;
  outline: none;
}

.custom-amount-wrap input:focus {
  border-color: var(--primary-light);
}

.custom-amount-wrap span {
  font-weight: 700;
  color: var(--text-light);
}

/* ===== PAYMENT PAGE ===== */
.payment-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #f8f9fa 0%, #e8ecf1 100%);
  padding: 40px 0;
}

.payment-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}

.payment-card-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 28px 32px;
  text-align: center;
}

.payment-card-header .amount-display {
  font-size: 2.6rem;
  font-weight: 900;
  margin: 8px 0 4px;
}

.payment-card-header .amount-label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}

.payment-form {
  padding: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text);
}

.form-group input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 1rem;
  direction: ltr;
  text-align: left;
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.payment-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-light);
  font-size: 0.82rem;
  margin-top: 16px;
}

.payment-secure svg {
  width: 14px;
  height: 14px;
}

/* Processing overlay */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.processing-overlay.active {
  display: flex;
}

.processing-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== THANKS PAGE ===== */
.thanks-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: white;
}

.thanks-card {
  max-width: 520px;
}

.thanks-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #2ecc71);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 24px;
  animation: pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.thanks-card h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.thanks-card .impact-msg {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 1.1rem;
  line-height: 1.7;
  border: 1px solid rgba(255,255,255,0.15);
}

.thanks-card .ai-followup {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.share-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  color: white;
}

.share-btn.whatsapp { background: #25d366; }
.share-btn.facebook { background: #1877f2; }
.share-btn.copy { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3); }

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

/* ===== DASHBOARD ===== */
.dashboard {
  padding: 30px 0;
}

.dashboard-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 40px 0;
  text-align: center;
  margin-bottom: 30px;
}

.dashboard-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.dashboard-header p {
  color: rgba(255,255,255,0.7);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.metric-card .metric-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.metric-card .metric-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
}

.metric-card .metric-change {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 4px;
}

.metric-card .metric-change.positive { color: var(--success); }
.metric-card .metric-change.negative { color: var(--accent); }

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.chart-card h3 {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.chart-card canvas {
  width: 100% !important;
  max-height: 280px;
}

/* Comparison table */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.comparison-table th {
  background: var(--primary-dark);
  color: white;
  padding: 14px 20px;
  font-size: 0.9rem;
}

.comparison-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table .highlight-cell {
  color: var(--success);
  font-weight: 700;
}

/* Demo badge */
.demo-badge {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.78rem;
  z-index: 999;
  backdrop-filter: blur(10px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  .article-body { padding: 24px; margin: -12px 12px 24px; }
  .campaign-banner { padding: 24px; }

  .chat-messages { height: 350px; }
  .message { max-width: 90%; }

  .amount-grid { grid-template-columns: repeat(2, 1fr); }

  .chart-grid { grid-template-columns: 1fr; }

  .nav-links { display: none; }

  .engage-hero h1 { font-size: 1.5rem; }
  .campaign-stats { gap: 20px; }
  .stat-item .stat-value { font-size: 1.3rem; }

  .payment-form { padding: 24px; }
  .form-row { grid-template-columns: 1fr; }

  .metrics-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .amount-grid { grid-template-columns: 1fr 1fr; }
  .metrics-grid { grid-template-columns: 1fr; }
  .campaign-stats { flex-direction: column; gap: 12px; }
}
