/* ---------------------------------------------------------------
   مكتبة النور – CSS Theme
   Dark‑green background, neon typography, glassmorphism cards.
   Uses Google Fonts: Droid Arabic Kufi, Cairo, Tajawal.
   --------------------------------------------------------------- */

:root {
  --bg-color: #0a2008;                /* Very dark green */
  --primary-neon: #00ff41;            /* Neon green */
  --accent-neon: #39ff14;            /* Slightly brighter */
  --gold-neon: #ffd700;              /* Golden neon */
  --text-light: #e0ffe0;              /* Soft white-green */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --transition-speed: 0.3s;
  --font-base: 'Noto Kufi Arabic', sans-serif;
  --font-heading: 'Noto Kufi Arabic', sans-serif;
}

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

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

body {
  direction: rtl;
  font-family: var(--font-base) !important;
  background: var(--bg-color);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
}

input, button, select, textarea {
  font-family: var(--font-base) !important;
}

h1 { font-size: 2.2rem !important; }
h2 { font-size: 1.8rem !important; }
h3 { font-size: 1.3rem !important; }

.gold-title {
  color: var(--gold-neon) !important;
  text-shadow: 0 0 10px var(--gold-neon), 0 0 20px var(--gold-neon) !important;
}

.small-title {
  font-size: 1.5rem !important;
}

/* ---------------------------------------------------------------
   Layout – Sidebar & Main Content
   --------------------------------------------------------------- */
/* ---------------------------------------------------------------
   Layout – Top Navigation & Main Content
   --------------------------------------------------------------- */
.top-info-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #061a05;
  color: #ffffff;
  text-align: center;
  padding: 0.5rem;
  font-size: 1.1rem;
  z-index: 1100;
  font-weight: 500;
}

.top-nav {
  position: fixed;
  top: 40px; /* Offset by info bar height */
  left: 0;
  width: 100%;
  min-height: 80px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 2rem;
  z-index: 1000;
  transition: transform var(--transition-speed) ease;
  flex-wrap: wrap;
  gap: 1rem;
}
.top-nav .logo {
  font-family: var(--font-heading);
  font-size: 2.2rem; /* Slightly larger for "اقرأ" */
  color: var(--primary-neon);
  text-shadow: 0 0 10px var(--primary-neon);
  font-weight: 900;
}
.top-nav .nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.top-nav .nav-links li a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  transition: all var(--transition-speed);
}
.top-nav .nav-links li a:hover {
  background: rgba(0, 255, 65, 0.1);
  color: var(--primary-neon);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.search-box.nav-search.always-visible {
  display: flex;
  width: 250px;
}
@media (max-width: 768px) {
  .search-box.nav-search.always-visible {
    width: 100%;
    margin: 10px 0;
  }
}

/* Hamburger Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1100;
  padding: 5px;
}
.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--primary-neon);
  border-radius: 2px;
  transition: 0.3s;
}

@media (max-width: 992px) {
  .top-nav { padding: 0.5rem 1rem; }
  .menu-toggle { display: flex; }
  .top-nav .nav-links {
    position: fixed;
    top: 120px; /* Offset by both bars */
    right: -100%;
    width: 250px;
    height: calc(100vh - 80px);
    background: rgba(10, 32, 8, 0.95);
    backdrop-filter: blur(15px);
    flex-direction: column;
    padding: 2rem;
    transition: 0.4s ease;
    border-right: 1px solid var(--glass-border);
    gap: 1.5rem;
  }
  .top-nav .nav-links.active { right: 0; }
  .nav-search { display: none; } /* Hide main search on mobile nav bar, keep in main content if needed */
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem !important; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

.main-content {
  margin-top: 130px; /* space for top nav and info bar */
  padding: 2rem;
}

/* ---------------------------------------------------------------
   Hero Section
   --------------------------------------------------------------- */
.hero {
  height: 80vh;
  background: linear-gradient(135deg, #003300, #001a00);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, var(--primary-neon), transparent 60%);
  opacity: 0.2;
  animation: pulse 6s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity:0.2; }
  50% { transform: scale(1.2); opacity:0.4; }
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: 4rem;
  color: var(--primary-neon);
  text-shadow: 0 0 12px var(--primary-neon);
}
.hero p {
  margin-top: 1rem;
  font-size: 1.5rem;
  color: var(--text-light);
}
.search-box {
  display: flex;
  gap: 0.5rem;
}
.nav-search {
  margin-top: 0;
  flex-grow: 1;
  max-width: 400px;
  justify-content: center;
}
.search-box input {
  padding: 0.8rem 1rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-light);
  border-radius: 4px;
  width: 250px;
  transition: border var(--transition-speed);
}
.search-box input:focus {
  outline: none;
  border-color: var(--primary-neon);
}
.search-box button {
  padding: 0.8rem 1.2rem;
  background: var(--primary-neon);
  border: none;
  border-radius: 4px;
  color: #000;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 8px var(--primary-neon);
  transition: background var(--transition-speed);
}
.search-box button:hover {
  background: var(--accent-neon);
}

/* ---------------------------------------------------------------
   Section & Grid
   --------------------------------------------------------------- */
.section {
  margin-top: 4rem;
}
.section h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--primary-neon);
  margin-bottom: 2rem;
  text-shadow: 0 0 8px var(--primary-neon);
}
.filters {
  margin-bottom: 1.5rem;
}
.filters select {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background: var(--glass-bg);
  color: var(--text-light);
  border: 1px solid var(--glass-border);
  cursor: pointer;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
/* Card – Glassmorphism + Neon Border */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  backdrop-filter: blur(8px);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 15px var(--primary-neon);
  border-color: var(--primary-neon);
}
.card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.card h3 {
  font-size: 0.95rem; /* Reduced size as requested */
  color: var(--accent-neon);
  margin: 0.3rem 0;
}
.card .author {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.card .summary {
  flex-grow: 1;
  font-size: 0.85rem;
  color: #c0ffc0;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 4.5rem;
}
.card .actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}
.card button {
  flex: 1;
  padding: 0.4rem;
  background: var(--primary-neon);
  border: none;
  border-radius: 4px;
  color: #000;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition-speed);
}
.card button:hover {
  background: var(--accent-neon);
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
footer {
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
}
footer .social a {
  margin: 0 0.5rem;
  color: var(--primary-neon);
  font-size: 1.5rem;
  transition: transform var(--transition-speed);
}
footer .social a:hover {
  transform: scale(1.2);
}
footer p {
  margin-top: 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------
   Responsive Adjustments
   --------------------------------------------------------------- */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main-content { margin-right: 0; padding: 1rem; }
  .hero { justify-content: center; padding-left: 0; height: 60vh; }
  .top-nav {
    flex-direction: column;
    padding: 1rem;
  }
  .nav-search {
    max-width: 100%;
    order: 3;
    width: 100%;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 2.5rem; }
  .hero p { font-size: 1rem; }
  .top-nav .nav-links li a { font-size: 1rem; padding: 0.3rem; }
}
