/*
@import url('https://fonts.googleapis.com/css2?family=Amiri&family=Scheherazade+New&family=Noto+Naskh+Arabic&family=Lateef&display=swap');
*/

@font-face {
  font-family: 'UthmanicHafs';
  src: url('../fonts/Uthmanic_NeoCOLOR-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}


html { height: 100%; overflow-x: hidden; }  /* safe for PCs */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-color:white;

    font-family: 'UthmanicHafs', serif;

    margin: 0;
    direction: rtl;


    overflow-x: hidden;
}

/* 2) Only when the app is launched from Home Screen (standalone) */
@media all and (display-mode: standalone) {
  /* Respect iPhone notch / home indicator; other platforms resolve to 0 */
  body {
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
  }
}



.nav-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    left: 0;
    width: 100%;
    height: 75px;
    background-color: #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.nav-bar select {
    font-size: 1em;
    padding: 5px;
}

.nav-bar button {
    font-size: 1em;
    padding: 5px 10px;
}

.nav-bar .center-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.surah-container {
  text-align: center;
  line-height: 1.8;
  font-size: 2.5em;
  color: #222;
  padding: 1px;
  margin-top: 10px;
  width: 100%;
  display: flex;           /* automatic wrapping */
  flex-wrap: wrap;         /* allow words to wrap */
  justify-content: center; /* center content */

  /* point 3 */
  max-width: min(90%, 100vw); /* cap at 90% but never exceed viewport */
  box-sizing: border-box;

  font-size: clamp(1.4rem, 6vw, 2.5em);

  margin-bottom: 80px;
  
}

.word-container {
    display: flex;           /* Set display to flex for better alignment */
    flex-direction: column;  /* Align Arabic word and transliteration vertically */
    align-items: center;     /* Center align the text in each word-container */
    margin: 5px;             /* Add some space between words */
}



.nav-bar.second-row {
    justify-content: center;
    gap: 10px; /* space between the buttons */
    height: 65px;
    background-color: white;

    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    top: auto;
}



#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#loading-overlay .loading-content {
    text-align: center;
}

#loading-overlay p {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

#loading-overlay button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
}





/* color: #555;  */
.bismillah {
    margin-top: 12px;
    font-size: 25px;    
    color:#555;

    font-family: 'UthmanicHafs', serif;
    
    text-align: center;
    letter-spacing: 1px;
}

/* 
#444;

#012300
*/
.transliteration {
    display: block;
    font-size: 0.6em;
    color: #2e0b0b !important;
    margin-top: -5px;
    line-height: 1.8;
}

/* 
#444;
#600; 
#52F;

#15803d66
*/
.transliteration_bangla {
    display: block;
    font-size: 0.45em;
    color: #600; 
    margin-top: -5px;
    line-height: 1.8;    
}

.transliteration_nepal {
    display: block;
    font-size: 0.45em;
    color: #600; 
    margin-top: -5px;
    line-height: 1.8;    
}

.transliteration_russia {
    display: block;
    font-size: 0.45em;
    color: #600; 
    margin-top: -5px;
    line-height: 1.8;    
}

/* 
red;

#15803d5e
*/
.translation { 
    display:none;
    font-size: 0.4em;
    color: darkred;
}
.translation_bangla { 
    display:none;
    font-size: 0.4em;
    color: darkred;
}
.translation_fr { 
    display:none;
    font-size: 0.4em;
    color: darkred;
}
.translation_nl { 
    display:none;
    font-size: 0.4em;
    color: darkred;
}
.translation_de { 
    display:none;
    font-size: 0.4em;
    color: darkred;
}
.translation_ru { 
    display:none;
    font-size: 0.4em;
    color: darkred;
}


/*
.tajweed-color-red { color: black; font-family: 'Scheherazade New', serif; } 
.tajweed-color-blue { color: black; font-family: 'Scheherazade New', serif;}  
.tajweed-color-green { color: black; font-family: 'Scheherazade New', serif;} 
.tajweed-color-purple { color: black; font-family: 'Scheherazade New', serif;} 

.tajweed-color-red { color: black; font-family: 'UthmanicNeoColor', serif; }
.tajweed-color-blue { color: black; font-family: 'UthmanicNeoColor', serif; }
.tajweed-color-green { color: black; font-family: 'UthmanicNeoColor', serif; }
.tajweed-color-purple { color: black; font-family: 'UthmanicNeoColor', serif; }


.arabic-word,
.tajweed-color-red,
.tajweed-color-blue,
.tajweed-color-green,
.tajweed-color-purple {
  font-family: 'UthmanicHafs', serif;
  letter-spacing: normal; }

*/

.arabic-word {
    display: block;
    font-size: 1.5em;
    line-height: 1.9;   
}

.arabic-word,
.tajweed-color-red,
.tajweed-color-blue,
.tajweed-color-green,
.tajweed-color-purple,
.tajweed-color-orange {
  font-family: 'UthmanicHafs', serif !important;
  letter-spacing: normal;          /* critical for Arabic marks */
}

.arabic-word {
  text-rendering: optimizeLegibility;
}

.verse-number {
    display: inline-block;
    min-width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #f0e68c;
    line-height: 30px;
    text-align: center;
    font-size: 0.8em;
    margin: 54px 10px;
    vertical-align: middle;
    color: #000;
}    



/* Modal window */

/* Modal Background Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Modal Container 
 max-width: 400px;
*/
.modal-container {
    background: #fff;
    border-radius: 8px;
    width: 30%;   
    height: 90%;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    text-align: center;

    overflow:auto;

    /* Force left-to-right layout */
    direction: ltr;
    text-align: left;    
}

/* Close Button */
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #333;
}

/* Modal Content */
h2 {
    margin-top: 0;
    color: #8B0000;
    font-size: 1.2em;
    text-align: left;
}

.dropdown {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.close-button:hover {
    color: red;
}

/* Close Button for Large Devices */
.btn-close {
    margin-top: 10px;
    background: #2b5fcc;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

@media (max-width: 600px) {
    .modal-container {
        width: 95%;
    }
}


/* Night Theme */
/* Night Theme */
body.night-theme {
    /*background-color: #121212;  Dark background */
    background-color:black;
    color: #e0e0e0; /* Light gray text for contrast */
}

.night-theme .nav-bar {
    background-color: #1e1e1e; /* Darker navbar background */
    color: #e0e0e0;
}

.night-theme .nav-bar button, 
.night-theme .nav-bar select {
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
}

.night-theme .surah-container {
    color: #ffffff; /* White for Arabic text */
}

.night-theme .word-container .transliteration {
    color: #bbbbbb; /* Lighter gray transliteration */
}

.night-theme .verse-number {
    background-color: #444444;
    color: #ffffff;
}

.night-theme .modal-container {
    background-color: #1e1e1e; /* Dark modal background */
    color: #e0e0e0;
}

.night-theme .dropdown {
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
}

.night-theme .close-button {
    color: #e0e0e0;
}




/* Full-Screen Overlay */
#apps_icon {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;

 
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* App Icons Container */
.app-grid {
    display: flex;
    flex-direction: column;     /* stack vertically */
    align-items: center;        /* center horizontally */
    gap: 20px;                  /* space between buttons */
    padding: 80px 20px 100px;   /* space for top padding & bottom button */
    width: 100%;
    max-width: 500px;           /* limit width for large screens */
    overflow-y: auto;           /* scroll vertically if too many */
    flex: 1;                    /* fill available space */
    margin: 0 auto;             /* center in overlay */
}

/* Responsive breakpoints */
@media (max-width: 1024px) { /* tablets */
    .app-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) { /* mobile */
    .app-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) { /* small phones */
    .app-grid {
        grid-template-columns: 1fr;
    }
}

/* App Icon Style */
.app-icon {
    width: 100%;                /* take full width of container */
    max-width: 400px;           /* not too wide on desktops */
    height: 60px;               /* shorter for button style */
    background-color: #333;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    box-shadow: 0 5px 10px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.app-icon:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.close-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: white;
    background: red;
    width: 100%;          /* take full width */
    max-width: 400px;     /* same as app-icon max width */
    height: 60px;         /* same height as app buttons */
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    z-index: 1100;
}

.close-btn:hover {
    background: darkred;
    transform: translateX(-50%) scale(1.02); /* match hover effect */
}







.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-item input[type="checkbox"] {
    width: 40px;
    height: 20px;
    appearance: none;
    background: #ccc;
    border-radius: 20px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-item input[type="checkbox"]::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: transform 0.3s;
}

.toggle-item input[type="checkbox"]:checked {
    background: #4caf50;
}

.toggle-item input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.surah-info {
    padding: 80px;
    text-align: left;

}
.surah-info h2 {
    font-size: 1.5em;
    color: #8B0000;
}
.surah-info p {
    font-size: 22px;
    color: #333;
    
    border: solid 1px;
    padding: 10px;
    border-radius: 5px;
    background-color: beige;   
    
    
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
    white-space: pre-line;    
}
.surah-info p:lang(ar),
.surah-info p:has(:dir(rtl)),
.surah-info p {
  unicode-bidi: plaintext; /* Auto-resolves Arabic direction inside LTR context */
}


#hydepark { 
    display: none;
    text-align: left;
}