/* General Styles */
@font-face {
  font-family: chahrazad;
  src: url(asset/ScheherazadeNew-Bold.woff);
  unicode-range: U+200?, U+60C, U+618-61B, U+61F, U+621-63A, U+640-655, U+65C, U+660-66C, U+670-671, U+6CC, U+6D4, U+6D6-6DD, U+6DF-6E8, U+6EA-6ED, U+8F0-8F3, U+FD3E-FD3F, U+FDF2;
}
@font-face {
  font-family: kitab;
  src: url(asset/Kitab-Regular.ttf);
  unicode-range: U+200?, U+60C, U+618-61B, U+61F, U+621-63A, U+640-655, U+65C, U+660-66C, U+670-671, U+6CC, U+6D4, U+6D6-6DD, U+6DF-6E8, U+8F0-8F3, U+FD3E-FD3F, U+FDF2;
}

:root {
  --primary-color: #121212;
  --secondary-color: #212121;
  --tertiary-color: #0097b2;
  --accent-color: #00bf63;
  --text-color: #e0e0e0;
  --error-color: #f44336;
  --success-color: #88ea8b;
  --border-radius: 8px;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--primary-color);
  color: var(--text-color);
  font-family: 'Noto Sans Arabic', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  transition: background-color var(--transition-speed);
  overflow-x: hidden;
}

.container {
  width: 100%;
  padding: 0 20px;
  margin: 0;
}

.header-body {
  text-align: center;
  padding: 20px;
  margin-bottom: 30px;
  width: 100%;
}

nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  transition: background-color var(--transition-speed);
}

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

.logo {
  margin-bottom: 20px;
  max-width: 200px;
  margin: 0 auto;
}

.logo img {
  width: 100%;
  height: auto;
}

h1, h2, h3 {
  color: var(--accent-color);
  margin-bottom: 15px;
}

p {
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

select, button, input {
  background-color: var(--secondary-color);
  color: var(--text-color);
  border: 1px solid #414141;
  padding: 12px 16px;
  margin-bottom: 15px;
  border-radius: var(--border-radius);
  font-family: inherit;
  width: 100%;
  font-size: 16px;
  transition: all var(--transition-speed);
}

select:focus, button:focus, input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

button {
  cursor: pointer;
  background-color: var(--accent-color);
  color: #000;
  font-weight: bold;
  border: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  background-color: #e6ac00;
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

#generateBtn {
  font-size: 18px;
  padding: 14px 20px;
  margin: 20px 0;
}

/* Loading Indicator */
.loading {
  display: none;
  text-align: center;
  margin: 20px 0;
}

.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid var(--accent-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Two-column layout for desktop */
@media (min-width: 992px) {
  .content-body {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    min-height: calc(100vh - 300px);
    width: 100%;
    padding: 0 20px;
  }
  
  .forms-container {
    flex: 0 0 30%;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 20px;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    align-self: flex-start;
  }
  
  .results-container {
    flex: 0 0 68%;
    display: flex;
    flex-direction: column;
  }
  
  #imageContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
    width: 100%;
  }
}

/* For very large screens */
@media (min-width: 1600px) {
  .forms-container {
    flex: 0 0 38%;
  }
  
  .results-container {
    flex: 0 0 60%;
  }
}

/* Live Preview Section */
.live-preview-section, .advanced-settings-section {
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 0;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.toggle-button {
  width: 100%;
  background-color: var(--secondary-color);
  border: none;
  padding: 15px 20px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0;
}

.toggle-button:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: none;
}

.toggle-button:active {
  transform: none;
}

.toggle-button h2 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.toggle-icon {
  font-size: 12px;
  transition: transform 0.3s;
}

.preview-content {
  background-color: rgba(0, 0, 0, 0.2);
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
  transition: all 0.3s ease-out;
  max-height: 500px; /* Large enough to show content */
}

.preview-content.collapsed {
  max-height: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  overflow: hidden;
}

.preview-content img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
}

.preview-placeholder {
  color: rgba(255, 255, 255, 0.6);
  padding: 20px;
  text-align: center;
}

.results-top-section {
  margin-bottom: 20px;
}

/* Remove old preview styles that are no longer needed */
#previewContainer {
  display: none;
}

.header-preview {
  display: none;
}

/* Arabic text styling */
.arabic-text {
  direction: rtl;
  text-align: right;
}

/* Forms container styling */
.forms-container h2 {
  margin-bottom: 15px;
  text-align: center;
  color: var(--accent-color);
}

/* Make the generate button more prominent */
#generateBtn {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  font-size: 18px;
  background-color: var(--accent-color);
  color: #000;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

#generateBtn:hover {
  background-color: var(--tertiary-color);
  transform: translateY(-2px);
}

/* Results container heading */
.results-container h2 {
  margin: 0 0 20px;
  color: var(--accent-color);
  font-size: 24px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
}

.results-container h2:before {
  content: "\f03e";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-right: 10px;
  font-size: 20px;
}

/* Header Preview */
.header-preview {
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.header-preview h2 {
  margin-bottom: 15px;
  text-align: center;
}

.header-preview-info {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.header-preview-info .icon {
  margin-right: 10px;
  margin-left: 0;
  font-size: 20px;
  color: var(--accent-color);
}

.header-preview-info .text {
  flex: 1;
}

.header-preview-info .surah-name {
  font-weight: bold;
  font-size: 18px;
}

.header-preview-info .ayah-range {
  font-size: 14px;
  opacity: 0.8;
}

.header-preview-sample {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
  padding: 15px;
  text-align: center;
  font-family: 'Amiri', serif;
  font-size: 20px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image Container */
#imageContainer {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
  width: 100%;
}

.ayah-container {
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  width: 100%;
  margin-bottom: 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-speed);
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 10px;
  border-left: 3px solid var(--accent-color);
}

.ayah-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.ayah-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-right: 15px;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.ayah-image:hover {
  transform: scale(1.1);
  border-color: var(--accent-color);
}

.ayah-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.ayah-number {
  font-weight: bold;
  color: var(--accent-color);
  margin-right: 15px;
  min-width: 80px;
}

.ayah-controls button {
  padding: 6px 10px;
  font-size: 12px;
  min-width: auto;
  margin: 0;
}

/* Download Links */
.download-container {
  display: flex;
  justify-content: center;
  margin: 15px 0 30px;
  flex-wrap: nowrap;
  background-color: rgba(0, 191, 99, 0.1);
  border: 1px solid rgba(0, 191, 99, 0.3);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

.download-header {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary-color);
  color: var(--text-color);
  padding: 4px 15px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-container button, 
.download-container a[role="button"] {
  background-color: var(--primary-color);
  color: var(--text-color);
  border: none;
  padding: 12px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  flex: 1;
  justify-content: center;
  text-align: center;
  min-width: 180px;
  border-bottom: 3px solid #00bf63;
}

.download-container button:hover,
.download-container a[role="button"]:hover {
  background-color: #00bf63;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.download-container button i,
.download-container a[role="button"] i {
  font-size: 1.2rem;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .download-container {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    padding-top: 25px;
  }
  
  .download-header {
    top: -10px;
    font-size: 0.8rem;
  }
  
  .download-container button, 
  .download-container a[role="button"] {
    margin: 0;
    width: 100%;
  }
}

/* Ayah control buttons */
.play-pause-btn, .download-audio-btn, .download-image-btn {
  background-color: var(--secondary-color);
  border: none;
  color: var(--text-color);
  padding: 5px 10px;
  margin: 0 5px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.play-pause-btn:hover, .download-audio-btn:hover, .download-image-btn:hover {
  background-color: #e67e22;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.play-pause-btn i, .download-audio-btn i, .download-image-btn i {
  font-size: 0.9rem;
}

.play-pause-btn {
  background-color: rgba(76, 175, 80, 0.8);
  min-width: 70px;
}

.play-pause-btn:hover {
  background-color: var(--success-color);
}

.download-audio-btn {
  background-color: rgba(33, 150, 243, 0.8);
  min-width: 70px;
}

.download-audio-btn:hover {
  background-color: #1976d2;
}

.download-image-btn {
  background-color: rgba(156, 39, 176, 0.8);
  min-width: 70px;
}

.download-image-btn:hover {
  background-color: #7b1fa2;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  overflow: auto;
}

.modal-content {
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 4% auto;
  padding: 25px;
  border-radius: 12px;
  width: 85%;
  max-width: 800px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: modalFadeIn 0.4s ease-out;
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-color);
}

.close:hover {
  color: var(--accent-color);
}

/* Preview Container */
#previewContainer {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  text-align: center;
  display: none;
  background-color: rgba(255, 255, 255, 0.1);
}

#previewImage {
  margin-top: 10px;
  max-width: 100%;
  overflow: hidden;
}

#previewImage img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  #previewContainer {
    padding: 10px;
  }
  
  #previewImage img {
    max-width: 100%;
  }
}

/* Custom Settings */
.custom-settings {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0;
  transition: all 0.3s ease-out;
  overflow: hidden;
  max-height: 0;
}

.custom-settings.collapsed {
  max-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  display: none !important;
}

.custom-settings.expanded {
  max-height: 3000px !important; /* Increased to accommodate all settings */
  overflow-y: auto;
  padding: 20px !important;
  display: block !important;
}

/* Customize scrollbar for better visibility */
.custom-settings::-webkit-scrollbar {
  width: 8px;
}

.custom-settings::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.custom-settings::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 4px;
}

/* Light mode scrollbar */
.light-mode .custom-settings::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.light-mode .custom-settings::-webkit-scrollbar-thumb {
  background-color: #888;
}

/* Remove old settings toggle styles */
.settings-toggle {
  display: none;
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  margin-top: 50px;
  border-top: 1px solid #414141;
}

/* Error Message */
.error-message {
  background-color: rgba(244, 67, 54, 0.1);
  color: var(--error-color);
  padding: 15px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  display: none;
}

/* Success Message */
.success-message {
  background-color: rgba(76, 175, 80, 0.1);
  color: var(--success-color);
  padding: 15px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  display: none;
}

/* Responsive Design */
@media (min-width: 768px) {
  .form-row {
    display: flex;
    gap: 15px;
  }
  
  .form-row > * {
    flex: 1;
  }
  
  .ayah-container {
    width: 100%;
  }
  
  .ayah-controls {
    flex-wrap: nowrap;
  }
}

@media (min-width: 992px) {
  #imageContainer {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
  
  .ayah-container {
    width: 100%;
  }
}

@media (min-width: 1200px) {
  #imageContainer {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  }
}

@media (min-width: 1600px) {
  #imageContainer {
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  }
}

@media (max-width: 767px) {
  .header-body {
    padding: 10px 0;
  }
  
  nav {
    flex-direction: column;
    gap: 10px;
  }
  
  select, button, input {
    padding: 10px 14px;
  }
  
  #generateBtn {
    padding: 12px 16px;
  }
  
  .modal-content {
    width: 95%;
    padding: 20px;
  }
  
  /* Header preview adjustments for mobile */
  .header-preview {
    padding: 10px;
  }
  
  .header-preview-sample {
    font-size: 16px;
    min-height: 50px;
  }
}

/* Dark/Light Mode Toggle */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--secondary-color);
  color: var(--text-color);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 100;
  border: none;
  font-size: 20px;
}

/* Light Mode */
body.light-mode {
  --primary-color: #f5f5f5;
  --secondary-color: #ffffff;
  --text-color: #333333;
}

body.light-mode .theme-toggle {
  background-color: #333;
  color: #fff;
}

/* Accessibility Focus Styles */
a:focus, button:focus, select:focus, input:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-color);
  color: #000;
  padding: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Real-time Preview at bottom of form */
.real-time-preview {
  margin-top: 20px;
  padding: 15px;
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.real-time-preview h3 {
  margin-bottom: 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.real-time-preview h3 i {
  color: var(--accent-color);
}

.real-time-preview-content {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.real-time-preview-content img {
  max-width: 100%;
  max-height: 250px;
  border-radius: var(--border-radius);
}

.real-time-preview-placeholder {
  color: rgba(255, 255, 255, 0.6);
  padding: 20px;
  text-align: center;
}

/* Adjust container heights for better scrolling */
main {
  min-height: calc(100vh - 300px);
  width: 100%;
  max-width: 100%;
}

/* Ensure the loading indicator appears in a good position */
.loading {
  position: sticky;
  top: 50%;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: var(--border-radius);
  padding: 20px;
}

/* Error and success messages */
.error-message, .success-message {
  position: sticky;
  top: 10px;
  z-index: 100;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .content-body {
    flex-direction: column;
    padding: 0 10px;
  }
  
  .forms-container, .results-container {
    width: 100%;
  }
  
  .results-container {
    margin-top: 30px;
  }
  
  #imageContainer {
    grid-template-columns: 1fr;
  }
}

/* Hide the old preview container */
#previewContainer, .header-preview {
  display: none;
}

.color-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.color-picker label {
  min-width: 120px;
}

.color-picker input[type="color"] {
  width: 50px;
  height: 30px;
  padding: 0;
  border: none;
}

/* Advanced settings section specific styles */
.advanced-settings-section .form-row {
  margin-bottom: 15px;
}

.advanced-settings-section label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.advanced-settings-section input[type="range"] {
  width: 100%;
}

/* Aspect ratio selector styles */
#aspectRatio {
  width: 100%;
}

#customRatioContainer {
  margin-top: 10px;
  transition: all 0.3s ease;
}

#customRatio {
  width: 100%;
  padding: 10px;
}

.content-body {
  width: 100%;
  max-width: 100%;
}

/* Responsive adjustments for the new layout */
@media (max-width: 768px) {
  .ayah-container {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
  }
  
  .ayah-image {
    width: 100%;
    height: auto;
    max-height: 150px;
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  .ayah-controls {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .ayah-number {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .download-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .download-container button,
  .srt-download-link {
    width: 100%;
  }
}

/* Disabled button styles */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

button:disabled:hover {
  background-color: inherit;
  transform: none !important;
  box-shadow: none;
}

/* Image Preview Modal */
.image-preview-modal {
  max-width: 46%;
  width: auto;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-preview-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  
}

.image-preview-container img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Modal navigation styles */
.modal-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 20px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-button {
  background-color: var(--secondary-color);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.small-nav-button {
  padding: 6px 10px;
  font-size: 12px;
}

.nav-button:hover {
  background-color: var(--accent-color);
  color: #000;
  transform: translateY(-2px);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.modal-ayah-info {
  font-size: 16px;
  font-weight: bold;
  color: var(--accent-color);
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-button {
  background-color: var(--accent-color);
  color: #000;
  border: none;
  padding: 8px 15px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.action-button:hover {
  background-color: #e6ac00;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-button:disabled {
  background-color: #555;
  color: #888;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Add styles for translation settings */
.translation-settings {
  display: none;
  margin-top: 10px;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 5px;
  border-left: 3px solid #4CAF50;
}

.translation-settings.visible {
  display: flex;
}

/* Enhanced Main Navigation */
.main-nav {
  display: flex;
  justify-content: center;
  padding: 10px 0;
  margin-bottom: 20px;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.1);
  position: relative;
  direction: rtl;
}

.menu-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.main-nav a {
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.main-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.main-nav a:active {
  transform: translateY(0);
}

.main-nav a i {
  margin-right: 5px;
  font-size: 1.1em;
}

.version-tag {
  background-color: rgba(70, 130, 180, 0.2);
  font-size: 0.9em;
  border-radius: 20px;
  padding: 8px 12px !important;
  color: var(--primary-color) !important;
}

/* Enhanced Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  overflow-y: auto;
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 4% auto;
  padding: 25px;
  border-radius: 12px;
  width: 85%;
  max-width: 800px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  margin-top: 0;
  color: var(--primary-color);
  border-bottom: 2px solid rgba(70, 130, 180, 0.3);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.modal-content .close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-content .close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--primary-color);
}

.modal-body {
  max-height: 70vh;
  overflow-y: auto;
  padding: 10px 5px;
}

/* Footer Styles */
.site-footer {
  background-color: var(--bg-secondary);
  color: var(--text-color);
  padding: 40px 20px 20px;
  margin-top: 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section {
  flex: 1;
  min-width: 200px;
}

.footer-section h3 {
  color: var(--tertiary-color);
  margin-bottom: 15px;
  font-size: 1.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: #00bf63; /* Accent color on hover */
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.social-links a:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
}

.social-links i {
  font-size: 20px;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* About Page Quran Verses */
.quran-verse {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.quran-verse::before {
  content: "﴾";
  position: absolute;
  font-size: 80px;
  opacity: 0.1;
  top: 10px;
  left: 10px;
  font-family: "Amiri Quran", serif;
}

.quran-verse::after {
  content: "﴿";
  position: absolute;
  font-size: 80px;
  opacity: 0.1;
  bottom: 10px;
  right: 10px;
  font-family: "Amiri Quran", serif;
}

.arabic-verse {
  margin-bottom: 20px;
  font-family: "Amiri Quran", serif;
  font-size: 24px;
  line-height: 1.8;
  text-align: right;
}

.english-verse {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
  line-height: 1.6;
}

.english-verse em {
  display: block;
  text-align: right;
  margin-top: 10px;
  font-style: italic;
  color: var(--text-muted);
}

/* FAQ Section */
.faq-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.faq-item {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s;
}

.faq-item:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.faq-item h4 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 10px;
}

/* Changelog Styles */
.version-entry {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.version-entry:last-child {
  border-bottom: none;
}

.version-entry h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.version-date {
  font-size: 0.8em;
  color: var(--text-muted);
  font-weight: normal;
}

.version-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: var(--accent-color);
  color: #000;
  font-size: 0.7em;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
}

.changelog-list {
  list-style: none;
  padding-left: 5px;
}

.changelog-list li {
  margin-bottom: 10px;
  position: relative;
  padding-left: 25px;
}

.changelog-list li i {
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--accent-color);
}

/* How to Use Steps */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.step {
  display: flex;
  gap: 15px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s;
}

.step:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  background-color: #ffcc00;
  color: #000;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.2em;
}

.step-content {
  flex: 1;
}

.step-content h4 {
  margin-top: 0;
  margin-bottom: 5px;
  color: var(--primary-color);
}

.video-tutorial {
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tips-list {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 20px 20px 20px 40px;
}

.tips-list li {
  margin-bottom: 10px;
}

/* Contact Options */
.contact-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.contact-option {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s;
}

.contact-option:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.contact-option i {
  font-size: 2.5em;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.contact-option h3 {
  margin: 10px 0;
}

.feedback-form {
  margin-top: 0;
  padding-top: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background-color: var(--bg-color);
  color: var(--text-color);
}

.form-group textarea {
  height: 120px;
  resize: vertical;
}

button.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}

button.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 15px;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 20px;
  }
  
  .faq-section {
    grid-template-columns: 1fr;
  }
  
  .contact-options {
    grid-template-columns: 1fr;
  }
  
  .step {
    flex-direction: column;
  }
  
  .step-number {
    align-self: flex-start;
  }
  
  .main-nav a {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
}

/* Light mode adjustments */
.light-mode .modal-content {
  background-color: var(--bg-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.light-mode .quran-verse {
  background-color: rgba(0, 0, 0, 0.05);
}

.light-mode .faq-item,
.light-mode .step,
.light-mode .contact-option,
.light-mode .feedback-form,
.light-mode .tips-list,
.light-mode .version-entry {
  background-color: rgba(0, 0, 0, 0.03);
}

.light-mode .faq-item:hover,
.light-mode .step:hover,
.light-mode .contact-option:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.light-mode .site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .footer-section h3 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .social-links a {
  background-color: rgba(0, 0, 0, 0.05);
}

.light-mode .footer-bottom {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Ensure visibility of all text in modals regardless of theme */
.modal-body,
.modal-body p,
.modal-body li,
.modal-body h3,
.modal-body h4 {
  color: var(--text-color) !important;
}

/* Ensure form inputs have visible text in all modes */
.form-group input,
.form-group textarea {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Set contrasting background for items in dark mode to improve readability */
.faq-item,
.step,
.contact-option,
.feedback-form,
.tips-list,
.version-entry {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Light mode adjustments */
.light-mode .modal-content {
  background-color: var(--bg-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.light-mode .modal-body,
.light-mode .modal-body p,
.light-mode .modal-body li,
.light-mode .modal-body h3,
.light-mode .modal-body h4 {
  color: var(--text-color) !important;
}

.light-mode .form-group input,
.light-mode .form-group textarea {
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--text-color);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-mode .faq-item,
.light-mode .step,
.light-mode .contact-option,
.light-mode .feedback-form,
.light-mode .tips-list,
.light-mode .version-entry {
  background-color: rgba(0, 0, 0, 0.03);
}

/* API Credits styling */
.api-credits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.api-credit-item {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-color);
}

.api-credit-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  background-color: rgba(255, 255, 255, 0.08);
}

.api-credit-item h4 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.api-credit-item p {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.5;
}

.api-credit-item a {
  color: var(--highlight-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s;
}

.api-credit-item a:hover {
  text-decoration: underline;
}

/* Light mode adjustments for API credits */
.light-mode .api-credit-item {
  background-color: rgba(0, 0, 0, 0.03);
  border-left: 4px solid var(--primary-color);
}

.light-mode .api-credit-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Highlight important text in yellow */
.modal-content h2 {
  color: var(--accent-color);
  border-bottom: 2px solid rgba(70, 130, 180, 0.3);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.modal-body h3 {
  color: #00bf63; /* Accent color for section headings */
  margin-top: 20px;
  margin-bottom: 15px;
  font-weight: bold;
}

.faq-item h4, 
.step-content h4, 
.contact-option h3,
.api-credit-item h4 {
  color: #ffcc00; /* Yellow color for important headings */
}

/* Highlight version badge */
.version-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: var(--accent-color); /* Yellow background */
  color: #000; /* Black text for contrast */
  font-size: 0.7em;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
}

/* Highlight step numbers */
.step-number {
  background-color: #ffcc00; /* Yellow background */
  color: #000; /* Black text for contrast */
}

/* Highlight links */
.modal-body a,
.api-credit-item a {
  color: #ffcc00; /* Yellow links */
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s;
}

.modal-body a:hover,
.api-credit-item a:hover {
  text-decoration: underline;
  color: #ffdd33; /* Lighter yellow on hover */
}

/* Light mode adjustments */
.light-mode .modal-body h3 {
  color: #00bf63; /* Same accent color for light mode */
}

.light-mode .faq-item h4, 
.light-mode .step-content h4, 
.light-mode .contact-option h3,
.light-mode .api-credit-item h4 {
  color: #009950; /* Slightly darker accent color for light mode */
}

.light-mode .modal-body a,
.light-mode .api-credit-item a {
  color: #cc9900; /* Restore original yellow for links */
}

.light-mode .modal-body a:hover,
.light-mode .api-credit-item a:hover {
  color: #aa7700; /* Restore original hover color */
}

/* Share Creation Form Styling */
.share-creation-form {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  border-left: 4px solid #ffcc00; /* Yellow accent */
}

.share-creation-form .form-group {
  margin-bottom: 18px;
}

.share-creation-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: #ffcc00; /* Yellow label text */
}

.share-creation-form input[type="text"],
.share-creation-form input[type="email"],
.share-creation-form input[type="url"],
.share-creation-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 204, 0, 0.3); /* Light yellow border */
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.share-creation-form textarea {
  height: 120px;
  resize: vertical;
}

.share-creation-form input:focus,
.share-creation-form textarea:focus {
  outline: none;
  border-color: #ffcc00; /* Yellow border on focus */
  box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.2); /* Yellow glow */
}

.share-creation-form input[type="checkbox"] {
  margin-right: 8px;
  vertical-align: middle;
}

.share-creation-form label input[type="checkbox"] + span {
  display: inline;
  color: var(--text-color);
  font-weight: normal;
}

.share-btn {
  background-color: #ffcc00 !important; /* Yellow button */
  color: #000 !important; /* Black text for contrast */
  font-weight: bold;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  display: block;
  width: 100%;
  margin-top: 20px;
  text-align: center;
}

.share-btn:hover {
  background-color: #ffdd33 !important; /* Lighter yellow on hover */
  transform: translateY(-2px);
}

#shareCreationSuccess {
  background-color: rgba(40, 167, 69, 0.1);
  border-left: 4px solid #28a745;
  padding: 12px;
  margin-top: 15px;
  border-radius: 4px;
  color: #28a745;
}

/* Footer share link highlight */
#footerShareLink {
  color: var(--accent-color) !important; /* Yellow text to stand out */
  font-weight: bold;
}

#footerShareLink i {
  margin-right: 5px;
}

/* Light mode adjustments */
.light-mode .share-creation-form {
  background-color: rgba(0, 0, 0, 0.03);
  border-left: 4px solid #cc9900; /* Darker yellow for light mode */
}

.light-mode .share-creation-form label {
  color: #cc9900; /* Darker yellow for light mode */
}

.light-mode .share-creation-form input[type="text"],
.light-mode .share-creation-form input[type="email"],
.light-mode .share-creation-form input[type="url"],
.light-mode .share-creation-form textarea {
  border: 1px solid rgba(204, 153, 0, 0.3); /* Light darker yellow border */
  background-color: rgba(255, 255, 255, 0.9);
}

.light-mode .share-creation-form input:focus,
.light-mode .share-creation-form textarea:focus {
  border-color: #cc9900; /* Darker yellow border on focus */
  box-shadow: 0 0 0 2px rgba(204, 153, 0, 0.2); /* Darker yellow glow */
}

.light-mode .share-btn {
  background-color: #cc9900 !important; /* Darker yellow button */
}

.light-mode .share-btn:hover {
  background-color: #aa7700 !important; /* Even darker yellow on hover */
}

.light-mode #footerShareLink {
  color: #00bf63;
}

/* Feedback Form */
.feedback-form {
  margin-top: 0;
  padding-top: 20px;
}

.light-mode .feedback-form {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Apply accent color to all h3 elements in modals */
.modal-body h3,
.contact-option h3,
.api-credit-item h4,
.faq-item h4,
.step-content h4,
.version-entry h3 {
  color: #00bf63; /* Accent color for all headings */
}

/* Light mode version */
.light-mode .modal-body h3,
.light-mode .contact-option h3,
.light-mode .api-credit-item h4,
.light-mode .faq-item h4,
.light-mode .step-content h4,
.light-mode .version-entry h3 {
  color: #00bf63; /* Same accent color for light mode */
}

.light-mode .footer-section a:hover {
  color: #00bf63; /* Accent color for light mode hover */
  text-decoration: underline;
}

/* Light mode adjustments for download sections */
.light-mode .download-container {
  background-color: rgba(0, 191, 99, 0.05);
  border: 1px solid rgba(0, 191, 99, 0.2);
}

.light-mode .download-header {
  background-color: #00bf63;
  color: #fff;
}

/* Add styles for bitrate selector */
#bitrateContainer {
  margin: 10px 0;
  padding: 5px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 5px;
  transition: all 0.3s ease;
}

#bitrateContainer .select-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

#bitrateContainer label {
  margin-right: 10px;
  font-weight: bold;
  color: #444;
}

#bitrateSelect {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background-color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
  margin-right: 10px;
}

#bitrateContainer .helper-text {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

/* Dark mode styles for bitrate selector */
@media (prefers-color-scheme: dark) {
  #bitrateContainer {
    background-color: rgba(255, 255, 255, 0.05);
  }
  
  #bitrateContainer label {
    color: #ddd;
  }
  
  #bitrateSelect {
    background-color: #333;
    color: #fff;
    border-color: #555;
  }
  
  #bitrateContainer .helper-text {
    color: #aaa;
  }
}

/* Audio Preview Container Styles */
.audio-preview-container {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  text-align: center;
}

.audio-preview-container h3 {
  margin-top: 0;
  color: #ffcc00;
  margin-bottom: 15px;
}

.preview-ayah-text {
  font-family: 'Amiri Quran', serif;
  font-size: 24px;
  margin-bottom: 15px;
  direction: rtl;
  line-height: 1.6;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 6px;
}

#previewAudio {
  width: 100%;
  margin-bottom: 10px;
}

.preview-info {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #666;
}

.preview-info.error {
  color: #d32f2f;
  padding: 10px;
  background-color: rgba(211, 47, 47, 0.1);
  border-radius: 4px;
  margin: 10px 0;
}

.preview-info.success {
  color: #388e3c;
  padding: 10px;
  background-color: rgba(56, 142, 60, 0.1);
  border-radius: 4px;
  margin: 10px 0;
}

.btn-reset {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 5px 10px;
  margin-top: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  display: inline-block;
}

.btn-reset:hover {
  background-color: #d32f2f;
}

.preview-help {
  margin-top: 15px;
  font-size: 0.8rem;
  color: #999;
  font-style: italic;
}

/* Dark mode styling */
@media (prefers-color-scheme: dark) {
  .audio-preview-container {
    background-color: rgba(255, 255, 255, 0.05);
  }
  
  .preview-ayah-text {
    background-color: rgba(255, 255, 255, 0.02);
  }
  
  .preview-info {
    color: #aaa;
  }
  
  .preview-help {
    color: #777;
  }
  
  .preview-info.error {
    background-color: rgba(211, 47, 47, 0.2);
  }
  
  .preview-info.success {
    background-color: rgba(56, 142, 60, 0.2);
  }
  
  .btn-reset {
    background-color: #f44336;
  }
  
  .btn-reset:hover {
    background-color: #e53935;
  }
}

#downloadOptionsContainer {
  margin: 20px 0;
  padding: 15px;
  background-color: rgba(255, 224, 102, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--accent-color);
}

#downloadOptionsContainer h3 {
  margin-top: 0;
  color: var(--accent-color);
  font-size: 1.1rem;
  margin-bottom: 12px;
}

#downloadOptionsContainer .setting-group {
  margin-bottom: 15px;
}

#downloadOptionsContainer .setting-description {
  display: block;
  font-size: 0.8rem;
  color: #777;
  margin-top: 5px;
}

#downloadOptionsContainer select {
  margin-bottom: 5px;
}

@media (prefers-color-scheme: dark) {
  #downloadOptionsContainer {
    background-color: rgba(255, 224, 102, 0.05);
    border-left-color: #ffd700;
  }
  
  #downloadOptionsContainer h3 {
    color: #ffd700;
  }
  
  #downloadOptionsContainer .setting-description {
    color: #aaa;
  }
}

.tooltip-info {
  display: block;
  font-size: 0.8rem;
  color: #2196F3;
  margin-top: 5px;
}

.tooltip-info i {
  margin-right: 4px;
}

@media (prefers-color-scheme: dark) {
  .tooltip-info {
    color: #64B5F6;
  }
}

.download-settings {
  margin: 10px 0;
  padding: 15px;
  background-color: rgba(255, 224, 102, 0.1);
  border-radius: 8px;
}

.bitrate-selector {
  margin-bottom: 15px;
}

.bitrate-selector label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--accent-color);
}

.bitrate-selector select {
  width: 100%;
  padding: 8px;
  margin-bottom: 5px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.bitrate-selector .setting-description {
  display: block;
  font-size: 0.8rem;
  color: #777;
  margin-top: 5px;
}

@media (prefers-color-scheme: dark) {
  .download-settings {
    background-color: rgba(255, 224, 102, 0.05);
  }
  
  .bitrate-selector label {
    color: #ffd700;
  }
  
  .bitrate-selector .setting-description {
    color: #aaa;
  }
}

/* Add styles for the surah info options */
.form-row select#showSurahInfo,
.form-row select#surahInfoLanguage,
.form-row select#surahInfoPosition,
.form-row select#surahInfoHAlign {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #fff;
  color: #333;
  width: 100%;
}

/* Style for the surah info in the generated images */
.surah-info {
  opacity: 0.9;
  padding: 5px 10px;
  border-radius: 4px;
  display: inline-block;
  margin: 5px 0;
}

/* Styles for the surah info settings section */
.surah-info-settings {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.surah-info-settings input[type="range"] {
  width: 100%;
  margin-bottom: 5px;
}

.surah-info-settings input[type="color"] {
  width: 100%;
  height: 30px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Dark mode adjustments */
.dark-mode .form-row select#showSurahInfo,
.dark-mode .form-row select#surahInfoLanguage,
.dark-mode .form-row select#surahInfoPosition,
.dark-mode .form-row select#surahInfoHAlign {
  background-color: #333;
  color: #fff;
  border-color: #555;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .form-row div:has(#showSurahInfo),
  .form-row div:has(#surahInfoLanguage),
  .form-row div:has(#surahInfoPosition),
  .form-row div:has(#surahInfoHAlign),
  .form-row div:has(#surahInfoSize),
  .form-row div:has(#surahInfoColor),
  .form-row div:has(#surahInfoMarginV),
  .form-row div:has(#surahInfoMarginH),
  .form-row div:has(#surahInfoOpacity) {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Settings Navigation and Categories */
.settings-nav-container {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #1a1a1a;
  padding: 10px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.settings-nav-item {
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-nav-item:hover {
  background-color: #444;
}

.settings-nav-item.active {
  background-color: #007bff;
  color: white;
}

.settings-category {
  display: none;
  margin-bottom: 30px;
}

.settings-category.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.settings-category-title {
  font-size: 18px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
  color: #007bff;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Light mode styles */
.light-mode .settings-nav-container {
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.light-mode .settings-nav-item {
  background-color: #e0e0e0;
  color: #333;
}

.light-mode .settings-nav-item:hover {
  background-color: #d0d0d0;
}

.light-mode .settings-nav-item.active {
  background-color: #007bff;
  color: white;
}

.light-mode .settings-category-title {
  border-bottom: 1px solid #ddd;
}

/* Responsive styles */
@media (max-width: 768px) {
  .settings-nav {
    flex-direction: column;
    align-items: stretch;
  }
  
  .settings-nav-item {
    text-align: center;
    border-radius: 4px;
  }
}

/* Improve form row spacing in settings categories */
.settings-category .form-row {
  margin-bottom: 20px;
}

/* Add some padding to the custom settings container */
.custom-settings {
  padding: 0 15px 20px;
}

/* Ensure the custom settings container has enough height for scrolling */
.custom-settings.expanded {
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Customize scrollbar for better visibility */
.custom-settings::-webkit-scrollbar {
  width: 8px;
}

.custom-settings::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.custom-settings::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 4px;
}

.light-mode .custom-settings::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.light-mode .custom-settings::-webkit-scrollbar-thumb {
  background-color: #bbb;
}

/* Settings Summary Panel */
.settings-summary-panel {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #1a1a1a;
  padding: 10px 0;
  margin-bottom: 15px;
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.settings-summary-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.summary-item {
  display: inline-block;
  padding: 5px 12px;
  background-color: #333;
  color: #fff;
  border-radius: 15px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.summary-item:hover {
  background-color: #444;
}

.summary-item.active {
  background-color: #007bff;
  color: white;
  font-weight: bold;
}

/* Back to Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: none; /* Hidden by default, shown via JS */
  z-index: 100;
  opacity: 0.8;
  transition: opacity 0.3s, transform 0.3s;
}

.back-to-top-btn:hover {
  opacity: 1;
  transform: translateY(-3px);
}

.back-to-top-btn i {
  font-size: 18px;
}

/* Light mode styles */
.light-mode .settings-summary-panel {
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.light-mode .summary-item {
  background-color: #e0e0e0;
  color: #333;
}

.light-mode .summary-item:hover {
  background-color: #d0d0d0;
}

.light-mode .summary-item.active {
  background-color: #007bff;
  color: white;
}

.light-mode .back-to-top-btn {
  background-color: #007bff;
  color: white;
}

/* Responsive styles */
@media (max-width: 768px) {
  .settings-summary-content {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .summary-item {
    font-size: 12px;
    padding: 4px 8px;
  }
  
  .back-to-top-btn {
    bottom: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
  }
}

/* Ensure the custom settings container has enough height for scrolling */
.custom-settings.expanded {
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 0 15px 20px;
}

/* Customize scrollbar for better visibility */
.custom-settings::-webkit-scrollbar {
  width: 8px;
}

.custom-settings::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.custom-settings::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 4px;
}

.light-mode .custom-settings::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.light-mode .custom-settings::-webkit-scrollbar-thumb {
  background-color: #bbb;
}

/* Settings Sections and Dividers */
.settings-section {
  margin-bottom: 30px;
  padding-bottom: 10px;
}

.section-divider {
  font-size: 18px;
  color: #007bff;
  border-bottom: 2px solid #333;
  padding-bottom: 8px;
  margin-bottom: 15px;
  margin-top: 25px;
  position: relative;
}

.section-divider:before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 50px;
  height: 2px;
  background-color: #007bff;
}

/* Back to Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: none; /* Hidden by default, shown via JS */
  z-index: 100;
  opacity: 0.8;
  transition: opacity 0.3s, transform 0.3s;
}

.back-to-top-btn:hover {
  opacity: 1;
  transform: translateY(-3px);
}

.back-to-top-btn i {
  font-size: 18px;
}

/* Light mode styles */
.light-mode .section-divider {
  color: #007bff;
  border-bottom-color: #ddd;
}

.light-mode .section-divider:before {
  background-color: #007bff;
}

.light-mode .back-to-top-btn {
  background-color: #007bff;
  color: white;
}

/* Responsive styles */
@media (max-width: 768px) {
  .section-divider {
    font-size: 16px;
  }
  
  .back-to-top-btn {
    bottom: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
  }
}

/* Ensure the custom settings container has enough height for scrolling */
.custom-settings.expanded {
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 0 15px 20px;
}

/* Customize scrollbar for better visibility */
.custom-settings::-webkit-scrollbar {
  width: 8px;
}

.custom-settings::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.custom-settings::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 4px;
}

.light-mode .custom-settings::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.light-mode .custom-settings::-webkit-scrollbar-thumb {
  background-color: #bbb;
}

.advanced-settings-section {
  position: relative;
  margin-bottom: 20px;
  width: 100%;
  z-index: 10;
}

/* Make sure the toggle button is visible and clickable */
.toggle-button {
  width: 100%;
  text-align: left;
  position: relative;
  z-index: 20;
}

/* Footer Styles */
.footer {
  background-color: #f8f9fa;
  padding: 1rem;
  margin-top: 2rem;
  border-top: 1px solid #dee2e6;
  text-align: center;
}

.disclaimer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.disclaimer p {
  margin: 0;
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.5;
}

.disclaimer strong {
  color: #dc3545;
}

/* Dark mode styles for the footer */
@media (prefers-color-scheme: dark) {
  .footer {
    background-color: #343a40;
    border-top-color: #495057;
  }
  
  .disclaimer p {
    color: #adb5bd;
  }
  
  .disclaimer strong {
    color: #f8d7da;
  }
}

/* Search Feature Styles */
.search-container {
  background-color: #fff;
  border-radius: 12px;
  padding: 20px 25px;
  margin: 25px 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.5s ease;
  max-height: 800px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  width: 100%;
}

.search-container h2 {
  margin-top: 0;
  color: #333;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
  transition: all 0.5s ease;
  opacity: 1;
}

.search-form input {
  flex: 1;
  min-width: 300px;
  padding: 14px 18px 14px 45px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 17px;
  height: 55px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23555' class='bi bi-search' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 15px center;
  transition: all 0.3s ease;
}

.search-form input:focus {
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.25);
  outline: none;
}

@media (max-width: 768px) {
  .search-form input {
    min-width: 100%;
  }
}

.search-form select {
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background-color: #fff;
  font-size: 16px;
}

.search-form button {
  background-color: #4285f4;
  color: white;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  min-width: 120px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.search-form button:hover {
  background-color: #3367d6;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.search-form button i {
  margin-right: 8px;
}

.search-results {
  margin-top: 20px;
  transition: all 0.5s ease;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 10px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.search-results.collapsed {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  padding-top: 0;
  border-top: none;
}

.search-result-item {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  background-color: #f9f9f9;
  border: 1px solid #eee;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for search results */
.search-result-item:nth-child(2) { animation-delay: 0.05s; }
.search-result-item:nth-child(3) { animation-delay: 0.1s; }
.search-result-item:nth-child(4) { animation-delay: 0.15s; }
.search-result-item:nth-child(5) { animation-delay: 0.2s; }
.search-result-item:nth-child(n+6) { animation-delay: 0.25s; }

/* Mobile refinements */
@media (max-width: 767px) {
  .search-container {
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 15px;
  }
  
  .search-container.expanded {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 20px;
  }
  
  .search-form {
    flex-direction: column;
    gap: 12px;
  }
  
  .search-form input, 
  .search-form select,
  .search-form button {
    width: 100%;
    min-width: unset;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .search-toggle-btn {
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
  }
  
  .search-result-item {
    padding: 12px;
    margin-bottom: 12px;
  }
  
  .result-arabic {
    font-size: 20px;
  }
  
  .sticky-search button {
    padding: 8px 12px;
  }
  
  .sticky-search select {
    padding: 8px;
    max-width: 70px;
  }
}

.search-close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  padding: 5px;
  margin-left: auto;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
}

.search-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #555;
}

.search-container h2 i {
  margin-right: 10px;
  transition: transform 0.3s;
}

.search-container.collapsed h2 i {
  transform: rotate(-90deg);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.sticky-search {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 10px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: flex;
  align-items: center;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  backdrop-filter: blur(8px);
}

.sticky-search.visible {
  transform: translateY(0);
}

.sticky-search input {
  flex: 1;
  padding: 8px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  margin-right: 10px;
  min-width: 0;
}

.sticky-search button {
  background-color: #4285f4;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 15px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
}

.sticky-search button:hover {
  background-color: #3b78e7;
}

.sticky-search select {
  padding: 8px 10px;
  border-radius: 20px;
  border: 1px solid #ddd;
  margin-right: 10px;
  font-size: 14px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .sticky-search {
    background-color: rgba(30, 32, 42, 0.95);
  }
  
  .sticky-search input, 
  .sticky-search select {
    background-color: #2a2d3d;
    border-color: #3a3e52;
    color: #e0e0e0;
  }
}

.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.result-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #555;
  font-weight: bold;
}

.result-arabic {
  font-size: 22px;
  margin-bottom: 10px;
  line-height: 1.8;
  color: #111;
}

.result-translation {
  font-style: italic;
  color: #666;
  line-height: 1.5;
}

.search-results-header {
  margin-bottom: 20px;
  text-align: center;
}

.search-no-results, .search-loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.search-loading i {
  margin-right: 10px;
  animation: spin 1s infinite linear;
}

.highlight {
  background-color: rgba(66, 133, 244, 0.2);
  border-radius: 3px;
  padding: 0 3px;
  font-weight: bold;
}

.toggle-search-results {
  display: block;
  text-align: center;
  background: none;
  border: none;
  padding: 10px;
  color: #4285f4;
  cursor: pointer;
  font-size: 14px;
  width: 100%;
  border-top: 1px solid #eee;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.toggle-search-results:hover {
  background-color: rgba(66, 133, 244, 0.05);
}

.toggle-search-results i {
  margin-right: 5px;
  transition: transform 0.3s ease;
}

.toggle-search-results.collapsed i {
  transform: rotate(180deg);
}

.search-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #4285f4;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: transform 0.3s, background-color 0.2s;
  opacity: 0.9;
}

.search-toggle-btn:hover {
  background-color: #3b78e7;
  opacity: 1;
  transform: scale(1.1);
}

.search-toggle-btn i {
  font-size: 24px;
}

.search-toggle-btn.active {
  transform: rotate(45deg);
}

.search-progress {
  text-align: center;
  color: #4285f4;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin: 15px 0;
  font-weight: bold;
}

/* Light theme styles */
.light-mode .search-container {
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.light-mode .search-result-item {
  background-color: #f5f7fa;
  border: 1px solid #e5e9f0;
}

.light-mode .search-no-results, 
.light-mode .search-loading {
  color: #555;
}

/* Dark theme styles (if using dark mode) */
@media (prefers-color-scheme: dark) {
  .search-container {
    background-color: #292d3e;
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .search-container h2 {
    color: #e0e0e0;
  }
  
  .search-form input,
  .search-form select {
    background-color: #20232d;
    border-color: #393f4f;
    color: #e0e0e0;
  }
  
  .search-result-item {
    background-color: #262b3d;
    border-color: #363c4f;
  }
  
  .result-header {
    color: #c0c0c0;
  }
  
  .result-arabic {
    color: #f0f0f0;
  }
  
  .result-translation {
    color: #b0b0b0;
  }
  
  .search-no-results, 
  .search-loading {
    color: #b0b0b0;
  }
  
  .highlight {
    background-color: rgba(66, 133, 244, 0.3);
  }
}

.search-highlight {
  border: 2px solid #4285f4;
  background-color: #f8f9ff;
  margin-bottom: 35px;
}

@media (prefers-color-scheme: dark) {
  .search-highlight {
    background-color: #1e2745;
    border-color: #3b78e7;
  }
}

/* Make sure we restore missing styles */
.search-container.collapsed {
  max-height: 60px;
  overflow: hidden;
  padding: 10px 20px;
}

.search-container.expanded {
  max-height: 800px;
}

.search-container.collapsed .search-form {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
}

.search-highlight {
  border: 2px solid #4285f4;
  background-color: #f8f9ff;
  margin-bottom: 35px;
}

.forms-container .search-container {
  margin-bottom: 30px;
  border: 2px solid #4285f4;
  background-color: #f0f8ff;
  border-radius: 15px;
  padding: 25px 30px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: none;
}

.forms-container .search-container h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #1a73e8;
}

.forms-container .search-form {
  gap: 15px;
}

.forms-container .search-form input {
  height: 55px;
  font-size: 17px;
  padding-left: 50px;
  border: 2px solid #d0d0d0;
  background-position: 15px center;
}

.forms-container .search-form input:focus {
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.3);
}

.forms-container .search-form button {
  height: 55px;
  min-width: 140px;
  font-size: 17px;
  background-color: #1a73e8;
  transition: all 0.3s ease;
}

.forms-container .search-form button:hover {
  background-color: #0d62d1;
  transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
  .forms-container .search-container {
    background-color: #1e2745;
    border-color: #3b78e7;
  }
  
  .forms-container .search-container h2 {
    color: #4285f4;
  }
}

.compact-search {
  max-width: 800px;
  margin: 10px auto 25px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  background-color: #f5f7fa;
  border: 1px solid #e5e9f0;
}

.compact-search h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #444;
}

.compact-search .search-form {
  gap: 8px;
  margin-top: 10px;
}

.compact-search .search-form input {
  height: 40px;
  font-size: 14px;
  padding: 8px 8px 8px 35px;
  background-position: 10px center;
}

.compact-search .search-form select {
  height: 40px;
  padding: 8px;
  font-size: 14px;
  min-width: 100px;
}

.compact-search .search-form button {
  height: 40px;
  min-width: 100px;
  padding: 8px 12px;
  font-size: 14px;
}

@media (prefers-color-scheme: dark) {
  .compact-search {
    background-color: #232733;
    border-color: #393f4f;
  }
  
  .compact-search h2 {
    color: #e0e0e0;
  }
}

@media (max-width: 767px) {
  .compact-search {
    margin: 5px 0 15px;
    padding: 10px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    max-width: 100%;
  }
  
  .compact-search .search-form {
    flex-direction: column;
    gap: 8px;
  }
  
  .compact-search .search-form input,
  .compact-search .search-form select,
  .compact-search .search-form button {
    width: 100%;
    min-width: unset;
  }
}

.compact-search.collapsed {
  max-height: 45px;
  overflow: hidden;
  padding-bottom: 5px;
  padding-top: 10px;
}

.compact-search.collapsed h2 {
  margin-bottom: 0;
}

.compact-search.expanded {
  max-height: 600px;
}

.compact-search .search-results {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
  padding-top: 10px;
}

.top-search-btn {
  background-color: #4285f4;
  color: white !important;
  padding: 5px 12px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.top-search-btn:hover {
  background-color: #1a73e8;
  transform: translateY(-2px);
}

/* Search Popup Styles */
.search-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  z-index: 1001;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: none;
  opacity: 0;
  overflow: hidden;
}

.search-popup .search-container {
  margin: 0;
  border-radius: 12px;
  max-height: 90vh;
  border: none;
  box-shadow: none;
  background-color: var(--bg-color);
  padding: 20px 25px;
  display: flex;
  flex-direction: column;
  height: 90vh;
  overflow: hidden;
}

.search-popup .search-results {
  flex: 1;
  overflow-y: auto;
  margin-top: 20px;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 155, 155, 0.5) transparent;
}

.search-popup .search-results::-webkit-scrollbar {
  width: 8px;
}

.search-popup .search-results::-webkit-scrollbar-track {
  background: transparent;
}

.search-popup .search-results::-webkit-scrollbar-thumb {
  background-color: rgba(155, 155, 155, 0.5);
  border-radius: 4px;
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--accent-color);
  color: #000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: transform 0.3s, background-color 0.2s;
  opacity: 0.9;
  border: none;
}

.theme-toggle:hover {
  opacity: 1;
  transform: scale(1.1);
}

.theme-toggle i {
  font-size: 24px;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .search-popup .search-container {
    background-color: #292d3e;
  }
  
  .search-popup .search-results::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
  }
  
  .theme-toggle {
    color: #fff;
    background-color: #333;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .search-popup {
    width: 95%;
    height: 95vh;
    top: 2.5vh;
    transform: translateX(-50%) scale(0.95);
  }
  
  .search-popup.visible {
    transform: translateX(-50%) scale(1);
  }
  
  .search-popup .search-container {
    height: 95vh;
    padding: 15px;
  }
  
  .theme-toggle {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

/* Search Toggle Button */
.search-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 80px; /* Position to the left of theme toggle */
  background-color: #4285f4;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: transform 0.3s, background-color 0.2s;
  opacity: 0.9;
  border: none;
}

.search-toggle-btn:hover,
.theme-toggle:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .theme-toggle {
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
  
  .search-toggle-btn {
    bottom: 15px;
    right: 70px;
    width: 45px;
    height: 45px;
  }
}

/* Search Popup Visibility */
.search-popup {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-popup.visible {
  display: block;
  opacity: 1;
}

.search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  backdrop-filter: blur(3px);
  transition: opacity 0.3s ease;
}

.search-overlay.visible {
  display: block;
  opacity: 1;
}

/* Ensure search popup is above overlay */
.search-popup {
  z-index: 1001;
}

/* Styles for demo video message */
.demo-video-message {
  background-color: #f8f9fa;
  border-left: 4px solid #27ae60;
  padding: 15px;
  margin: 15px 0;
  border-radius: 4px;
  font-size: 14px;
}

.demo-video-message p {
  margin-bottom: 10px;
}

.demo-video-message p:first-child {
  font-weight: bold;
  color: #27ae60;
  font-size: 16px;
}

.demo-video-message ul {
  list-style-type: none;
  padding-left: 5px;
  margin: 10px 0;
}

.demo-video-message ul li {
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.demo-video-message ul li:last-child {
  border-bottom: none;
}

/* Fix for the success message display */
.success-message {
  max-width: 800px;
  margin: 20px auto;
}

/* Custom Message Styles */
.custom-message {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  font-family: 'Noto Sans Arabic', sans-serif;
  max-width: 600px;
  width: 80%;
  margin: 0 auto;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  padding: 20px;
}

.custom-message ol {
  padding-left: 25px;
  margin: 15px 0;
}

.custom-message ol li {
  margin-bottom: 10px;
  font-family: monospace;
  background-color: #f5f5f5;
  padding: 5px 10px;
  border-radius: 4px;
}

.custom-message::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* Download Button Styles */
.demo-video-message .btn {
  display: inline-block;
  padding: 12px 20px;
  background-color: #3498db;
  color: white;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s;
}

.demo-video-message .btn:hover {
  background-color: #2980b9;
  text-decoration: none;
}

.demo-video-message .btn i {
  margin-right: 8px;
}

/* Video Progress Animation */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.loading-message > p {
  animation: pulse 1.5s infinite;
}

/* Video Download Styles */
.download-video-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.download-video-message .success-message {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 25px;
  min-width: 300px;
  max-width: 500px;
  text-align: center;
  font-family: Arial, sans-serif;
  position: relative;
}

.download-video-message h3 {
  margin-top: 0;
  color: #4caf50;
  font-size: 1.5rem;
}

.download-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.download-button {
  display: inline-block;
  background-color: #4caf50;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.download-button:hover {
  background-color: #3e8e41;
}

.close-button {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

.close-button:hover {
  background-color: #d32f2f;
}

/* Video Settings Modal Styles */
.video-settings-content {
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.settings-preview-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  margin-bottom: 20px;
}

.settings-column {
  flex: 1;
  min-width: 250px;
}

.preview-column {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
}

.video-settings-form h3 {
  margin-top: 15px;
  margin-bottom: 10px;
  font-size: 18px;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

#videoPreviewPlayer {
  background-color: #f5f5f5;
  border-radius: 5px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  overflow: hidden;
  position: relative;
}

#previewPlaceholder {
  text-align: center;
  color: #666;
  padding: 20px;
}

#previewPlaceholder i {
  font-size: 48px;
  margin-bottom: 10px;
  color: #8e44ad;
}

#previewVideo {
  max-height: 200px;
  width: 100%;
  object-fit: contain;
}

.preview-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(245, 245, 245, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top: 4px solid #8e44ad;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.preview-button-container {
  text-align: center;
  margin-bottom: 15px;
}

#generatePreviewBtn {
  background-color: #8e44ad;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  width: 80%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#generatePreviewBtn:hover {
  background-color: #732d91;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

#generatePreviewBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-preview {
  background-color: #8e44ad;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 80%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-preview:hover {
  background-color: #732d91;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.btn-preview:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.additional-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.video-size-info {
  text-align: center;
  font-size: 14px;
  color: #555;
  margin-top: 10px;
}

.form-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .settings-preview-container {
    flex-direction: column;
  }
  
  .additional-options {
    grid-template-columns: 1fr;
  }
}
#downloadAllAudiosBtn {
  background-color: #3498db;
}

#downloadAllAudiosBtn:hover {
  background-color: #2980b9;
}

#downloadCompleteSurahBtn {
  background-color: #9b59b6;
}

#downloadCompleteSurahBtn:hover {
  background-color: #8e44ad;
}

#downloadAllImagesBtn {
  background-color: #2ecc71;
}
