/* Custom Styles for Arabic Educational Notes Platform */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@400;500;700;900&display=swap');

:root {
  --font-cairo: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-tajawal: 'Tajawal', system-ui, -apple-system, sans-serif;
  --primary-gradient: linear-gradient(135deg, #e11d48 0%, #ec4899 50%, #8b5cf6 100%);
  --secondary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --hero-bg: linear-gradient(180deg, #fff1f2 0%, #faf5ff 50%, #ffffff 100%);
}

* {
  font-family: var(--font-cairo);
  box-sizing: border-box;
}

/* Base Hyperlink Styling - Prevent browser default blue/purple colors */
a, a:visited {
  color: inherit;
  text-decoration: none;
}

body {
  direction: rtl;
  text-align: right;
  background-color: #f8fafc;
  color: #1e293b;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Brand Gradients */
.bg-brand-gradient {
  background: linear-gradient(135deg, #e11d48 0%, #d946ef 50%, #7c3aed 100%);
}

.text-brand-gradient {
  background: linear-gradient(135deg, #e11d48 0%, #c026d3 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Subject Badges & Themes */
.badge-arabic {
  background-color: #ffe4e6;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.badge-math {
  background-color: #d1fae5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-english {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-science {
  background-color: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-social {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-math-lang {
  background-color: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.badge-religion {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-ict {
  background-color: #ccfbf1;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

/* Card Hover Animation */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Hero Badge */
.hero-badge {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(225, 29, 72, 0.15);
  box-shadow: 0 4px 15px rgba(225, 29, 72, 0.08);
}

/* ==========================================================================
   Rich Content & Article Typography (Headings, Backlinks, Formats)
   Scoped ONLY to .file-rich-content (No global h1-h6 changes)
   ========================================================================== */
.file-rich-content {
  direction: rtl;
  text-align: right;
  color: #334155;
  font-weight: 400;
  line-height: 2;
}

.file-rich-content h2 {
  display: block;
  direction: rtl;
  text-align: right;
  font-size: 1.45rem;
  font-weight: 900;
  color: #0f172a;

  border: none;
  border-right: 6px solid #e11d48;
  padding-right: 12px;

  margin: 30px 0 16px;
  line-height: 1.6;

  background: transparent;
}

.file-rich-content h3 {
  display: block;
  direction: rtl;
  text-align: right;
  font-size: 1.22rem;
  font-weight: 800;
  color: #0f172a;

  border: none;
  border-right: 4px solid #f43f5e;
  padding-right: 10px;

  margin: 25px 0 13px;
  line-height: 1.6;

  background: transparent;
}

.file-rich-content h4 {
  display: block;
  direction: rtl;
  text-align: right;
  font-size: 1.08rem;
  font-weight: 700;
  color: #334155;

  border: none;
  border-right: 3px solid #cbd5e1;
  padding-right: 8px;

  margin: 20px 0 10px;
  background: transparent;
}

.file-rich-content p {
  display: block;
  margin: 0 0 18px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 2;
  color: #334155;
}

.file-rich-content strong,
.file-rich-content b {
  font-weight: 800;
  color: #0f172a;
}

.file-rich-content a,
.file-rich-content a:visited {
  color: #e11d48 !important;
  font-weight: 800 !important;
  text-decoration: underline !important;
  text-decoration-color: #f43f5e !important;
  text-decoration-thickness: 1.5px !important;
  text-underline-offset: 4px !important;
  transition: all 0.2s ease-in-out !important;
}

.file-rich-content a:hover {
  color: #be123c !important;
  text-decoration-color: #be123c !important;
}

.file-rich-content ul {
  list-style-type: disc;
  list-style-position: inside;
  padding-right: 12px;
  margin: 0 0 18px;
}

.file-rich-content ol {
  list-style-type: decimal;
  list-style-position: inside;
  padding-right: 12px;
  margin: 0 0 18px;
}

.file-rich-content li {
  margin-bottom: 6px;
  color: #334155;
  line-height: 2;
}

.file-rich-content blockquote {
  margin: 24px 0;
  padding: 14px 18px;
  background-color: #f8fafc;
  border: none;
  border-right: 4px solid #f43f5e;
  border-radius: 6px 0 0 6px;
  color: #334155;
  font-style: normal;
}

.file-rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}
