 :root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --accent-color: #ffffff;
    --secondary-bg: #1a1a1a;
    --hover-color: #333333;
    --shadow-color: rgba(255, 255, 255, 0.1);
    --disabled-color: #666666;
  }

  body {
    font-family: 'Amiri', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    direction: rlt;
  }

  .container {
    width: 90%;
    max-width: 800px;

  }

  h1 {
    font-size: 2.5rem;
    text-align: center;
    font-weight: 700;
  }

  .ayah-container {
    background-color: var(--secondary-bg);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: all 0.3s ease;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .ayah {
    font-size: 1.8rem;
    line-height: 1.8;
    text-align: right;
    direction: rtl;
    font-weight: 400;
    margin-top: 2rem;
  }

  .incomplete {
    color: var(--accent-color);
    font-weight: bold;
  }

  #ayahInfo {
    font-size: 1.2rem;
    margin-top: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
  }

  .input-container {
    display: flex;
    margin-bottom: 1rem;
    gap: 10px;
    flex-direction: column;
  }

  input[type="text"] {
    flex-grow: 1;
    padding: 0.8rem;
    font-size: 1.2rem;
    border: none;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border-radius: 10px 0 0 10px;
    transition: all 0.3s ease;
    font-family: 'Amiri', serif;
  }

  input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
  }

  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    border: none;
    background-color: var(--accent-color);
    color: var(--bg-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Amiri', serif;
    font-weight: 700;
  }

  .btn:hover:not(:disabled) {
    background-color: var(--hover-color);
    color: var(--text-color);
  }

  .btn:disabled {
    background-color: var(--disabled-color);
    cursor: not-allowed;
  }

  .btn-check {
    border-radius: 10px;
  }

  .btn-next {
    border-radius: 10px;

  }

  #result {
    font-size: 1.4rem;
    margin-top: 1rem;
    text-align: center;
    font-weight: bold;
    min-height: 1.5em;
  }

  .stats-container {
    display: flex;
    justify-content: center;
    font-size: 1.2rem;
    direction: rtl;

  }

  .stat {
    display: block;
    margin: 0 1rem;
    
  }

  .stat i {
    margin-right: 0.5rem;
    font-size: 1.4rem;
  }

  .stat-value {
    font-weight: bold;
    margin-left: 0.3rem;
  }

  #timer {
    font-size: 1.4rem;
    margin: 0.7rem;
    text-align: center;
    direction: rtl;
  }

  .theme-toggle {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .theme-toggle:hover {
    transform: scale(1.1);
  }

  @keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
  }

  .pulse {
    animation: pulse 2s infinite;
  }

  .light-theme {
    --bg-color: #ffffff;
    --text-color: #000000;
    --accent-color: #1a1a1a;
    --secondary-bg: #f0f0f0;
    --hover-color: #cccccc;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --disabled-color: #999999;
  }

  .loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
  }

  .loading-dots span {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background-color: var(--text-color);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
  }

  .loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
  }

  .loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
  }

  @keyframes bounce {
    0%, 80%, 100% {
      transform: scale(0);
    }
    40% {
      transform: scale(1);
    }
  }

  .surah-selector {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
  }

  #surahSelect, #timerSelect {
    padding: 5px;
    font-family: 'Amiri', serif;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    border-radius: 5px;
  }

  .timer-selector {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
  }

  #customTimerInput {
    display: none;
    width: 50px;
    padding: 5px;
    font-family: 'Amiri', serif;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    margin-left: 5px;
  }
  
  .audio-button {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Amiri', serif;
    font-size: 1rem;
    margin: 1rem auto;
    transition: background-color 0.3s ease;
    display: none;
  }
  
  .audio-button:hover {
    background-color: var(--hover-color);
  }

  .audio-button.playing {
    background-color: var(--hover-color);
  }
  
  .controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
  }

  .tashkil-toggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    visibility: hidden;
  }

  .tashkil-toggle input[type="checkbox"] {
    margin-right: 0.5rem;
  }
  
   #tafsir {
     padding: 0.5rem 0px;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    border-top: 1px solid var(--tafsir-border);
    transition: all 0.3s ease;
    direction: rtl;

        }

        #tafsir strong {
            display: block;
            margin-bottom: -1rem;
            font-size: 1.2rem;
            color: var(--accent-color);
            direction: rtl;

        }
  
  .contact-share {
    position: absolute;
    top: 0.5rem;
    right: 1.5rem;
    display: flex;
    gap: 1rem;
  }

  .contact-share a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
  }

  .contact-share a:hover {
    text-decoration: underline;
  }

  .dropdown {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
  }

  .dropbtn {
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 12px 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  }

  .dropbtn:hover {
    background-color: var(--hover-color);
  }

  .dropbtn i {
    margin-left: 8px;
  }

  .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--secondary-bg);
    min-width: 160px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
  }

  .dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: right;
    transition: background-color 0.3s ease;
  }

  .dropdown-content a:hover {
    background-color: var(--hover-color);
  }

  .show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    margin-top: 10px;
  }

  @media (max-width: 600px) {
    .container {
      padding: 1rem;
    }

    h1 {
      font-size: 2rem;
      margin-top: 3rem;
    }

    .ayah {
      font-size: 1.5rem;
    }

    .input-container {
      flex-direction: column;
    }

    input[type="text"], .btn {
      border-radius: 10px;
      margin-bottom: 0.5rem;
    }

    .btn-next {
      margin-left: 0;
    }

    .theme-toggle {
      left: 1rem;
      right: auto;
    }

    .dropdown {
      display: block;
    }

    .contact-share {
      display: none;
    }
  }
  
  .share-card {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--secondary-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 90%;
    width: 400px;
    text-align: center;
}

.share-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: var(--accent-color);
}

.share-text {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

.share-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.share-button {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    margin: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.share-button:hover {
    background-color: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#copyLink {
    border-radius: 25px;
    width: auto;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
}

#copyLink i {
    margin-right: 0.5rem;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.close-button:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    backdrop-filter: blur(5px);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .share-card {
        padding: 1rem;
        width: 85%;
    }

    .share-card h2 {
        font-size: 1.5rem;
    }

    .share-text {
        font-size: 1rem;
    }

    .share-button {
        font-size: 1rem;
        width: 40px;
        height: 40px;
    }

    #copyLink {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 320px) {
    .share-card {
        padding: 1.5rem;
    }

    .share-card h2 {
        font-size: 1.3rem;
    }

    .share-text {
        font-size: 0.9rem;
    }

    .share-button {
        font-size: 0.9rem;
        width: 35px;
        height: 35px;
        margin: 0.3rem;
    }

    #copyLink {
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
    }
}
  
.word-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-direction: row-reverse;
    margin-bottom: 25px;
    margin-right: 15px;
}

.word-card {
  background-color: var(--secondary-bg);
  border: 1px solid #535353;
  border-radius: 5px; /* Smaller border radius */
  padding: 5px; /* Reduced padding */
  text-align: center;
  height: 30px; /* Fixed height for uniformity */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Prevent cards from shrinking */
}

.word-card input {
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  color: var(--text-color);
  font-family: 'Amiri', serif;
  font-size: 0.9rem; /* Smaller font size */
  padding: 7px; /* Remove padding inside input */
  border-radius: inherit;
  margin: -4px;
}

.word-card input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-color);
}

.input-container {
  display: flex;
  margin-bottom: 1rem;
  justify-content: flex-end;
}  

/* قائمة اختيار السور في الأعلى */
.surah-selector {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

#surahSelect {
  padding: 5px;
  font-family: 'Amiri', serif;
  background-color: var(--secondary-bg);
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  border-radius: 5px;
}

/* زر التبديل */
.mode-toggle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
}

.mode-toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  background-color: #121212;
  border-radius: 25px;
  padding: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  width: 95px; /* عرض أصغر */
  height: 25px; /* ارتفاع أصغر */
  position: relative;
}

.mode-text {
  font-size: 0.8rem; /* حجم خط أصغر */
  transition: all 0.3s ease;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1; /* ضمان ظهور النص فوق الجزء المنزلق */
}

.mode-text-left {
  left: 12px; /* وضع نص "عشوائي" على اليسار */
}

.mode-text-right {
  right: 14px; /* وضع نص "بالترتيب" على اليمين */
}

.mode-slider {
  width: 50px; /* عرض الجزء المنزلق */
  height: 28px; /* ارتفاع الجزء المنزلق */
  background-color: #ffffff;
  border-radius: 20px;
  position: absolute;
  top: 49%;
  left: 3px;
  transform: translateY(-50%);
  transition: all 0.3s ease;
  z-index: 0; /* ضمان ظهور الجزء المنزلق تحت النص */
}

#modeToggle {
  display: none;
}

#modeToggle:checked + .mode-toggle-label .mode-slider {
  left: calc(100% - 55px); /* تحريك الجزء المنزلق إلى اليمين */
}

/* تغيير لون النص عند التبديل */
#modeToggle:checked + .mode-toggle-label .mode-text-left {
  color: #888; /* لون النص غير النشط (رمادي) */
  opacity: 0.7; /* تخفيف النص غير النشط */
}

#modeToggle:checked + .mode-toggle-label .mode-text-right {
  color: black; /* لون النص النشط (أسود) */
  opacity: 1; /* نص واضح */
}

#modeToggle:not(:checked) + .mode-toggle-label .mode-text-left {
  color: black; /* لون النص النشط (أسود) */
  opacity: 1; /* نص واضح */
}

#modeToggle:not(:checked) + .mode-toggle-label .mode-text-right {
  color: #888; /* لون النص غير النشط (رمادي) */
  opacity: 0.7; /* تخفيف النص غير النشط */
}

.mode-toggle-label:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* تعديلات للشاشات الصغيرة */
@media (max-width: 600px) {
  .mode-toggle-label {
    width: 83px; /* تصغير العرض على الشاشات الصغيرة */
    height: 25px; /* تصغير الارتفاع على الشاشات الصغيرة */
  }

  .mode-text {
    font-size: 0.7rem; /* تصغير حجم الخط على الشاشات الصغيرة */
  }

  .mode-text-right {
    right: 12px;
  }
  .mode-slider {
    width: 40px; /* تصغير عرض الجزء المنزلق على الشاشات الصغيرة */
    height: 28px; /* تصغير ارتفاع الجزء المنزلق على الشاشات الصغيرة */
    left: 5px;
  }

  #modeToggle:checked + .mode-toggle-label .mode-slider {
    left: calc(100% - 45px); /* تعديل موضع الجزء المنزلق على الشاشات الصغيرة */
  }
}

.mode-toggle {
  display: none; /* Hide the mode toggle by default */
}

/* Adjust the share card for mobile devices */
@media (max-width: 600px) {
  .share-card {
    padding: 1rem;
    width: 90%; /* Make the card wider on small screens */
    max-width: 300px; /* Limit the maximum width */
  }

  .share-card h2 {
    font-size: 1.5rem; /* Reduce the font size for the heading */
  }

  .share-text {
    font-size: 1rem; /* Reduce the font size for the text */
  }

  .share-buttons {
    flex-wrap: wrap; /* Allow buttons to wrap to the next line */
    gap: 5px; /* Add some gap between buttons */
  }

  .share-button {
    width: 40px; /* Reduce the button size */
    height: 40px;
    font-size: 1rem; /* Reduce the font size */
    margin: 0.3rem; /* Reduce the margin */
  }

  #copyLink {
    padding: 0.7rem 1rem; /* Adjust padding for the copy link button */
    font-size: 0.9rem; /* Reduce the font size */
    width: auto; /* Allow the button to take the necessary width */
    height: auto; /* Allow the button to take the necessary height */
  }

  #copyLink i {
    margin-right: 0.3rem; /* Reduce the margin for the icon */
  }
}

/* Further adjustments for very small screens */
@media (max-width: 320px) {
  .share-card {
    padding: 1rem;
    width: 95%; /* Make the card even wider on very small screens */
  }

  .share-card h2 {
    font-size: 1.3rem; /* Further reduce the font size */
  }

  .share-text {
    font-size: 0.9rem; /* Further reduce the font size */
  }

  .share-button {
    width: 35px; /* Further reduce the button size */
    height: 35px;
    font-size: 0.9rem; /* Further reduce the font size */
    margin: 0.2rem; /* Further reduce the margin */
  }

  #copyLink {
    padding: 0.6rem 0.9rem; /* Further adjust padding */
    font-size: 0.8rem; /* Further reduce the font size */
  }
}

/* Style for the Palestine link */
.palestine-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  font-size: 1rem;
  gap: 8px; /* Space between flag and text */
  border-radius: 25px; /* Rounded corners */
  border: 2px solid transparent; /* Transparent border for glow effect */
  position: relative;
  overflow: hidden; /* Ensure the glow stays within the border */
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Style for the Palestine link */
.palestine-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color);
  font-size: 1rem;
  gap: 8px; /* Space between flag and text */
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.palestine-link:hover {
  transform: scale(1.05); /* Slight scale on hover */
  opacity: 0.9; /* Slight fade on hover */
}

.palestine-flag {
  width: 20px; /* Smaller flag size */
  height: 15px;
  border-radius: 2px; /* Slight rounding for the flag */
}

.palestine-text {
  font-weight: bold;
}

/* Adjust the contact-share container to accommodate the new link */
.contact-share {
  display: flex;
  gap: 1rem; /* Space between items */
  align-items: center;
}