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

/* Color Variables and Theme System */
:root {
  /* Default: Dark Theme (Premium & Immersive for Manga) */
  --bg-primary: hsl(222, 24%, 8%);
  --bg-secondary: hsl(222, 24%, 12%);
  --bg-tertiary: hsl(222, 20%, 18%);
  --text-primary: hsl(210, 20%, 98%);
  --text-secondary: hsl(215, 15%, 72%);
  --text-muted: hsl(215, 12%, 52%);
  
  --accent-primary: hsl(342, 100%, 62%);
  --accent-secondary: hsl(263, 90%, 66%);
  --accent-hover: hsl(342, 100%, 55%);
  --accent-rgb: 255, 61, 120;
  
  --border-color: hsl(222, 15%, 18%);
  --border-glow: hsla(342, 100%, 62%, 0.15);
  
  --card-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.6);
  --glass-bg: rgba(12, 15, 23, 0.85);
  --glass-border: rgba(255, 255, 255, 0.06);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="light"] {
  --bg-primary: hsl(210, 20%, 97%);
  --bg-secondary: hsl(0, 0%, 100%);
  --bg-tertiary: hsl(210, 20%, 91%);
  --text-primary: hsl(222, 24%, 12%);
  --text-secondary: hsl(215, 15%, 35%);
  --text-muted: hsl(215, 12%, 55%);
  
  --accent-primary: hsl(342, 90%, 50%);
  --accent-secondary: hsl(263, 75%, 55%);
  --accent-hover: hsl(342, 90%, 42%);
  --accent-rgb: 230, 10, 80;
  
  --border-color: hsl(214, 20%, 88%);
  --border-glow: hsla(342, 90%, 50%, 0.08);
  
  --card-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.05);
}

/* Reset and Core Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Cairo', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typography Custom Rules */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cairo', sans-serif;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.6em;
  letter-spacing: normal;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.85rem; border-right: 4px solid var(--accent-primary); padding-right: 12px; margin-top: 1.5em; }
h3 { font-size: 1.4rem; margin-top: 1.2em; }
h4 { font-size: 1.15rem; }

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--accent-hover);
}

p {
  margin-bottom: 1.35rem;
  color: var(--text-secondary);
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0;
}

/* Header and Navigation (Glassmorphic) */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
}

.header-scrolled {
  padding: 8px 0;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  font-family: 'Cairo', sans-serif;
  font-weight: 850;
  font-size: 1.75rem;
  color: var(--text-primary);
}

.logo span {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 28px;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  padding: 8px 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  transition: var(--transition-smooth);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent-primary);
  transform: rotate(20deg);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.theme-toggle .sun-icon { display: none; }
[data-theme="light"] .theme-toggle .moon-icon { display: none; }
[data-theme="light"] .theme-toggle .sun-icon { display: block; }

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 160px 0 80px;
  background: radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.08), transparent 45%),
              radial-gradient(circle at bottom left, rgba(100, 50, 200, 0.06), transparent 45%);
  text-align: center;
  overflow: hidden;
}

.hero-tagline {
  display: inline-block;
  padding: 6px 18px;
  background-color: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
}

.hero h1 {
  font-size: 3.25rem;
  max-width: 850px;
  margin: 0 auto 20px;
  font-weight: 800;
}

.hero p {
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto 32px;
  color: var(--text-secondary);
}

/* Search Bar Component */
.search-container {
  max-width: 550px;
  margin: 0 auto;
  position: relative;
  box-shadow: var(--card-shadow);
  border-radius: 100px;
}

.search-input {
  width: 100%;
  padding: 16px 28px;
  padding-left: 60px;
  border-radius: 100px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition-smooth);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px var(--border-glow);
}

.search-btn {
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

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

/* Article Card Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
}

.card {
  background-color: var(--bg-secondary);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition-bounce);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--card-shadow);
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
}

.card-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background-color: var(--bg-tertiary);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.card:hover .card-img {
  transform: scale(1.05);
}

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  background-color: var(--accent-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
}

.card-score {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(10, 15, 25, 0.85);
  backdrop-filter: blur(4px);
  border: 2px solid var(--accent-primary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  align-items: center;
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--bg-tertiary);
}

.author-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.read-more {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.read-more svg {
  width: 16px;
  height: 16px;
  transition: var(--transition-smooth);
  transform: scaleX(-1); /* RTL arrow mapping */
}

.card:hover .read-more svg {
  transform: scaleX(-1) translateX(-4px);
}

/* Featured Article Section */
.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background-color: var(--bg-secondary);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  margin-bottom: 56px;
}

.featured-img-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 350px;
}

.featured-content {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-content h2 {
  font-size: 2rem;
  border: none;
  padding: 0;
  margin-bottom: 16px;
}

/* Sidebar and Main Content Page Layout */
.layout-split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.widget {
  background-color: var(--bg-secondary);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-color);
}

.widget-title {
  font-size: 1.15rem;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  position: relative;
}

.widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 40px;
  height: 2px;
  background-color: var(--accent-primary);
}

/* Top Rated Widget */
.widget-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  list-style: none;
}

.widget-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.widget-item-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background-color: var(--bg-tertiary);
}

.widget-item-info {
  flex-grow: 1;
}

.widget-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.widget-item-score {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 700;
}

/* Newsletter Widget */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.95rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.3);
}

/* Article Detail Page CSS */
.article-header {
  padding: 140px 0 60px;
  text-align: center;
  background: linear-gradient(to bottom, rgba(var(--accent-rgb), 0.05), transparent);
}

.article-category {
  display: inline-block;
  padding: 4px 12px;
  background-color: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.article-title {
  font-size: 2.75rem;
  max-width: 900px;
  margin: 0 auto 24px;
  line-height: 1.35;
}

.article-featured-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 24px;
  margin-bottom: 48px;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

.article-body-wrapper {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
}

/* Premium Typography for Articles */
.article-content {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.article-content p {
  margin-bottom: 1.75rem;
  text-align: justify;
}

.article-content p:first-of-type::first-letter {
  font-size: 3.5rem;
  font-weight: 800;
  float: right;
  line-height: 1;
  padding-left: 12px;
  color: var(--accent-primary);
}

.article-content blockquote {
  border-right: 4px solid var(--accent-primary);
  border-left: none;
  padding: 8px 24px;
  margin: 32px 0;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  border-radius: 12px 0 0 12px;
}

.article-content ul, .article-content ol {
  margin: 0 24px 24px 0;
}

.article-content li {
  margin-bottom: 8px;
}

/* Review Box */
.review-box {
  background-color: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 32px;
  margin: 48px 0;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.review-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.review-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.review-score-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  font-size: 1.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.3);
}

.review-criteria {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.criteria-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.criteria-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
}

.criteria-bar-bg {
  width: 100%;
  height: 8px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.criteria-bar-fill {
  height: 100%;
  background: linear-gradient(270deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
  transition: width 1s ease-in-out;
}

.review-verdict {
  font-size: 1.05rem;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

.verdict-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* Footer Section */
.footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 80px 0 40px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}

.footer-col-title {
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-link:hover {
  color: var(--text-primary);
  transform: translateX(-4px); /* RTL hover translation */
}

.footer-socials {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.social-link:hover {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-legal-links {
  display: flex;
  gap: 24px;
}

.footer-legal-link {
  color: var(--text-muted);
}

.footer-legal-link:hover {
  color: var(--text-primary);
}

/* Contact Form */
.contact-form {
  background-color: var(--bg-secondary);
  border-radius: 16px;
  padding: 40px;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  max-width: 650px;
  margin: 0 auto;
}

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

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-textarea {
  resize: vertical;
  min-height: 150px;
}

/* Search results styles */
.search-results-title {
  margin-bottom: 32px;
}

.no-results {
  text-align: center;
  padding: 80px 0;
  color: var(--text-secondary);
}

/* AdSense Mock Space Banner */
.adsense-slot-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 32px auto;
  max-width: 728px;
  width: 100%;
}

.adsense-slot {
  background-color: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  width: 100%;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.adsense-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.adsense-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  
  .layout-split {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  
  .featured-card {
    grid-template-columns: 1fr;
  }
  
  .featured-img-wrapper {
    height: 250px;
    min-height: 250px;
  }
  
  .featured-content {
    padding: 32px;
  }
  
  .article-body-wrapper {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .hero h1 {
    font-size: 2.25rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
