/* =============================
   Global Variables and Base Styles
============================= */
:root {
  --primary-color: #0b3d54;
  --secondary-color: #4e5542;
  --accent-color: #c59c4d;
  --accent-color2: #7a2e2e;
  --bg-color: #f4e3c1;
  --text-color: #000;
  --font-size-base: 22px;
}

body {
  margin: 0;
  font-family: 'Amiri', sans-serif;
  /* Amiri - Cairo - Noto Naskh Arabic */
  background-color: var(--bg-color);
  color: var(--text-color);
  direction: rtl;
  transition: background-color 0.5s, color 0.5s;
  font-size: var(--font-size-base);
}

.dark-mode {
  --bg-color: #121212;
  --text-color: #fff;
}


/* =============================
   Background Image Styles
============================= */

body::before {
  content: "";
  position: fixed;
  top: 0px;
  right: 0;
  bottom: 0px;
  left: 0;
  background: url('background.jpg') no-repeat center center fixed;
  background-size: cover;
  opacity: 0.2;
  /* Adjust transparency */
  z-index: -1;
  pointer-events: none;
}

html {
  scroll-behavior: smooth;
}

.dark-mode body::before {
  background: url('background.jpg') no-repeat center center fixed;
  background-size: cover;
  opacity: 0.9;
  /* Slightly darker */
}


/* =============================
   Header
============================= */
header {
  background-color: var(--primary-color);
  color: white;
  padding: 0.1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: transform 0.4s ease, opacity 0.5s ease, height 0.4s ease;
  transform: translateY(0);
  opacity: 1;
  height: auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 a,
header h2 a {
  transition: color 0.3s, transform 0.3s;
  display: inline-block;
  color: white;
}

header h1 a:hover {
  color: var(--accent-color);
  transform: scale(1.1);
}

header h2 a:hover {
  color: var(--accent-color);
  transform: scale(1.5);
}


header.hide-on-scroll {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  height: 0;
  /* <---- NEW important line */
  overflow: hidden;
  /* <--- make sure collapsing happens cleanly */
}

.toggle-mode {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;
}

.toggle-mode:hover {
  color: var(--accent-color);
  transform: rotate(20deg) scale(1.2);
}

.header-buttons {
  position: absolute;
  right: 2rem;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 4.5rem;
  z-index: 1001;
}


.toggle-number-mode {
  background: none;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  width: 42px;
  text-align: center;
}

.toggle-number-mode:hover {
  background: rgba(255, 255, 255, 0.1);
}


/* =============================
   Hero Section
============================= */
.hero {
  padding: 1rem 2rem;
  text-align: center;
  background: linear-gradient(145deg, var(--primary-color), var(--accent-color));
  box-shadow: inset 0 -5px 10px rgba(0, 0, 0, 0.05);
  color: white;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2rem;
  }
}


/* =============================
   Dropdown Section (Interactive Panels)
============================= */
.dropdown-btn {
  background-color: white;
  color: var(--primary-color);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.dropdown-btn:hover {
  background-color: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

.arrow.fas {
  display: inline-block;
  transition: transform 0.4s ease;
}

.arrow.fas.rotated {
  transform: rotate(180deg);
}

.dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s ease, opacity 0.4s ease;
  opacity: 0;
}

.dropdown-content.show {
  max-height: 1500px;
  opacity: 1;
}

.dropdown-inner {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  color: black;
  max-height: 500px;
  /* Adjust as needed */
  overflow-y: auto;
  direction: rtl;
  line-height: 1.7;
  scroll-behavior: smooth;
}

.dropdown-inner img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.dropdown-inner::-webkit-scrollbar {
  width: 6px;
}

.dropdown-inner::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 4px;
}


/* =============================
   Content
============================= */
/* Better row spacing */
.container .row {
  margin: 50px 0;
}

.container {
  /* background-color: var(--bg-color); */
  max-width: 1500px;
  margin: 0 auto;
  margin-left: auto;
  margin-right: auto;
  direction: rtl;
}

/* .dark-mode .container {
  background-color: var(--bg-color);
} */

/* Header and paragraph refinement */
.content1,
.container h1 {
  font-size: 3rem;
}

.content1,
.container h2 {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.content1,
.container h3 {
  font-size: 2rem;
  color: var(--accent-color);
  margin-bottom: 0.1rem;
}

.content1,
.container p,
ul,
li {
  font-size: 1.8rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: #000;
}

.dark-mode .content1,
.dark-mode .container p,
.dark-mode ul,
.dark-mode li {
  color: #fff;
}

.container iframe {
  border: 3px solid var(--secondary-color);
  /* Border inside the iframe */
  border-radius: 8px;
  /* Rounded corners */
  margin: 0;
  /* Remove default margin */
  padding: 0;
  /* Remove default padding */
  display: block;
  /* Eliminate inline spacing */
  width: 100%;
  /* Full width to fit the container */
  height: 500px;
  /* Desired height */
}

.vocab-inline {
  font-weight: bold;
  color: #c0392b;
  /* لون مميز */
}


/* =============================
   Framed shadowed image
============================= */
.image-frame-wrapper {
  text-align: center;
  margin: 40px 0;
}

.image-frame-group {
  display: inline-flex;
  /* line them up side-by-side */
  gap: 20px;
  /* spacing between frames */
  flex-wrap: wrap;
  /* allows wrapping on small screens */
  justify-content: center;
  /* center them inside wrapper */
}

.image-frame {
  display: inline-block;
  padding: 20px;
  border: 2px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  background: #fff;
  text-align: center;
}

.image-frame img {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.image-frame-transparent {
  display: inline-block;
  padding: 20px;
  border-radius: 12px;
  /* background: var(--bg-color); */
  text-align: center;
}


.image-frame-transparent img {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: inline-block;
}


.dark-mode .image-frame-transparent {
  display: inline-block;
  padding: 20px;
  border: 2px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  background: #ddd;
  text-align: center;
}

.image-frame-wrapper iframe {
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: rgb(255, 255, 255);
  backdrop-filter: blur(8px);
}

/* On Hover Effect */
.image-frame-wrapper iframe:hover {
  transform: scale(1.01);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.caption {
  color: #555;
  font-size: 1.6rem;
  text-align: center;
  margin-top: 0.5em;
  background: var(--accent-color2);
  border-radius: 8px;
  padding: 0.3em 0.8em;
  display: inline-block;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  direction: rtl;
}


/* =============================
   Suggested Pages Section
============================= */

.suggested-pages {
  padding: 2rem;
  background: linear-gradient(145deg, var(--primary-color), var(--accent-color));
  border-radius: 12px;
  margin: 2rem 0;
  text-align: center;
  color: white;
}

.suggested-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  text-align: center;
}

.suggested-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.suggested-grid {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
}

.suggested-card {
  background: white;
  color: var(--primary-color);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 300px;
  flex-shrink: 0;
}

.suggested-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.suggested-button {
  background: var(--accent-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.suggested-button:hover {
  background: var(--accent-color2);
}


/* =============================
   Back to top button
============================= */
#backToTop {
  position: fixed;
  bottom: 35px;
  left: 35px;
  padding: 10px 15px;
  font-size: 16px;
  background-color: #333;
  opacity: 0.9;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1000;
  /* Keep on top */
}

#backToTop:hover {
  background-color: var(--secondary-color);
  opacity: 1;
  transform: scale(1.1);
}

/* =============================
   Scroll to Bottom button
============================= */
#scrollToBottom {
  position: fixed;
  bottom: 35px;
  right: 35px;
  padding: 10px 15px;
  font-size: 16px;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1000;
  opacity: 0.9;
  /* Keep on top */
}

#scrollToBottom:hover {
  background-color: var(--secondary-color);
  opacity: 1;
  transform: scale(1.1);
}

/* =============================
   Load Iframe Button
============================= */

.load-iframe-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  top: 40px;
  animation: pulse 2s infinite;
  transition: transform 0.3s ease;
}

.load-iframe-btn i {
  font-size: 2rem;
  color: #007bff;
  transition: color 0.3s ease;
}

.load-iframe-btn:hover i {
  color: #0056b3;
  transform: scale(1.2);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}


/* =============================
   Footer
============================= */
footer {
  background-color: #f0f0f0;
  padding: 1rem;
  text-align: center;
  color: #555;
  font-size: 0.9rem;
  transform: translateY(30px);
}

.dark-mode footer {
  background-color: #1e1e1e;
  color: #aaa;
}