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

html, body {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1f2e 0%, #2d1b3d 50%, #1a1f2e 100%);
  font-family: 'Tajawal', Arial, sans-serif;
  overflow: hidden;
}

.quran-verse {
  position: fixed;
  top: 20px;
  right: 50%;
  transform: translateX(50%);
  z-index: 50;
  text-align: center;
  padding: 0 30px;
  padding-bottom: 0;
  width: 100%;
  max-width: 900px;
}

.verse-text {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.6),
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(255, 255, 255, 0.15);
  margin: 0;
  line-height: 1.6;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  padding: 12px 20px;
  border-radius: 15px;
  backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: inline-block;
  transition: all 0.3s ease;
}

.container {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  direction: ltr;
  overflow: auto;
  padding-top: 280px;
  padding-bottom: 280px;
}

svg {
  width: min(90vw, 90vh);
  max-width: min(800px, 90vh);
  height: auto;
  display: block;
  direction: ltr;
  transition: transform 0.2s ease;
}

@media (min-width: 768px) {
  svg {
    max-width: min(800px, 70vh);
  }
}

@media (min-width: 1200px) {
  svg {
    max-width: min(600px, 50vh);
  }
}

@media (min-width: 1920px) {
  svg {
    max-width: min(700px, 55vh);
  }
}

.surah-path {
  fill: #ffffff;
  cursor: pointer;
  transition: fill 0.25s ease;
}

.surah-path.active {
  fill: #e63946;
}

.surah-name {
  fill: #000000;
  font-size: 9px;
  font-weight: bold;
  pointer-events: none;
  user-select: none;
  transition: fill 0.25s ease;
}

.surah-path.active + .surah-name {
  fill: #ffffff;
}

.zoom-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

@media (max-width: 768px) {
  .zoom-controls {
    flex-direction: column;
    gap: 10px;
  }
}

.zoom-btn {
  width: 50px;
  height: 50px;
  border-radius: 25px;
  background-color: rgba(34, 40, 49, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.zoom-btn:hover {
  background-color: rgba(34, 40, 49, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.zoom-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.zoom-btn svg {
  color: #ffffff;
  width: 24px;
  height: 24px;
}

.action-buttons {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.action-btn {
  width: 50px;
  height: 50px;
  border-radius: 25px;
  background-color: rgba(34, 40, 49, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.action-btn:hover {
  background-color: rgba(34, 40, 49, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.action-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.action-btn svg {
  color: #ffffff;
  width: 24px;
  height: 24px;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: #2d3440;
  border-radius: 16px;
  padding: 32px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
  color: #ffffff;
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 600;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  color: #ffffff;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(34, 40, 49, 0.6);
  color: #ffffff;
  font-size: 16px;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #e63946;
  background-color: rgba(34, 40, 49, 0.8);
}

.file-type-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.file-type-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(34, 40, 49, 0.6);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  font-family: 'Tajawal', Arial, sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.file-type-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background-color: rgba(34, 40, 49, 0.8);
  color: #ffffff;
}

.file-type-btn.active {
  border-color: #e63946;
  background-color: rgba(230, 57, 70, 0.2);
  color: #ffffff;
  font-weight: 600;
}

.file-type-btn.active:hover {
  border-color: #e63946;
  background-color: rgba(230, 57, 70, 0.3);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.modal-btn {
  flex: 1;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cancel-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.download-btn-primary {
  background-color: #e63946;
  color: #ffffff;
}

.download-btn-primary:hover {
  background-color: #d62839;
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
}

.search-bar {
  position: fixed;
  bottom: 50px;
  right: 50%;
  transform: translateX(50%);
  width: 90%;
  max-width: 400px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(45, 52, 64, 0.95);
  border-radius: 50px;
  padding: 10px 20px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


.search-bar:focus-within {
  border-color: rgba(230, 57, 70, 0.5);
  box-shadow: 
    0 12px 40px rgba(230, 57, 70, 0.4),
    0 4px 16px rgba(230, 57, 70, 0.3);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 16px;
  padding: 8px 0;
  outline: none;
  font-family: 'Tajawal', Arial, sans-serif;
}

.search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.clear-search-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.clear-search-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.search-results-panel {
  position: fixed;
  bottom: 80px;
  right: 50%;
  transform: translateX(50%);
  width: 90%;
  max-width: 400px;
  max-height: 400px;
  background-color: rgba(45, 52, 64, 0.98);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-bottom: none;
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transform: translateX(50%) translateY(20px);
  transition: all 0.3s ease;
  overflow: hidden;
  padding-bottom: 30px;
}

.search-results-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(50%) translateY(0);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
  padding-bottom: 30px;
}

.search-result-item {
  padding: 14px 16px;
  margin-bottom: 6px;
  background-color: rgba(34, 40, 49, 0.6);
  border-radius: 12px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-result-item:hover {
  background-color: rgba(34, 40, 49, 0.9);
  border-color: rgba(230, 57, 70, 0.5);
  transform: translateX(-4px);
}

.search-result-item.active {
  background-color: rgba(230, 57, 70, 0.25);
  border-color: #e63946;
  color: #ffffff;
}

.result-text {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
}

.result-badge {
  color: #e63946;
  font-size: 18px;
  font-weight: bold;
  margin-right: 8px;
}

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

/* Download Modal Updates */
.download-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.download-option-btn {
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(34, 40, 49, 0.6);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: right;
}

.download-option-btn:hover {
  background-color: rgba(34, 40, 49, 0.8);
  border-color: #e63946;
  transform: translateX(-4px);
}

.download-option-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.download-option-size {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.size-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.preset-btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(34, 40, 49, 0.6);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Tajawal', Arial, sans-serif;
}

.preset-btn:hover {
  background-color: rgba(34, 40, 49, 0.8);
  border-color: rgba(230, 57, 70, 0.5);
  transform: translateY(-2px);
}

.preset-btn:active {
  transform: translateY(0);
}

.custom-size-inputs {
  margin-top: 0;
  padding-top: 0;
}

.size-error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background-color: rgba(230, 57, 70, 0.2);
  border: 1px solid rgba(230, 57, 70, 0.5);
  color: #ff6b7a;
  font-size: 14px;
  text-align: right;
}

.color-picker-wrapper {
  position: relative;
}

.color-picker-panel {
  position: absolute;
  bottom: 60px;
  left: 0;
  background-color: rgba(45, 52, 64, 0.98);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 200;
  min-width: 200px;
}

.color-picker-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.color-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.color-option {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.color-option:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

.color-option.active {
  border-color: #e63946;
  box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.4);
  transform: scale(1.1);
}

.download-wrapper {
  position: relative;
}

.download-panel {
  position: absolute;
  bottom: 60px;
  left: 0;
  background-color: rgba(45, 52, 64, 0.98);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 200;
  min-width: 280px;
}

.download-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.download-panel h3 {
  color: #ffffff;
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  text-align: right;
}

.download-panel .download-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.download-panel .download-option-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(34, 40, 49, 0.6);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: right;
}

.download-panel .download-option-btn:hover {
  background-color: rgba(34, 40, 49, 0.8);
  border-color: #e63946;
  transform: translateX(-4px);
}

.download-panel .download-option-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.download-panel .download-option-size {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}


@media print {
  body {
    background: white;
  }
  
  .action-buttons,
  .zoom-controls,
  .search-panel {
    display: none;
  }
  
  .container {
    height: auto;
    padding: 40px;
  }
  
  svg {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .quran-verse {
    top: 15px;
    padding: 0 15px;
    padding-bottom: 120px;
  }

  .verse-text {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .container {
    padding-top: 70px;
    padding-bottom: 180px;
  }

  .search-bar {
    bottom: 50px;
    top: auto;
    width: 85%;
    max-width: 280px;
    padding: 4px 12px;
    border-radius: 25px;
    border-width: 1px;
    gap: 6px;
    min-height: 48px;
    max-height: 48px;
    height: 32px;
  }

  .search-bar input {
    font-size: 13px;
    padding: 0;
    margin: 0;
    line-height: 1.2;
    height: 24px;
    max-height: 24px;
    box-sizing: border-box;
  }

  .clear-search-btn {
    font-size: 16px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
  }

  .search-results-panel {
    bottom: 80px;
    width: 85%;
    max-width: 280px;
    max-height: 300px;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    transform: translateX(50%) translateY(20px);
    padding-bottom: 20px;
  }

  .search-results-panel.active {
    transform: translateX(50%) translateY(0);
  }

  .zoom-controls {
    bottom: 15px;
    right: 15px;
    flex-direction: column;
    gap: 10px;
  }

  .zoom-btn {
    width: 45px;
    height: 45px;
  }

  .zoom-btn svg {
    width: 20px;
    height: 20px;
  }

  .action-buttons {
    bottom: 15px;
    left: 15px;
    gap: 10px;
  }

  .action-btn {
    width: 45px;
    height: 45px;
  }

  .action-btn svg {
    width: 20px;
    height: 20px;
  }

  .modal-content {
    padding: 24px;
    width: 85%;
  }
}

.footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  text-align: center;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer a:hover {
  color: #ffffff;
  transform: translateY(-2px);
}

.github-icon {
  vertical-align: middle;
  width: 1em;
  height: 1em;
}
