/* ----------------------------------------------------
   CORE STYLES & CLS = 0.00 ARCHITECTURE
   Gap #10: Light Mode CSS variables added
   ---------------------------------------------------- */
@font-face {
  font-family: 'Cairo';
  src: url('/fonts/cairo-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-color: #38bdf8;
  --brand-whatsapp: #25d366;
  --border-color: #334155;
  --container-width: 1000px;
  --card-bg: #1e293b;
  --input-bg: #0f172a;
}

/* Gap #10: Light Mode Variables */
body.light-mode {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --accent-color: #0284c7;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --input-bg: #f1f5f9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.7;
  direction: rtl;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Footer */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 0;
  transition: background-color 0.3s ease;
}

.logo {
  font-size: 22px;
  font-weight: bold;
  color: var(--accent-color);
  text-decoration: none;
}

/* Gap #10: Theme Toggle Button */
.theme-toggle-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
}

.theme-toggle-btn:hover {
  opacity: 0.8;
}

.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 25px 0;
  text-align: center;
  margin-top: 50px;
  color: var(--text-muted);
  font-size: 14px;
  transition: background-color 0.3s ease;
}

/* ----------------------------------------------------
   MODULE 4: ADSENSE CLS PREVENTER (CLS = 0.00)
   ---------------------------------------------------- */
.ad-container-reserved {
  width: 100%;
  min-height: 280px;
  aspect-ratio: 16 / 9;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 25px 0;
  contain: layout style;
}

.ad-placeholder {
  color: var(--text-muted);
  font-size: 14px;
}

/* Auto-Ads handling */
google-auto-placed {
  contain: layout style;
  transition: min-height 0.3s ease;
}

/* ----------------------------------------------------
   ARTICLE READER LAYOUT & VIRAL LOCKER (MODULE 5)
   ---------------------------------------------------- */
.article-container {
  margin-top: 30px;
}

.article-header {
  margin-bottom: 25px;
}

.category-badge {
  background: #0284c7;
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}

.article-header h1 {
  font-size: 32px;
  margin: 15px 0;
  color: var(--text-main);
}

.article-meta {
  color: var(--text-muted);
  font-size: 14px;
}

.article-body {
  position: relative;
  font-size: 18px;
  color: var(--text-main);
}

/* SEO-Safe Blur Filter */
.locked-blur-content {
  filter: blur(12px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.5s ease;
}

.unlocked-clean-content {
  filter: none;
  user-select: text;
  pointer-events: auto;
}

/* Locker Overlay */
.viral-locker-overlay {
  position: absolute;
  top: 10%;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
}

.locker-card {
  background: var(--card-bg);
  border: 2px solid var(--accent-color);
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

body.light-mode .locker-card {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.locker-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.progress-bar-container {
  background: var(--input-bg);
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin: 20px 0 10px;
  border: 1px solid var(--border-color);
}

.progress-bar-fill {
  background: linear-gradient(90deg, #38bdf8, #25d366);
  height: 100%;
  transition: width 0.4s ease;
}

.locker-input-group {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.locker-input {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 16px;
}

.whatsapp-btn {
  background: var(--brand-whatsapp);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.whatsapp-btn:hover {
  opacity: 0.9;
}

.viral-personalized-hero {
  background: linear-gradient(90deg, #0284c7, #16a34a);
  color: #fff;
  padding: 12px 0;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
}

/* ----------------------------------------------------
   GAME PAGE & ANTI-THIN ENRICHMENT (MODULE 3)
   ---------------------------------------------------- */
.game-wrapper {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  margin-top: 30px;
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

.game-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.game-toolbar .tool-btn {
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 8px;
  font-weight: bold;
  transition: background 0.2s;
}

.game-toolbar .tool-btn:hover {
  opacity: 0.8;
}

.iframe-container-aspect {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 480px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.iframe-container-aspect iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.enrichment-section {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.controls-grid, .tech-specs-container, .faq-accordion, .ugc-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
  transition: background-color 0.3s ease;
}

.grid-table {
  display: flex;
  flex-direction: column;
  margin-top: 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.grid-row.header {
  background: var(--input-bg);
  font-weight: bold;
  color: var(--accent-color);
}

.specs-table {
  width: 100%;
  margin-top: 15px;
  border-collapse: collapse;
}

.specs-table th, .specs-table td {
  padding: 12px;
  border: 1px solid var(--border-color);
  text-align: right;
}

.specs-table th {
  background: var(--input-bg);
  color: var(--accent-color);
  width: 30%;
}

.faq-item {
  margin-top: 12px;
  background: var(--input-bg);
  border-radius: 8px;
  padding: 12px 18px;
  border: 1px solid var(--border-color);
}

.faq-question {
  font-weight: bold;
  cursor: pointer;
  color: var(--accent-color);
}

.faq-answer {
  margin-top: 8px;
  color: var(--text-muted);
}

.rating-summary {
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rating-score {
  font-size: 24px;
  font-weight: bold;
  color: #f59e0b;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.comment-item {
  background: var(--input-bg);
  padding: 10px 15px;
  border-radius: 6px;
}

/* Responsive */
@media (max-width: 640px) {
  .grid-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .game-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
