/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Layout */
body {
  font-family: "Georgia", serif;
  display: flex;
  background: #fff;
  color: #000;
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background: #fff;
  border-right: 1px solid #ddd;
  padding: 20px;
  display: flex;               /* make sidebar flexible */
  flex-direction: column;      /* stack items vertically */
  align-items: center;         /* center horizontally */
  text-align: center;          /* center text under image */
}

.sidebar img {
  width: 150px;
  border-radius: 50%;
  margin: 20px 0 15px 0;  /* top margin added (20px) */
  border: 2px solid #fff;  /* base border */
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3); /* subtle shadow in light mode */
  animation: glowPulse 3s ease-in-out infinite;
}


.sidebar h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.sidebar p {
  font-size: 14px;
  margin-bottom: 20px;
}

/* Sidebar links styled like aligned buttons */
.sidebar ul {
  list-style: none;
  padding: 0;
  width: 100%;              /* make list take full width */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar ul li a {
  display: flex;
  align-items: center;
  justify-content: center;  /* center text + icon */
  gap: 6px;
  font-size: 13px;
  color: #000;
  text-decoration: none;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: #f9f9f9;
  transition: all 0.2s ease-in-out;
  width: 90%;              /* make button fill sidebar width */
  box-sizing: border-box;   /* avoid overflow */
}

.sidebar ul li a:hover {
  background: #fff;
  border-color: #000;
}

/* Sidebar buttons */
.sidebar a {
  display: block;
  padding: 10px;
  margin: 5px 0;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 5px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* Sidebar hover with pulsating glow */
.sidebar a:hover {
  background: #000;
  border: 1px solid #fff; /* black border */
  animation: sidebarPulse 2s ease-in-out infinite;
}


.greeting {
  font-family: "Scheherazade New", serif; /* elegant Arabic font (Google Fonts) */
  font-size: 1.8em;
  text-align: center;
  margin-bottom: 12px;
  color: #000;
}
/* Content */
.main {
  margin-left: 270px;
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  /* max-width:800px; */
}

/* Header */
.header {
  display: flex;
  justify-content: space-between; /* pushes menu to right */
  align-items: center;
  padding: 30px 20px;
  border-bottom: 1px solid #ccc;
  background: #fff;
}

.site-title a {
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  color: #000;
}

/* Top Navigation */
.top-nav ul {
  list-style: none;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.top-nav a {
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f9f9f9;
  color: #000;
  transition: all 0.2s ease;
}

.top-nav a:hover {
  background: #fff;
  border: 1px solid #333; /* green border */
  animation: sidebarPulse 2s ease-in-out infinite;
}

.intro-section {
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  line-height: 1.6;
}

.intro-section h2 {
  text-align: center;
  margin-bottom: 30px;
}

.intro-section section {
  margin-bottom: 25px;
  padding: 15px;
  border-left: 4px solid #000;
  background: #f9f9f9;
  border-radius: 6px;
}

.lang-buttons {
  margin-top: 10px;
}

.lang-buttons button {
  font-size: 0.56em;
  padding: 4px 8px;
  margin-right: 5px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #000;
  color: #fff;
  transition: background 0.3s;
}

.lang-buttons button:hover {
  background: #26a69a;
}


/* Modal background */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.7);
}

/* Modal box */
.modal-content {
  background: #fff;
  margin: auto;
  padding: 20px;
  border-radius: 8px;
  width: 60%;
  max-width: 500px;
  text-align: center;
}

/* Article style */
h2 {
  font-size: 20px;
  margin: 30px 0 10px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 15px;
}

p {
  margin-bottom: 15px;
}

ul {
  margin: 10px 0 15px 20px;
}

/* Books grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 30px;
  margin-top: 20px;
}

.book {
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.book img {
  width: 150px;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.book img:hover {
  transform: scale(1.05);
}

/* Modal popup */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.7);
}

.modal-content {
  background: var(--bg-color);
  color: var(--text-color);
  margin: auto;
  padding: 20px;
  border-radius: 10px;
  width: 50%;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.close {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

/* PDF Download button */
.download-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 15px;
  background: var(--accent-color);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s;
}

.download-btn:hover {
  background: var(--accent-hover);
}


/* Dark Mode Base */
body.dark {
  background: #121212;
  color: #eee;
}

/* Dark Sidebar */
body.dark .sidebar {
  background: #1e1e1e;
  border-right: 1px solid #444;
}
body.dark .sidebar ul li a {
  background: #2a2a2a;
  border-color: #555;
  color: #eee;
}
body.dark .sidebar ul li a:hover {
  background: #3a3a3a;
}

/* Dark Header */
body.dark .header {
  background: #000;
  border-bottom: 1px solid #fff;
}
body.dark .top-nav a {
  background: #2a2a2a;
  border-color: #555;
  color: #eee;
}
body.dark .top-nav a:hover {
  background: #333;
  border: 1px solid #fff;
  animation: sidebarPulseDark 2s ease-in-out infinite;
}

/* Dark mode */
body.dark .intro-section h2 {
  color: #f1f1f1;
}

body.dark .intro-section section {
  background: #1e1e1e;          /* dark background */
  border-left-color: #4dd0e1;   /* accent color (cyan glow) */
  color: #ddd;
  box-shadow: 0 0 10px rgba(77, 208, 225, 0.2); /* subtle glow */
}

body.dark .intro-section section h3 {
  color: #fff; /* section headings brighter */
}

body.dark .intro-section p {
  color: #ccc; /* softer text */
}

body.dark .intro-section section {
  background: #1e1e1e;
  border-left-color: #fff;
  color: #ddd;
}


body.dark .modal-content {
  background: #1e1e1e;
  color: #fff;
  box-shadow: 0 0 15px rgba(77, 208, 225, 0.6);
}

/* Close button */
.close {
  color: #aaa;
  float: right;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

body.dark .lang-buttons button {
  background: #fff;
  color: #000;
}

body.dark .lang-buttons button:hover {
  background: #26a69a;
}
/* Toggle Button */
.dark-btn {
  margin-left: 15px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #000;
  cursor: pointer;
}
body.dark .dark-btn {
  background: #fff;
  border-color: #555;
  color: #eee;
}


body.dark .site-title a {
  color: #eee;
}

body.dark .sidebar img {
  border: 2px solid #000;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6), 
              0 0 24px rgba(255, 255, 255, 0.4);
  animation: glowPulseDark 3s ease-in-out infinite;
}


/* Dark mode sidebar hover */
body.dark .sidebar a:hover {
  background: #333;
  border: 1px solid #fff;
  animation: sidebarPulseDark 2s ease-in-out infinite;
}

/* Dark mode style */
body.dark .greeting {
  color: #fff;
}
/* Menu dark mode hover glow */
body.dark .menu a:hover {
  background: #333;
  border: 1px solid #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8),
              0 0 24px rgba(255, 255, 255, 0.6);
}


:root {
  --bg-color: #fff;
  --text-color: #222;
  --accent-color: #007bff;
  --accent-hover: #0056b3;
}

body.dark-mode {
  --bg-color: #1a1a1a;
  --text-color: #f0f0f0;
  --accent-color: #00bcd4;
  --accent-hover: #0097a7;
}

/* Animation keyframes */
@keyframes glowPulse {
   0% {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4),
                0 0 16px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.8),
                0 0 36px rgba(0, 0, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4),
                0 0 16px rgba(0, 0, 0, 0.2);
  }
}

@keyframes glowPulseDark {
   0% { 
box-shadow: 0 0 8px rgba(255, 255, 255, 0.4), 
      0 0 16px rgba(255, 255, 255, 0.2); 
} 

50% { 
box-shadow: 0 0 18px rgba(255, 255, 255, 0.8), 
        0 0 36px rgba(255, 255, 255, 0.6); 
} 

100% { 
box-shadow: 0 0 8px rgba(255, 255, 255, 0.4),
      0 0 16px rgba(255, 255, 255, 0.2); } 
}


@keyframes sidebarPulse {
  0% {
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4),
                0 0 12px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.8),
                0 0 28px rgba(0, 0, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4),
                0 0 12px rgba(0, 0, 0, 0.2);
  }
}

@keyframes sidebarPulseDark {
  0% {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4),
                0 0 12px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.8),
                0 0 28px rgba(255, 255, 255, 0.6);
  }
  100% {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4),
                0 0 12px rgba(255, 255, 255, 0.2);
  }
}

@keyframes top-navPulse {
  0% {
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4),
                0 0 12px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.8),
                0 0 28px rgba(0, 0, 0, 0.6);
  }
  100% {
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4),
                0 0 12px rgba(0, 0, 0, 0.2);
  }
}

@keyframes top-navPulseDark {
  0% {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4),
                0 0 12px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.8),
                0 0 28px rgba(255, 255, 255, 0.6);
  }
  100% {
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4),
                0 0 12px rgba(255, 255, 255, 0.2);
  }
}