@font-face {
    font-family: 'Merriweather';
    src: url('Merriweather-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
}

body {
    font-family: 'Merriweather', serif;
    margin: 20px;
    background-image: url('background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #ffffff;
    background-attachment: fixed;
    height: 100vh;
}

h1 {
    font-size: 24px;
    color: #333;
}

.collapsible {
    background-color: rgba(163, 192, 202, 0.5);
    color: #f1e9e9;
    cursor: pointer;
    padding: 12px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    border-radius: 8px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); 
    transform: perspective(500px) translateZ(1px); 
}

.collapsible:hover {
    background-color: rgba(55, 157, 190, 0.7);
}

.collapsible.active, .collapsible:hover {
    background-color: #80b3d4;
}

.arrow {
    transition: transform 0.3s ease; 
}

.collapsible.active .arrow {
    transform: rotate(90deg);
}

.content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-top: 1px;
    transition: max-height 0.3s ease; 
    opacity: 0;
    margin-bottom: 2px;
}

.collapsible.active + .content {
    max-height: 100px; 
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    background-color: rgb(179, 196, 196);
}

.code-box {
    background-color: #2e2e2e; 
    color: #fff;
    padding: 10px;
    margin: 10px 0;
    font-family: monospace; 
    border-radius: 5px; 
    overflow-x: auto;
    line-height: 1.6; 
    border: 1px solid #444; 
}



/* Scope everything under #lesson21 */
#lesson21 .btn-transparent {
  background: rgba(0,123,255,0.2);
  color: #007bff;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  margin: 5px 0;
}

#lesson21 .css-sidebar {
  position: fixed;
  color: white;
  top: 0;
  left: 0;
  height: 100vh;
  width: 0;
  background-color: rgb(114, 114, 165);
  overflow-y: auto;
  transition: width 0.4s ease;
  z-index: 2000;
  padding-top: 60px;
}
#lesson21 .css-sidebar.open {
  width: 280px;
}

/* Top-level list */
#lesson21 .css-sidebar .top-level {
  list-style: none;
  margin: 0;
  padding: 0;
}
#lesson21 .css-sidebar .top-level > li {
  padding: 12px 16px;
  cursor: pointer;
  position: relative;
  font-weight: bold;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
#lesson21 .css-sidebar .top-level > li:hover {
  background: rgba(0,0,0,0.1);
}

/* Tooltip text */
#lesson21 .css-sidebar .top-level > li[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: #242e49;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: 8px;
  font-size: 0.85rem;
}

/* Sub-menu */
#lesson21 .css-sidebar .sub-menu {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0,0,0,0.05);
}
#lesson21 .css-sidebar .top-level > li.open > .sub-menu {
  max-height: 500px; /* enough to show items */
}
#lesson21 .css-sidebar .sub-menu li {
  padding: 8px 32px;
  font-weight: normal;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
#lesson21 .css-sidebar .sub-menu li:hover {
  background: rgba(0,0,0,0.1);
}

/* Menu button */
#lesson21 #css-menu-btn {
  position: relative;
  z-index: 2100;
  margin: 15px 0;
}


/* Scoped under #download-section to avoid clashes */
#download-section .download-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  background: rgba(49, 51, 170, 0.3); /* semi-transparent cyan */
  color: #fff;
  text-decoration: none;
  border: 2px solid rgba(32, 82, 156, 0.6);
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#download-section .download-btn:hover {
  background: rgba(32, 82, 156, 0.6);
  border-color: rgba(32, 82, 156, 0.6);
}

/* Style for the Arabic text */
#download-section p {
  font-family: 'Merriweather', serif;
  color: #242E49;
  margin-bottom: 8px;
  font-size: 1rem;
}


#lesson27 {
      font-family: 'Cairo', sans-serif;
      color: #333;
      padding: 20px;
      line-height: 1.8;
    }
    #lesson27 h1 {
      font-size: 2rem;
      color: #2a9d8f;
      text-align: center;
      margin-bottom: 10px;
    }
    #lesson27 h2 {
      font-size: 1.6rem;
      color: #264653;
      margin-top: 25px;
      margin-bottom: 10px;
    }
    #lesson27 p {
      font-size: 1rem;
      margin-bottom: 8px;
    }
    #lesson27 .code-box {
      background-color: #2e2e2e;
      color: #f1f1f1;
      padding: 15px;
      border-radius: 6px;
      font-family: 'Courier New', monospace;
      font-size: 0.9rem;
      overflow-x: auto;
      margin-bottom: 20px;
    }
    /* تصميم القوائم التوضيحية */
    #lesson27 .example-menu {
      position: relative;
      margin: 30px auto;
      width: 100%;
      max-width: 800px;
    }
    #lesson27 .hover-zone {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 20px;
      z-index: 10;
      background: rgba(0, 0, 0, 0); /* شفافية تامة */
    }
    #lesson27 .menu {
      position: fixed;
      top: -65px; left: 0;
      width: 100%;
      background-color: rgba(196, 147, 124, 0.7);
      transition: top 0.3s ease;
      z-index: 9;
    }
    #lesson27 .menu-container:hover .menu {
      top: 0;
    }
    #lesson27 .menu-content {
      max-width: 1200px;
      margin: 0 auto;
      padding: 20px 30px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    #lesson27 .logo {
      font-size: 1.8rem;
      color: #312d2d;
    }
    #lesson27 .links a {
      font-size: 1.1rem;
      text-decoration: none;
      color: #312d2d;
      border-radius: 8px;
      padding: 6px 12px;
      transition: background-color 0.3s ease;
      margin-left: 12px;
    }
    #lesson27 .links a:hover {
      background-color: rgba(0, 0, 0, 0.1);
    }
    #lesson27 .menu-divider {
      position: relative;
      text-align: center;
      margin-top: 10px;
    }
    #lesson27 .menu-divider::before {
      content: "";
      position: absolute;
      top: 50%;
      left: 0;
      width: 100%;
      height: 1px;
      background-color: #312d2d;
      z-index: 1;
    }
    #lesson27 .menu-divider span {
      position: relative;
      background-color: rgba(196, 147, 124, 0.7);
      padding: 0 10px;
      font-size: 1rem;
      color: #312d2d;
      z-index: 2;
    }
    #lesson27 #lesson27-sample {
      margin-top: 300px;
      font-size: 4rem;
      text-align: center;
      color: #312d2d;
    }
