.chapter-content{
    background-color: #f9f9f9;
    border-radius: 18px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
  }

  .chapter-content .header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #FCA311;
    display: block;  /* Enable flexbox for side-by-side layout */
}

.chapter-content .header #search-bar, #search-bar2 {
    width: 300px;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 16px;
    border-radius: 9px;
    border: none;
}

.all-subjects {
  background-color: #5d82d3;
  color: white;
  padding: 8px 16px;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  display: block;
  width: fit-content;
  margin: 20px auto 0;
  margin-top: 0;
  margin-bottom: 20px;
}

.all-subjects:hover {
  background-color: #5172b9;
}

.all-subjects span {
  margin-right: 8px;
}

.chapter-content .header #search-bar:focus {
    outline: 1px solid #FCA311;
    color: #14213D;
}

.chapter-content .header h1 {
    font-size: 45px;
    font-weight: 600;
    margin: 0;
}

.chapter-content .header p {
    font-size: 18px;
    color: #666;
}

.subject summary {
    cursor: pointer;
    font-weight: bold;
}

.subject summary:hover{
    padding-right: 5px;
}

.subject summary:focus{
    padding-right: 10px;
}

.chapter-content .details .subject .subject-title{
    font-size: 24px;
    font-weight: 600;
}

.chapter-content .details .subject .subject-item{
    font-size: 20px;
    color: #14213D;
    margin-bottom: 10px;
}

.subject {
    margin-bottom: 20px;
}

.subject .content {
    padding: 10px;
}

.subject .sub-content{
  padding: 6px;
  padding-right: 10px;
}

.subject .sub-content .subject-item{
  font-size: 18px;
  color: #14213D;
  margin-bottom: 10px;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: auto;
    text-align: center;
    padding: 10px;
  }
  
  .card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
  }
  
  .file-name {
    display: block;
    font-weight: 600;
    font-size: 18px;
    word-wrap: break-word;
  }
  
  .view-file {
    background-color: #FCA311;
    text-decoration: none;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
  }
  
  .view-file:hover {
    background-color: #e68e00;
  }

  .view-file span{
    margin-right: 8px;
  }

  
  /* Modal styles */
  .modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    padding-top: 60px;
  }
  
  .modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 700px;
    border-radius: 9px;
    position: relative;
  }

  .modal .modal-content h2{
    display: flex;
    justify-content: left;
    align-items: center;
    float: left;
    text-align: center;
    margin-top: 0;
    font-size: 15px;
    width: 80%;
    margin-bottom: 10px;
    padding-left: 10px;
  }
  
  .modal .modal-content div.control{
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .close-button{
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    position: absolute;
    top: 10px;
    right: 10px;
  }
  
  .close-button:hover{
    background-color: #d32f2f;
  }
  
  iframe {
    width: 100%;
    border-radius: 8px;
    height: 400px;
    border: none;
  }
  
  .close-modal-button {
    position: static;
    display: block;
    margin: 20px auto 0;
  }
  
  .download-file {
    background-color: #4caf50;
    color: white;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    display: block;
    width: fit-content;
    margin: 20px auto 0;
  }
  
  .download-file:hover {
    background-color: #45a049;
  }

  .download-file span{
    margin-right: 8px;
  }

  .open-file {
    background-color: #5d82d3;
    color: white;
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    display: block;
    width: fit-content;
    margin: 20px auto 0;
  }
  
  .open-file:hover {
    background-color: #5172b9;
  }

  .open-file span{
    margin-right: 8px;
  }

  .print-file {
    background-color: #f48236;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    display: block;
    width: fit-content;
    margin: 20px auto 0;
  }
  
  .print-file:hover {
    background-color: #e67022;
  }

  .print-file span{
    margin-right: 8px;
  }
  
  .slider {
      padding: 10px 0;
      padding-top: 5px;
      margin-bottom: 10px; 
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      grid-auto-rows: repeat(3, minmax(150px, auto));
      gap: 0;
      max-width: 100%;
      overflow-x: auto;
  }
  
  .slide {
    padding: 10px;
    border-radius: 5px;
    display: flex;
    justify-content: right;
    align-items: center;
  }

  .dhakr-alrahman-logo{
    cursor: pointer;
    direction: rtl;
    width: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #c58940;
    text-decoration: none;
  }
  .dhakr-alrahman-logo img{
    width: 40px;
    height: auto;
    user-select: none;
  }

  .dhakr-alrahman-logo img:hover{
    transform: scale(1.1);
  }

  .dhakr-alrahman-logo img:active{
    transform: scale(1.05);
  }

  .dhakr-alrahman-logo span{
    margin-right: 8px;
    margin-left: 4px;
    font-weight: 600;
    font-size: 18px;
  }


@media screen and (max-width: 900px) {
  .view-file span {
      display: none;
  }
}

@media screen and (max-width: 768px) {
    .chapter-content .header h1 {
        font-size: 35px;
    }

    .chapter-content .details .subject .subject-title{
        font-size: 20px;
        font-weight: 600;
    }
    
    .chapter-content .details .subject .subject-item{
        font-size: 18px;
        color: #14213D;
        margin-bottom: 10px;
    }

    .slider {
      grid-template-columns: repeat(3, 1fr); /* 2 columns for smaller screens */
    }

    .slide {
      padding: 8px;
    }
  }

  @media screen and (max-width: 700px) {
    .slider {
      grid-template-columns: repeat(4, 1fr); /* 2 columns for smaller screens */
    }
  }

  @media screen and (max-width: 600px) {
    .download-file span{
      display: none;
    }

    .open-file span{
      display: none;
    }

    .print-file span{
      display: none;
    }
  }

@media screen and (max-width: 500px){
    .subject-card {
        width: 100%;
    }

    .chapter-content .header #search-bar, #search-bar2 {
        width: 90%;
    }
}

@media screen and (max-width: 480px) {
    .chapter-content .header h1 {
        font-size: 26px;
    }
  
    .chapter-content .header p{
        font-size: 16px;
    }

    .card {
        padding: 8px;
      }
      
      .file-name {
        font-size: 16px;
      }

      .card-info {
        gap: 10px;
      }

      .view-file{
        padding: 6px 10px;
      }

      .slider {
        grid-template-columns: repeat(5, 1fr); /* 2 columns for smaller screens */
    }

    .slide {
      padding: 6px;
    }

    .dhakr-alrahman-logo span{
      font-size: 16px;
    }
  }