/* =============================
   Global Variables and Base Styles
============================= */
:root {
  --primary-color: #A0522D;
  --secondary-color: #5B4636;
  --accent-color: #e6b08a;
  --accent-color2: #EFD8B2CC;
  --bg-color: #FAF5F0;
  --text-color: #2B1D14;
  --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);
}


/* =============================
   Navigation
============================= */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

nav li {
  position: relative;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  padding: 0.5rem 1rem;
  transition: color 0.3s;
}

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

/* =============================
   Mobile Navigation
============================= */

.mobile-nav-toggle {
  display: none;
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 2001;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background: var(--primary-color);
  border-radius: 50%;
}

.mobile-nav-toggle span {
  background: var(--bg-color);
  height: 3px;
  width: 24px;
  margin: 4px 0;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.mobile-nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* =============================
   Dropdown Menu (Header)
============================= */

.dropdown-menu,
.dropdown2-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: -50%;
  background: var(--primary-color);
  min-width: 400px;
  border-radius: 10px;
  padding: 2.5rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  z-index: 999;
  overflow-y: auto;
  overflow-x: visible;
  max-height: 400px;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) transparent;
}

.dropdown2-menu {
  min-width: 150px;
  transform: translateX(-50px);
  scrollbar-color: var(--accent-color2) transparent;
}

.dropdown-menu li,
.dropdown2-menu li {
  position: relative;
}

.dropdown-menu li a,
.dropdown2-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  color: white;
  font-weight: normal;
}

.dropdown-menu li a:hover {
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-color);
  font-size: 2rem;
  transform: translateX(-1%);
}

.dropdown2-menu li a:hover {
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-color2);
  font-size: 2rem;
  transform: translateX(-1%);
}

/* Nested dropdown (dropdown2) */
.dropdown2-menu {
  top: 100%;
  right: 0%;
  background: var(--secondary-color);
}

/* =============================
   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: 500px;
  opacity: 1;
}

.dropdown-inner {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  color: black;
  max-height: 1500px;
  /* 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;
}

/* =============================
   Lessons Grid
============================= */
.all-lessons {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0rem;
  flex: 4;
}

.lesson-section h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: #333;
  text-align: right;
}

.dark-mode .lesson-section h1 {
  color: var(--text-color);
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 1rem 0;
  overflow: auto;
}

.lesson-card {
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dark-mode .lesson-card {
  background: rgb(70, 77, 3);
}

.lesson-card h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.dark-mode .lesson-card h2 {
  color: var(--text-color);

}

.lesson-card p {
  font-size: 1rem;
  flex-grow: 1;
  margin-bottom: 1rem;
}

.lesson-card a {
  align-self: start;
  color: white;
  background-color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.dark-mode .lesson-card a {
  color: var(--primary-color);
  background-color: var(--bg-color);
}

.lesson-card a:hover {
  background-color: var(--accent-color);
  color: black;
}


/* =============================
   Table
============================= */
.table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
}

.alg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  background-color: var(--bg-color);
  color: var(--text-color);
}

.alg-table th,
.alg-table td {
  border: 1px solid #ddd;
  padding: 16px;
  text-align: center;
}

.alg-table thead tr {
  background-color: #f2f2f2;
}

.cell-content {
  display: block;
  direction: rtl;
  text-align: center;
}

.hr-line {
  display: block;
  width: 100%;
  height: 1px;
  background-color: #ccc;
  border: none;
  margin: 10px 0;
}

/* Light mode row colors */
.alg-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

.alg-table tbody tr:nth-child(even) {
  background-color: #f0f0f0;
}

/* Dark mode overrides */
.dark-mode .alg-table {
  background-color: #1e1e1e;
  color: var(--text-color);
}

.dark-mode .alg-table th,
.dark-mode .alg-table td {
  border-color: #444;
}

.dark-mode .alg-table thead tr {
  background-color: #2c2c2c;
}

.dark-mode .alg-table tbody tr:nth-child(odd) {
  background-color: #181818;
}

.dark-mode .alg-table tbody tr:nth-child(even) {
  background-color: #222;
}


/* =============================
   List
============================= */
/* Fancy List Enhancements */
.fancy-list {
  padding-right: 1.5rem;
  margin: 2rem 0;
  list-style: none;
  line-height: 2;
}

.fancy-list li {
  position: relative;
  padding-right: 1.8rem;
  margin-bottom: 1rem;
}

.fancy-list li::before {
  content: "=>";
  position: absolute;
  right: 0;
  color: var(--primary-color);
  font-weight: bold;
}

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

.container {
  /* background-color: var(--bg-color); */
  max-width: 1000px;
  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;
  /* لون مميز */
}


/* =============================
   General text content
============================= */

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0;
}

.row.text-left {
  flex-direction: row;
}

.row.text-right {
  flex-direction: row-reverse;
}


/* Add AOS animation style to images */
.img-box img {
  transition: transform 0.4s ease;
}

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


.img-box {
  text-align: center;
}

.img-box img {
  width: 150px;
  height: auto;
}

.text,
.img-box {
  flex: 1;
  max-width: 45%;
}


.text {
  font-size: 16px;
}



/* =============================
   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;
}

/* =============================
   Coding
============================= */

.code-container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  width: 95%;
  max-width: 850px;
  direction: rtl;
  padding-top: 3rem;
}

.dark-mode .code-container {
  background: #1e1e1e;
}

.copy-button {
  background: linear-gradient(135deg, #084316, #024b12);
  color: #fff;
  border: none;
  padding: 0.5rem 0.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.copy-button:hover {
  background: linear-gradient(135deg, #135721, #045d19);
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 6px 15px rgba(33, 136, 56, 0.4);
}


.top-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid #ddd;
  height: 3rem;
  box-sizing: border-box;
  direction: ltr;
}

.dark-mode .top-bar {
  background: #2d2d2d;
  border-bottom: 1px solid #444;
}


.language-name {
  font-size: 1rem;
  font-weight: bold;
  color: #555;
}

.dark-mode .language-name {
  color: #bbb;
}


.code-block {
  display: flex;
  background: #f5f7fa;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  overflow-x: auto;
  padding: 1rem;
  direction: rtl;
  unicode-bidi: plaintext;
}

.code-block {
  display: grid;
  grid-template-columns: 1fr auto;
  direction: rtl;
  padding: 1rem;
  background: #f9f9f9;
}

.dark-mode .code-block {
  background: #2a2a2a;
}

.line-numbers {
  width: 3rem;
  /* give room for 2-3 digit Arabic numerals */
  text-align: right;
  color: #888;
  white-space: pre-wrap;
  padding-right: 0.5rem;
  user-select: none;
  border-left: 2px solid #ccc;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
}

.line-numbers {
  width: 3rem;
  text-align: right;
  color: #777;
  border-left: 2px solid #ccc;
  padding-right: 0.5rem;
  background: #eee;
  white-space: pre-wrap;
  line-height: 1.6;
  user-select: none;
}

/* .line-numbers {
  background: rgba(255, 0, 0, 0.1);
} */


.dark-mode .line-numbers {
  color: #777;
  border-left: 2px solid #444;
  background: #2a2a2a;
}

.code-content {
  direction: rtl;
  /* so the code appears RTL */
  color: #333;
  padding-right: 1rem;
  white-space: pre-wrap;
  font-size: 1rem;
  line-height: 1.6;
  min-width: 0;
}

.code-content {
  padding-left: 20rem;
  white-space: pre-wrap;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  color: #222;
}


.dark-mode .code-content {
  color: #ddd;
}

pre {
  margin: 0;
}


/* ================================
   Next and Back Navigation Section
================================ */
.nav-buttons-section {
  margin: 3rem 0;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(90deg, var(--accent-color), var(--primary-color), var(--accent-color));
  border-radius: 12px;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

.nav-buttons-container {
  display: inline-flex;
  gap: 2rem;
}

.fancy-button {
  position: relative;
  background: var(--accent-color);
  color: white;
  font-size: 1.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.fancy-button.previous::after {
  content: "السابق";
  margin-right: 20px;
}

.fancy-button.next::before {
  content: "التالي";
  margin-left: 20px;
}

.fancy-button .arrow {
  margin: 0 5px;
}

.fancy-button:hover {
  background: var(--accent-color2);
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.hover-text {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-color2);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.fancy-button:hover .hover-text {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

.arrow {
  font-size: 2rem;
  transition: transform 0.3s ease;
}

.fancy-button:hover .arrow {
  transform: scale(1.2);
}


/* =============================
   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;
  }
}


/* =============================
   Carousel Widget (Flexible & Styled)
============================= */

.image-carousel {
  text-align: center;
  margin: 40px 0;
}

.image-carousel .image-frame-transparent {
  display: inline-block;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  background: var(--bg-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-carousel .image-frame-transparent:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.image-carousel img.carousel-image {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: inline-block;
  transition: transform 0.4s ease;
}

/* Carousel Buttons */
.image-carousel .carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 50%;
  font-size: 18px;
  z-index: 2;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.image-carousel .carousel-btn.left {
  left: -25px;
}

.image-carousel .carousel-btn.right {
  right: -25px;
}

.image-carousel .carousel-btn:hover {
  background-color: var(--accent-color);
}

/* Dots */
.image-carousel .dots-container {
  text-align: center;
  margin-top: 15px;
}

.image-carousel .dot {
  height: 12px;
  width: 12px;
  margin: 0 4px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.image-carousel .dot.active,
.image-carousel .dot:hover {
  background-color: var(--accent-color);
}

/* Dark Mode Overrides */
.dark-mode .image-carousel .image-frame-transparent {
  background: #2a2a2a;
  border: 2px solid #444;
}

.dark-mode .image-carousel .carousel-btn {
  background-color: var(--primary-color);
  color: var(--text-color);
}

.dark-mode .image-carousel .carousel-btn:hover {
  background-color: var(--accent-color2);
}

.dark-mode .image-carousel .dot {
  background-color: #555;
}

.dark-mode .image-carousel .dot.active,
.dark-mode .image-carousel .dot:hover {
  background-color: var(--accent-color2);
}

.dot-wrapper {
  position: relative;
  display: inline-block;
}

.dot-wrapper:hover .hover-text {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}


.image-carousel .carousel-comment {
  margin-top: 0rem;
  font-size: 3rem;
  color: var(--secondary-color);
  text-align: center;
  font-family: inherit;
  line-height: 1.5;
  transition: color 0.3s ease;
}

.dark-mode .carousel-comment {
  color: var(--accent-color2);
}



/* =============================
   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;
}