@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,700;1,400;1,700&display=block");
@font-face {
  font-family: "Raqq";
  src: url("fonts/Raqq.ttf");
  font-weight: 400;
}

@font-face {
  font-family: 'Qahiri';
  src: url('fonts/Qahiri-Regular.ttf') format('truetype');

}


/* load default font */
@font-face {
font-family: "hafs";
src: url('fonts/hafs/hafs.eot');
src: url('fonts/hafs/hafs.woff2') format('woff2'),
url('fonts/hafs/hafs.woff') format('woff'),
url('fonts/hafs/hafs.otf') format('opentype');
}


/* load default font */
@font-face {
font-family: "warsh";
src: url('fonts/UthmanicWarsh.otf'),
url('fonts/UthmanicWarsh.otf') format('opentype');
}

@font-feature-values "Raqq" {
  @stylistic {
      alt-one: 1;
      alt-two: 2
  }

  @styleset {
      dotless: 1
  }
}

:root {
  --kufi-family: "Raqq", serif;
  --kufi-color: #333;
  --heading-family: "warsh", serif;
  --h1-font-size: 40px;
  --qahiri-family:'Qahiri', sans-serif;
  --amiri-family: "warsh", serif;
  --uthmaniHafs: "warsh", serif;
  --background-color:#FEFFFE;
  --text-color: #333;
  --highlight-color: #E5FCF5;
  --secondary-text-color: #555;
  --verse-text-color: #333;
  --selector-bg-color: white;
  --broder-color : #555;
  --icon-hover-color: #007bff;
  --play-button-border-color: white;
  --morphology-popup-bg-color: white;
  --latin-font: "DM Sans", serif;
  --menu-line: #333;
}

.dark-theme {
  /* Dark theme overrides */
  --background-color: #1c1c1c;
  --text-color: #cccccc;
  --highlight-color: #555;
  --broder-color : #555;
  --secondary-text-color: #dddddd;
  --verse-text-color: #cccccc;
  --selector-bg-color: #333;
  --icon-hover-color: #ffa500;
  --play-button-border-color: #333;
  --morphology-popup-bg-color: #444;
  --menu-line:#ffff;

}

body * {
  font-palette: dark
}


/* Apply the theme variables */
body {
  font-family: var(--latin-font);
  background-color: var(--background-color);
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3 {
  color: var(--verse-text-color);
}
/*


/* Page and Row */

.page {
  padding: 20px;
}


.row {
  font-size: var(--row-font-size);
}



/* Page Navigation Styles */
.page-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  background-color: var(--background-color);
  padding-inline: 40px;

}

.nav-button {
  padding: 4px 8px;          /* smaller padding */
  background-color: var(--selector-bg-color);
  color: var(--text-color);
  border: 1px solid var(--broder-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
  display: inline-flex;      /* IMPORTANT */
  align-items: center;
  gap: 4px;                  /* smaller icon gap */
  width: auto;               /* prevent stretching */
  white-space: nowrap;       /* keep text on one line */
}

.nav-button:hover:not(:disabled) {
  background-color: var(--highlight-color);
}

.nav-button:disabled {
  background-color: var(--background-color);
  cursor: not-allowed;
  opacity: 0.6;
}

.nav-button i {
  font-size: 12px;
}



/* Sura Name Styling */
.sura-separator {
  display: block;
  font-size: 14px;
  letter-spacing: 3px;
}

.sura-name {
  display: block;
  text-align: center;
  font-size: 1.5rem;
  color: var(--verse-text-color);
  direction: rtl;
}
/* Continuous Arabic Text Layout */
.arabic-text-container {
  text-align: right;
  line-height: 1.5;
  direction: rtl;
  margin-bottom: 30px;
  background-color: var(--background-color);
  color: var(--text-color);
}

.arabic{
  word-spacing: 3px;
  font-size: 1.5rem;
  direction: rtl;
  text-align: right;
  color: var(--text-color);
}
/**/

.is-italic {
  font-style: italic;
}


.verse-arabic.highlighted {
  background-color: var(--highlight-color) !important;
  padding: 2px 8px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(102, 255, 255, 0.5);
}



.verse-number-inline {
  display: inline-block;
  color: var(--verse-text-color);
  font-weight: normal;
  margin: 0 8px;
  vertical-align: middle;
  font-size: 12px;
}

.verse-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.verse-link:hover {
  text-decoration: underline;
  color: var(--icon-hover-color);
}

.translations-container {
  margin-top: 30px;
  padding: 10px;
  background-color: var(--background-color);
}

.translation {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
}

.translation:hover {
  background-color: var(--highlight-color);
}

.translation-header {
  font-weight: bold;
  margin-bottom: 5px;
  color: var(--verse-text-color);
  font-family: var(--latin-font);
    display: inline;
}

.translation-content {
  font-family: var(--latin-font);
  font-size: 14px;
  color: var(--secondary-text-color);
    display: inline;
}

/* Page header */
.page-header {
  text-align: center;
  color: var(--verse-text-color);
  padding-bottom: 10px;

}

/* Word styling for continuous text */
.word {
  display: inline;
  cursor: pointer;
  padding: 1px 2px;
  border-radius: 2px;
  transition: background-color 0.2s;
}

.word:hover {
  background-color: var(--highlight-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {

  .page {


  padding: 5px;
}

  .arabic-text-container {
    font-size: 18px;
    line-height: 1.5;
    padding: 10px;
  }
  
  .verse-number-inline {
    font-size: 12px;
    margin: 0 4px;
  }
  
  .page-header {
    font-size: 1;
  }
  

  
  .nav-button {
    width: 100%;
    justify-content: center;
  }

   .page-navigation {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
  }

  .nav-center {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-button {
    font-size: 11px;
    padding: 4px 6px;
  }

  select {
    font-size: 11px;
  }
}


.font-raqq {
  font-family: var(--kufi-family);  /* Applies the Raqq font */
  font-feature-settings: 'ss01' 1;
}

.font-qahiri {
  font-family: var(--qahiri-family) /* Applies the Qahiri font */
}

.font-amiri {
  font-family: var(--amiri-family) /* Applies the Amiri Quran font */
}



.translation {
  font-family: var(--latin-font);
  font-size: 12px;
  color: var(--secondary-text-color);
}

/* Selector styling */
.selector {
 padding: 30px;
  
}

/* Dark theme for the select element */
select {
  background-color:  var(--selector-bg-color);
  color: var(--text-color);
  border: 1px solid var(--broder-color); /* Darker border */
  padding: 5px;
  border-radius: 4px;
}

/* Style the dropdown options */
select option {
  background-color: var(--selector-bg-color);; /* Dark background for options */
  color:  var(--text-color); /* Light text */
}

/* Optionally, change on hover or focus */
select:focus {
  outline: none;
  border-color: var(--highlight-color); /* Add custom highlight color */
}

.morphology-popup {
  position: absolute;
  background-color: var(--morphology-popup-bg-color);
  border: 1px solid #ddd;
  padding: 10px;
  font-size: 12px;
}


/* Menu */

/* Hamburger Menu Styles */
.hamburger-menu {
  position: fixed;
  display: inline-block;
  margin-right: 20px;
}

.menu-icon {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.menu-line {
  width: 25px;
  height: 2px;
  background-color: var(--menu-line);
  margin: 4px 0;
  transition: all 0.3s ease-in-out;
}

#menu-toggle {
  display: none;
}

/* Make the lines thinner and shorter when transformed into 'X' */
#menu-toggle:checked + .menu-icon .menu-line:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
  width: 20px;  /* Reduce the width of the line */
}

#menu-toggle:checked + .menu-icon .menu-line:nth-child(2) {
  opacity: 0;
}

#menu-toggle:checked + .menu-icon .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
  width: 20px;  /* Reduce the width of the line */
}

/* Menu content styles */
.menu-content {
  display: block;
  position: fixed;
  top: 60px;
  padding: 10px;
  padding-right: 10px;
  left: 0;
  right: 0;
  background-color: var(--background-color);
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  width: 50%; /* Ensure full width */
  border-radius: 5px;
  flex-direction: column;
  transform: translateX(-100%);  /*Hidden by default */
  transition: transform 0.3s ease-in-out;
  color: var(--text-color);
}

.menu-content a  { padding: 10px; 
  text-decoration: none; 
  color: var(--text-color);/* Add some padding */}


#menu-toggle:checked ~ .menu-content {
  display: flex;
  transform: translateX(0); /* Slide in from the left */
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #4caf50;
}

input:checked + .slider:before {
  transform: translateX(26px);
}





