/* Register Fonts */

@font-face { font-family: 'AlQalam'; src: url('../fonts/AlQalam.ttf'); }

@font-face { font-family: 'Nastaleeq'; src: url('../fonts/Nastaleeq.ttf'); }

@font-face { font-family: 'SansFont'; src: url('../fonts/sans.ttf'); }

@font-face { font-family: 'lipi'; src: url('../fonts/lipi.ttf'); }
@font-face { font-family: 'kokila'; src: url('../fonts/kokila.ttf'); }
@font-face { font-family: 'hafs'; src: url('../fonts/hafs.ttf'); }

:root {

  --arabic-size: 33px;
    --arabic-font-choice: 'AlQalam'; /* Default */
    --translation-font: 'Nastaleeq'; /* Default */
    --sans-size: calc(var(--arabic-size) - 5px);

}
/* Header Layout */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    gap: 5px;
}

.header-section {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Make selectors smaller for mobile */
.jump-box, .btn-nav {
    padding: 4px 6px;
    font-size: 12px;
}

.surah-nav-select {
    max-width: 100px;
    font-weight: bold;
}

.header-sub-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 5px;
    background: rgba(0,0,0,0.05); /* Light distinction */
}

/* Word by Word Toggle Style */
#wbw-toggle {
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Hide WBW elements when class is active on body */
body.hide-wbw .word-span { 
    display: none; 
}

@media (max-width: 480px) {
    .surah-name-small { font-size: 11px; }
    .compact-select { width: 50px; }
    .icon-svg-nav { width: 18px; height: 18px; }
}

.top-download-bar {
    display: block;
    width: 100%;
    box-sizing: border-box; /* Add this line */
    background: linear-gradient(90deg, #27ae60, #219653);
    color: #ffffff;
    text-align: center;
    padding: 8px 12px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    position: sticky;
    top: 0;
    z-index: 9999;
}

.top-download-bar:hover {
    background: linear-gradient(90deg, #219653, #27ae60);
    text-decoration: underline;
}

/* Dark mode support */
.dark-theme .top-download-bar {
    background: linear-gradient(90deg, #1e8449, #145a32);
}


body {

    background-color: #f4f7f6;

    margin: 0; padding: 0;

    font-family: 'SansFont', sans-serif;

}



.sticky-header {

    position: sticky;

    top: 0;

    z-index: 1000;

    background: #27ae60;

    color: white;

    padding: 15px;

    box-shadow: 0 4px 12px rgba(0,0,0,0.15);

}



/* Header layout */

.header-content {

    display: flex;

    flex-direction: row;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

}



/* Center section - ENGLISH AND ARABIC NAMES INLINE */

.header-section.center {

    display: flex;

    align-items: center;

    justify-content: center;

    flex: 2;

    text-align: center;

    gap: 15px; /* Space between English and Arabic names */

    flex-wrap: nowrap; /* Prevent wrapping on desktop */

}



/* Make English and Arabic names appear on same line */

.surah-name-big {

    font-size: 22px;

    font-weight: bold;

    white-space: nowrap; /* Prevent text wrapping */

}



.arabic-name-big {

    font-family: 'AlQalam';

    font-size: 30px;

    white-space: nowrap; /* Prevent text wrapping */

}



/* For mobile - stack vertically */

@media (max-width: 768px) {

    .header-content {

        flex-direction: column;

        gap: 10px;

    }

   

    .header-section {

        width: 100%;

        justify-content: center !important;

    }

   

    .header-section.center {

        order: 1;

        text-align: center;

        flex-direction: row; /* Still horizontal on mobile */

        flex-wrap: wrap; /* Allow wrapping if needed on very small screens */

        gap: 10px;

        padding: 0 10px;

    }

   

    .header-section.left {

        order: 2;

        justify-content: center !important;

    }

   

    .header-section.right {

        order: 3;

        justify-content: center !important;

        flex-wrap: wrap;

        gap: 10px;

    }

   

    .surah-name-big {

        font-size: 20px;

    }

   

    .arabic-name-big {

        font-size: 26px;

    }

   

    /* On very small screens, allow names to wrap */

    @media (max-width: 480px) {

        .header-section.center {

            flex-direction: column; /* Stack vertically only on very small screens */

            gap: 5px;

        }

    }

}



.header-section {

    display: flex;

    align-items: center;

    gap: 10px;

}



.header-section.left {

    justify-content: flex-start;

    flex: 1;

}



.header-section.right {

    justify-content: flex-end;

    flex: 1;

}



/* Controls */

.jump-group {

    display: flex;

    gap: 8px;

    align-items: center;

}



.jump-box {

    width: 60px;

    padding: 6px;

    border-radius: 4px;

    border: none;

    text-align: center;

    font-size: 16px;

    color: #333; /* Add text color for better visibility */

}




.seekbar-container {

    display: flex;

    align-items: center;

    min-width: 120px;

}



#size-slider {

    width: 100%;

    max-width: 150px;

}



/* Add a separator between English and Arabic names if needed */

/* Optional: Add a subtle separator */

.header-section.center::before {

    content: "•";

    color: rgba(255, 255, 255, 0.6);

    font-size: 18px;

    display: none; /* Hidden by default */

}



/* Show separator only on larger screens if you want */

@media (min-width: 481px) {

    .header-section.center::before {

        display: inline;

    }

}



.container {

    max-width: 900px;

    margin: 0 auto;
    

    padding: 20px;

}

.ayah-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;        
    margin-bottom: 20px;
    background: #fff;
    border-radius: 12px;
    max-width: 100%;       
    box-sizing: border-box; 
    overflow: hidden;      
}


.arabic-text {
    font-family: var(--arabic-font-choice), serif;
    font-size: var(--arabic-size);
    line-height: 2.2;
    color: #27ae60;
    margin: 20px 0;
    text-align: center !important;
    direction: rtl !important;
    display: block;
    width: 100%;
}

/* Translation centered normally */
.translation-main {
    font-family: var(--translation-font), sans-serif;
    font-size: calc(var(--arabic-size) - 8px);
    line-height: 1.8;
    margin: 20px 0;
    text-align: center !important;
    direction: ltr !important;
    display: block;
    width: 100%;
    padding: 0 10px;
}

.word-by-word-section {
    direction: rtl !important;
    text-align: right !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: rgba(39, 174, 96, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(39, 174, 96, 0.2);
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

/* Each word pair in RTL */
.word-pair {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    margin: 5px;
    padding: 5px 10px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    direction: rtl !important;
}



.word-separator {

    margin: 0 5px;

    color: #999;

}

/* Arabic in word-by-word - same font as ayah */
.word-arabic {
    font-family: var(--arabic-font-choice), serif !important;
    color: #27ae60;
    font-size: calc(var(--arabic-size) - 5px);
    margin-left: 8px;
}

/* Meaning in word-by-word */
.word-meaning {
    font-family: var(--translation-font), sans-serif;
    color: #333;
    font-size: calc(var(--arabic-size) - 10px);
    margin-right: 8px;
}


#list-container {

    display: flex;

    flex-direction: column;

    gap: 10px;

    padding: 10px;

}



.surah-item {

    display: flex;

    justify-content: space-between;

    padding: 15px 20px;

    background: white;

    border-radius: 10px;

    text-decoration: none;

    color: #333;

    border: 1px solid #eee;

    transition: all 0.2s ease;

    font-family: 'SansFont', sans-serif;

}



.surah-item:hover {

    background: #f0fff4;

    border-color: #27ae60;

    transform: translateY(-2px);

    box-shadow: 0 4px 8px rgba(0,0,0,0.05);

}



.surah-item span:first-child {

    font-size: 18px;

    font-weight: 600;

}



.ayah-footer {

    display: flex;

    gap: 12px;

    margin-top: 15px;

}



.btn-action {

    display: flex;

    align-items: center;

    gap: 8px;

    background: #ffffff;

    border: 1.5px solid #27ae60;

    padding: 6px 14px;

    border-radius: 6px;

    cursor: pointer;

    font-weight: 600;

    color: #27ae60;

    transition: 0.3s;

}



.icon-svg {

    width: 18px;

    height: 18px;

    filter: invert(48%) sepia(79%) saturate(452%) hue-rotate(92deg) brightness(93%) contrast(85%);

}



.btn-action:hover {

    background: #27ae60;

    color: white;

}



.btn-action:hover .icon-svg {

    filter: brightness(0) invert(1);

}



.nav-controls {

    display: flex;

    gap: 8px;

}



.dark-theme .ayah-container {
    background-color: #000000; /* Pure Black for OLED */
    border: 1px solid #0c0c0c;
}

/* Fix Word Meaning text color */

.dark-theme .word-meaning {
    color: #eee;
}


.dark-theme .word-separator {
    color: #a9c5aa;
}

.dark-theme .word-pair {
    background: #1a1a1a;
}
/* Fix Translation Main text color */
.dark-theme .translation-main {
    color: #ffffff;
}

/* Fix Copy/Share Buttons */
.dark-theme .btn-action {
    background: #111;
    border-color: #2ecc71;
    color: #2ecc71;
}

.dark-theme .btn-action:hover {
    background: #2ecc71;
    color: #000;
}

/* Adjust Icons in Dark Mode buttons */
.dark-theme .btn-action .icon-svg {
    filter: invert(72%) sepia(81%) saturate(351%) hue-rotate(92deg) brightness(95%) contrast(92%);
}

.dark-theme .btn-action:hover .icon-svg {
    filter: brightness(0); /* Black icon on green background hover */
}

/* Header Buttons (Back/Home/Toggle) Fix */
.dark-theme .btn-nav {
    background: #000000;
    border-color: #2ecc71;
}

.dark-theme .btn-nav:hover {
    background: #2ecc71;
}

/* Fix Navigation Icon Filter in Dark Mode */
.dark-theme .icon-svg-nav {
    filter: invert(72%) sepia(81%) saturate(351%) hue-rotate(92deg) brightness(95%) contrast(92%);
}

.dark-theme .btn-nav:hover .icon-svg-nav {
    filter: brightness(0);
}

/* Jump to Ayah Button Fix */
.dark-theme .btn-go {
    background: #000000;
    color: #2ecc71;
    border-color: #2ecc71;
}

html.dark-theme, 
body.dark-theme, 
.dark-theme body, 
.dark-theme .container {
    background-color: #000000 !important;
    background: #000000 !important;
    color: #ffffff !important;
}

/* Fix the header specifically */
.dark-theme .sticky-header {
    background-color: #000000 !important;
    border-bottom: 1px solid #1a1a1a;
}
/* When the 'hide-wbw' class is added to body, hide the WBW section */
body.hide-wbw .word-by-word-section {
    display: none !important;
}

/* The switch - the box around the slider */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider track */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

/* The sliding circle (thumb) */
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Style when checked (Android Teal/Blue) */
input:checked + .slider {
  background-color: #2196F3;
}

/* Move the circle when checked */
input:checked + .slider:before {
  transform: translateX(22px);
}
/* Ensure the header has a transition effect */
.sticky-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease-in-out; /* Smooth slide effect */
}

/* This class will be added via JavaScript when scrolling down */
.header-hidden {
    transform: translateY(-100%);
}
/* Wrapper */
.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 999;
}

/* Download Bar */
.top-download-bar {
  display: block;
  background: #0c8f4e;
  color: #fff;
  text-align: center;
  padding: 8px 10px;
  font-size: 14px;
  text-decoration: none;
}

/* Header */
.sticky-header {
 display: flex;
    align-items: center;
    justify-content: space-between;
    background: #27ae60;
    color: white;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box; /* Prevents horizontal scroll */
}

/* Sections */
.header-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-section.center {
  flex-direction: column;
  text-align: center;
  flex: 1;
}

/* Titles */
.surah-name-big {
  font-weight: 600;
  font-size: 19px;
}

.arabic-name-big {
  font-size: 25px;
}

/* Buttons */
.btn-nav {
  background: none;
  border: none;
    color: #ffffff;
  cursor: pointer;
}

.btn-nav img {
  width: 22px;
    filter: brightness(0) invert(1) !important; 

}

/* Inputs */
.jump-box,
#jump-input {
  padding: 4px 6px;
  font-size: 14px;
}

.btn-go {
  padding: 4px 8px;
  background: #0c8f4e;
  color: white;
  border: none;
  cursor: pointer;
}

/* Toggle */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Switch */
.switch {
  position: relative;
  width: 36px;
  height: 18px;
}
.switch input { display: none; }
.slider {
  position: absolute;
  background: #ccc;
  border-radius: 20px;
  inset: 0;
}
.slider::before {
  content: "";
  width: 14px;
  height: 14px;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  transition: 0.3s;
}
.switch input:checked + .slider {
  background: #0c8f4e;
}
.switch input:checked + .slider::before {
  transform: translateX(18px);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .header-section.right {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .surah-name-big {
    font-size: 14px;
  }

  .arabic-name-big {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .jump-group,
  #size-slider {
    display: none; /* clean mobile UI */
  }
}
.quick-choice-bar {
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    margin-top: 4px;
}

.quick-choice-bar button {
    background: #555;
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.quick-choice-bar button:hover {
    background: #777;
}

.quick-choice-bar .close {
    background: transparent;
    font-size: 1.1rem;
    padding: 4px 8px;
}

.quick-choice-bar .close:hover {
    color: #ff6b6b;
}