* {
font-family: 'Inter', sans-serif;
}

body {
background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
min-height: 100vh;
}
 
  /* Loading Screen Styles */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

#loadingScreen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.loader-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loadingVideo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 2;
  position: relative;
  filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.3));
}

.loading-border {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    #667eea 30deg,
    #764ba2 90deg,
    #a8e6cf 150deg,
    #ff9a9e 210deg,
    #fecfef 270deg,
    #667eea 330deg,
    transparent 360deg
  );
  animation: rotate 2s linear infinite;
  z-index: 1;
  filter: blur(1px);
}

.loading-border::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  border-radius: 50%;
  z-index: 1;
}

.loading-border::after {
  content: '';
  position: absolute;
  top: -15px;
  left: -15px;
  right: -15px;
  bottom: -15px;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    transparent 0deg,
    rgba(102, 126, 234, 0.3) 45deg,
    rgba(118, 75, 162, 0.4) 90deg,
    rgba(168, 230, 207, 0.3) 135deg,
    rgba(255, 154, 158, 0.4) 180deg,
    rgba(254, 207, 239, 0.3) 225deg,
    rgba(102, 126, 234, 0.4) 270deg,
    transparent 360deg
  );
  animation: rotate 3s linear infinite reverse;
  z-index: 0;
  filter: blur(8px);
}

.loader-wrapper::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.15) 25%,
    rgba(168, 230, 207, 0.1) 50%,
    transparent 70%
  );
  animation: pulseGlow 2s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes pulseGlow {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Updated .loading-text with typing effect */
/* Updated .loading-text with right-to-left typing effect */
.loading-text {
  color: #e2e8f0;
  font-size: 1.5rem; /* Adjust font size */
  font-weight: 500; 
  text-align: center;
  display: inline-block; /* Ensure text flows correctly */
  white-space: nowrap; /* Prevent text from wrapping */
  overflow: hidden; /* Hide text beyond the specified width */
  width: 0; /* Start with no visible text */
  direction: rtl; /* Right to left text direction */
  border-left: 3px solid #e2e8f0; /* Blinking cursor effect */
  animation: typing 2s steps(30) 1s forwards, blinkCaret 0.75s step-end infinite;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #dda0dd, #ff7675, #fd79a8, #fdcb6e, #6c5ce7);
  background-size: 200% 200%;
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Typing effect */
@keyframes typing {
  0% {
    width: 0; /* Start with no text */
  }
  100% {
    width: 100%; /* End with full text revealed */
  }
}

/* Blinking caret */
@keyframes blinkCaret {
  0%, 100% {
    border-color: transparent; /* Hide caret */
  }
  50% {
    border-color: #e2e8f0; /* Show caret */
  }
}

.main-content-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-in, visibility 0.6s ease-in;
}

.main-content-visible {
  opacity: 1;
  visibility: visible;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

@keyframes textGradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .loader-wrapper {
    width: 100px;
    height: 100px;
  }
  
  #loadingVideo {
    width: 70px;
    height: 70px;
  }
  
  .loading-border {
    top: -8px;
    left: -8px;
    width: 116px;
    height: 116px;
  }
  
  .loading-border::before {
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
  }
  
  .loading-border::after {
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
  }
  
  .loader-wrapper::before {
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
  }
}

@media (max-width: 480px) {
  .loader-wrapper {
    width: 90px;
    height: 90px;
  }
  
  #loadingVideo {
    width: 60px;
    height: 60px;
  }
    
  .loading-border {
    top: -7px;
    left: -7px;
    width: 104px;
    height: 104px;
  }
  
  .loading-border::before {
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
  }
  
  .loading-border::after {
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
  }
  
  .loader-wrapper::before {
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
  }
}

.enhanced-heading {
position: relative;
display: inline-block;
font-weight: 900;
letter-spacing: -0.05em;
line-height: 0.9;
text-transform: uppercase;
font-size: clamp(3rem, 8vw, 7rem);
animation: heroGlow 3s ease-in-out infinite alternate;
overflow: hidden;
}

.enhanced-heading .quaf-text {
background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #dda0dd, #ff7675, #fd79a8, #fdcb6e, #6c5ce7);
background-size: 1000% 1000%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
color: transparent;
animation: gradientShift 5s ease-in-out infinite;
position: relative;
z-index: 2;
}

.enhanced-heading .bot-text {
background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #a8e6cf 50%, #ff9a9e 75%, #fecfef 100%);
background-size: 300% 300%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
color: transparent;
margin-left: 0.2em;
position: relative;
z-index: 2;
animation: botTextShift 10s ease-in-out infinite reverse;
}

@keyframes gradientShift {
0% { background-position: 0% 50%; }
25% { background-position: 100% 25%; }
50% { background-position: 50% 100%; }
75% { background-position: 25% 0%; }
100% { background-position: 0% 50%; }
}

@keyframes botTextShift {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}

@keyframes heroGlow {
0% { 
transform: scale(1);
}
100% { 
transform: scale(1.02);
}
}

.arabic-verse {
font-family: 'Amiri', serif;
font-size: 1.8rem;
line-height: 1.8;
direction: rtl;
text-align: center;
color: #e2e8f0;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
margin: 20px 0;
}

.verse-translation {
font-size: 1rem;
color: #94a3b8;
font-style: italic;
margin-top: 10px;
}

.gradient-text {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

.gif-showcase {
max-width: 800px;
width: 100%;
height: auto;
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
overflow: hidden;
margin: 0 auto;
}

.gif-showcase img {
width: 100%;
height: auto;
display: block;
border-radius: 20px;
}

.feature-card {
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 15px;
padding: 20px;
margin: 10px 0;
transition: all 0.3s ease;
}

.feature-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
color: white;
padding: 15px 30px;
border-radius: 50px;
font-weight: 600;
text-decoration: none;
display: inline-block;
transition: all 0.3s ease;
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
font-size: 16px;
white-space: nowrap;
flex-shrink: 0;
}

.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
color: white;
}

.btn-secondary {
background: rgba(255, 255, 255, 0.1);
border: 2px solid rgba(255, 255, 255, 0.2);
color: white;
padding: 14px 28px;
border-radius: 50px;
font-weight: 500;
text-decoration: none;
display: inline-block;
transition: all 0.3s ease;
font-size: 16px;
white-space: nowrap;
}

.btn-secondary:hover {
background: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.4);
transform: translateY(-2px);
color: white;
}

.floating-dots {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
z-index: -1;
}

.dot {
position: absolute;
width: 4px;
height: 4px;
background: rgba(102, 126, 234, 0.5);
border-radius: 50%;
animation: float 6s ease-in-out infinite;
}

.dot:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
.dot:nth-child(2) { top: 80%; left: 80%; animation-delay: 2s; }
.dot:nth-child(3) { top: 40%; left: 70%; animation-delay: 4s; }
.dot:nth-child(4) { top: 70%; left: 30%; animation-delay: 1s; }
.dot:nth-child(5) { top: 30%; left: 50%; animation-delay: 3s; }

@keyframes float {
0%, 100% { transform: translateY(0px); opacity: 0.5; }
50% { transform: translateY(-20px); opacity: 1; }
}

.zoom-out-animation {
opacity: 0;
transform: scale(1.2);
transition: all 1s ease-out;
}

.zoom-out-animation.animate {
opacity: 1;
transform: scale(1);
}

.stagger-animation {
opacity: 0;
transform: translateY(30px);
transition: all 0.6s ease-out;
}

.stagger-animation.animate {
opacity: 1;
transform: translateY(0);
}

.navigation-menu {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 8px;
  display: flex;
  gap: 8px;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  min-width: fit-content;
  flex-direction: row;
}

.nav-btn {
  background: transparent;
  color: white;
  border: none;
  padding: 12px; /* instead of 12px 20px */
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: auto; /* remove fit-content so it doesn't force width */
}

/* Add specific positioning for each button */
.nav-btn[onclick*="home"] {
  order: 1;
}

.nav-btn[onclick*="quran"] {
  order: 2;
}

.nav-btn.active {
  background: rgba(102, 126, 234, 0.8);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  transform: none; /* Prevent any transform changes */
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: none; /* Prevent any transform changes */
}

.nav-btn.active:hover {
  background: rgba(102, 126, 234, 0.9);
  transform: none; /* Prevent any transform changes */
}

.speaker-control {
position: fixed;
top: 20px;
right: 20px;
width: 50px;
height: 50px;
background: rgba(255, 255, 255, 0.1);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
z-index: 1000;
}

.speaker-control:hover {
background: rgba(255, 255, 255, 0.2);
transform: scale(1.1);
}

.speaker-control i {
color: white;
font-size: 20px;
transition: all 0.3s ease;
}


.button-container {
margin-bottom: 50px;
}

/* Quran Section Styles - NO GLOWING EFFECTS */
.quran-container {
font-family: 'Times New Roman', serif;
background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
min-height: 100vh;
direction: rtl;
color: #e0e0e0;
padding: 80px 20px 20px;
}

.quran-content {
max-width: 1200px;
margin: 0 auto;
position: relative;
}

.quran-header {
text-align: center;
margin-bottom: 30px;
background: rgba(0, 0, 0, 0.4);
backdrop-filter: blur(10px);
padding: 20px;
border-radius: 15px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
border: 1px solid rgba(255, 255, 255, 0.1);
}

.quran-header h1 {
color: #4dc0b5;
font-size: 2.5em;
margin-bottom: 10px;
}

.quran-header p {
color: #b0b0b0;
font-size: 1.1em;
}

.quran-controls {
display: flex;
justify-content: center;
gap: 15px;
margin: 20px 0;
flex-wrap: wrap;
}

.quran-btn {
background: linear-gradient(145deg, #4dc0b5, #3a9b91);
color: white;
border: none;
padding: 12px 20px;
border-radius: 25px;
cursor: pointer;
font-size: 16px;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(77, 192, 181, 0.3);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
}

.quran-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 25px rgba(77, 192, 181, 0.5);
background: linear-gradient(145deg, #5dd4c7, #4dc0b5);
}

.quran-btn.secondary {
background: linear-gradient(145deg, #6c7b7f, #5a6267);
box-shadow: 0 4px 15px rgba(108, 123, 127, 0.3);
}

.quran-btn.secondary:hover {
background: linear-gradient(145deg, #7c8b8f, #6c7b7f);
box-shadow: 0 6px 25px rgba(108, 123, 127, 0.5);
}

.quran-content-area {
background: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
border-radius: 15px;
padding: 30px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
border: 1px solid rgba(255, 255, 255, 0.1);
min-height: 500px;
position: relative;
}

.chapter-title {
text-align: center;
font-size: 2em;
color: #4dc0b5;
margin-bottom: 20px;
padding: 15px;
background: rgba(77, 192, 181, 0.1);
border-radius: 10px;
border: 2px solid #4dc0b5;
}

.verse {
font-size: 1.5em;
line-height: 2.2;
margin-bottom: 20px;
padding: 15px;
background: rgba(255, 255, 255, 0.05);
border-radius: 10px;
transition: all 0.3s ease;
border-right: 4px solid #4dc0b5;
backdrop-filter: blur(5px);
}

.verse:hover {
background: rgba(255, 255, 255, 0.1);
transform: translateX(-5px);
box-shadow: 0 4px 15px rgba(77, 192, 181, 0.2);
}

.verse-number {
display: inline-block;
background: linear-gradient(145deg, #4dc0b5, #3a9b91);
color: white;
border-radius: 50%;
width: 30px;
height: 30px;
text-align: center;
line-height: 30px;
font-size: 0.8em;
margin-left: 10px;
vertical-align: middle;
box-shadow: 0 2px 8px rgba(77, 192, 181, 0.3);
}

.quran-navigation {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 30px;
padding: 20px;
background: rgba(0, 0, 0, 0.2);
backdrop-filter: blur(10px);
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.1);
}

.chapter-info {
text-align: center;
font-size: 1.2em;
color: #4dc0b5;
font-weight: bold;
}

.quran-zoom-controls {
position: fixed;
top: 100px;
left: 20px;
display: flex;
flex-direction: column;
gap: 10px;
z-index: 1000;
}

.zoom-btn {
width: 50px;
height: 50px;
border-radius: 50%;
background: linear-gradient(145deg, #e74c3c, #c0392b);
color: white;
border: none;
font-size: 20px;
cursor: pointer;
box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
transition: all 0.3s ease;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
}

.zoom-btn:hover {
transform: scale(1.1);
box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

.quran-fullscreen-btn {
position: fixed;
top: 100px;
right: 20px;
z-index: 1000;
}

.search-container {
margin: 20px 0;
text-align: center;
}

.search-input {
background: rgba(0, 0, 0, 0.3);
border: 1px solid rgba(77, 192, 181, 0.5);
border-radius: 25px;
padding: 12px 20px;
color: #e0e0e0;
font-size: 16px;
width: 300px;
max-width: 90%;
text-align: center;
direction: rtl;
}

.search-input::placeholder {
color: #888;
}

.search-input:focus {
outline: none;
border-color: #4dc0b5;
box-shadow: 0 0 10px rgba(77, 192, 181, 0.3);
}

.search-results-container {
margin-top: 20px;
}

.search-result-item {
background: rgba(77, 192, 181, 0.1);
border: 1px solid rgba(77, 192, 181, 0.3);
border-radius: 10px;
margin: 10px 0;
padding: 15px;
cursor: pointer;
transition: all 0.3s ease;
}

.search-result-item:hover {
background: rgba(77, 192, 181, 0.2);
transform: translateY(-2px);
box-shadow: 0 4px 15px rgba(77, 192, 181, 0.3);
}

.search-result-header {
color: #4dc0b5;
font-size: 1.1em;
font-weight: bold;
margin-bottom: 8px;
display: flex;
justify-content: space-between;
align-items: center;
}

.search-result-text {
font-size: 1.3em;
line-height: 1.8;
color: #e0e0e0;
}

.search-highlight {
background: linear-gradient(135deg, #4dc0b5, #3a9b91);
color: white;
padding: 2px 6px;
border-radius: 4px;
font-weight: bold;
box-shadow: 0 2px 4px rgba(77, 192, 181, 0.3);
}

.search-stats {
text-align: center;
color: #888;
margin: 15px 0;
padding: 10px;
background: rgba(0, 0, 0, 0.2);
border-radius: 8px;
}

.clear-search-btn {
background: linear-gradient(145deg, #e74c3c, #c0392b);
color: white;
border: none;
padding: 8px 15px;
border-radius: 20px;
cursor: pointer;
font-size: 14px;
transition: all 0.3s ease;
margin-left: 10px;
}

.clear-search-btn:hover {
transform: scale(1.05);
box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.modal {
display: none;
position: fixed;
z-index: 10001;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(5px);
}

.modal-content {
background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
margin: 5% auto;
padding: 20px;
border-radius: 15px;
width: 90%;
max-width: 800px;
max-height: 80vh;
overflow-y: auto;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.close {
color: #aaa;
float: left;
font-size: 28px;
font-weight: bold;
cursor: pointer;
transition: color 0.3s ease;
}

.close:hover {
color: #4dc0b5;
}

.chapter-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 15px;
margin-top: 20px;
}

.chapter-item {
padding: 15px;
background: rgba(77, 192, 181, 0.1);
border-radius: 10px;
cursor: pointer;
transition: all 0.3s ease;
border: 1px solid rgba(77, 192, 181, 0.2);
text-align: center;
}

.chapter-item:hover {
background: rgba(77, 192, 181, 0.2);
transform: translateY(-2px);
box-shadow: 0 4px 15px rgba(77, 192, 181, 0.3);
}

.chapter-item h4 {
color: #4dc0b5;
margin-bottom: 5px;
font-size: 1.2em;
}

.chapter-item p {
color: #b0b0b0;
font-size: 0.9em;
}

.hidden {
display: none;
}

.fade-in {
animation: fadeIn 0.5s ease-in;
}

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

.loading {
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid #4dc0b5;
border-radius: 50%;
border-top-color: transparent;
animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
.arabic-verse {
font-size: 1.4rem;
line-height: 1.6;
}

.verse-translation {
font-size: 0.9rem;
}

.btn-primary, .btn-secondary {
padding: 12px 20px;
font-size: 14px;
margin: 0 8px;
}

.quran-btn {
padding: 8px 15px;
font-size: 14px;
}

.verse {
font-size: 1.2em;
padding: 10px;
}

.quran-zoom-controls,
.quran-fullscreen-btn {
position: relative;
margin: 10px auto;
}

.button-container {
display: flex;
justify-content: center;
align-items: center;
gap: 16px;
flex-wrap: nowrap;
margin-bottom: 60px;
}

.gif-showcase {
max-width: 90%;
margin: 0 auto;
}

.chapter-grid {
grid-template-columns: 1fr;
}

.navigation-menu {
bottom: 60px;
padding: 6px;
gap: 6px;
}

.nav-btn {
    padding: 10px;         /* equal padding */
    font-size: 16px;       /* adjust icon size if needed */
    border-radius: 50%;    /* optional: makes them round */
    width: 44px;           /* fixed size for consistency */
    height: 44px;
  }
}

@media (max-width: 480px) {
.btn-primary, .btn-secondary {
padding: 10px 16px;
font-size: 13px;
margin: 0 6px;
}

.button-container {
gap: 12px;
}

.navigation-menu {
bottom: 60px;
padding: 4px;
gap: 4px;
}

.nav-btn {
    padding: 8px;          /* equal padding */
    font-size: 14px;
    border-radius: 50%;    /* optional */
    width: 40px;
    height: 40px;
  }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.nav-btn i {
  margin: 0; /* no extra spacing */
  font-size: 20px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.nav-btn.active i {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .nav-btn i {
    margin: 0; /* remove leftover margin */
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .nav-btn i {
    margin: 0; /* remove leftover margin */
    font-size: 16px;
  }
}

#homeBtn {
  order: 1;
}

#quranBtn {
  order: 2;
}

#translationBtn {
  order: 3;
}

#exegesisBtn {
  order: 4;
}

/* ADD THIS NEW ORDER */
#profileBtn {
  order: 5;
}

.navigation-menu {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 8px;
  display: flex;
  gap: 8px;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  min-width: fit-content;
  flex-direction: row; /* Force row direction */
} 
/* Translation Section Styles */
.translation-controls {
display: flex;
justify-content: center;
gap: 15px;
margin: 30px 0;
flex-wrap: wrap;
align-items: center;
}

.translation-select {
background: rgba(0, 0, 0, 0.3);
border: 1px solid rgba(77, 192, 181, 0.5);
border-radius: 25px;
padding: 12px 20px;
color: #e0e0e0;
font-size: 16px;
min-width: 200px;
text-align: center;
cursor: pointer;
}

.translation-select:focus {
outline: none;
border-color: #4dc0b5;
box-shadow: 0 0 10px rgba(77, 192, 181, 0.3);
}

.translation-select option {
background: #2d2d2d;
color: #e0e0e0;
padding: 10px;
}

.language-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 15px;
margin: 30px 0;
padding: 20px;
}

.language-btn {
background: linear-gradient(145deg, rgba(77, 192, 181, 0.1), rgba(77, 192, 181, 0.05));
border: 2px solid rgba(77, 192, 181, 0.3);
border-radius: 15px;
padding: 15px 20px;
color: #e0e0e0;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 12px;
font-size: 16px;
font-weight: 500;
text-align: left;
backdrop-filter: blur(10px);
position: relative;
overflow: hidden;
}

.language-btn:hover {
background: linear-gradient(145deg, rgba(77, 192, 181, 0.2), rgba(77, 192, 181, 0.1));
border-color: #4dc0b5;
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(77, 192, 181, 0.3);
}

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

.language-btn .flag {
font-size: 24px;
min-width: 30px;
text-align: center;
}

.language-btn .language-name {
flex: 1;
font-weight: 600;
}

.language-btn.disabled {
opacity: 0.5;
cursor: not-allowed;
background: rgba(100, 100, 100, 0.1);
border-color: rgba(100, 100, 100, 0.3);
}

.language-btn.disabled:hover {
transform: none;
box-shadow: none;
}

.translation-reading-box {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
border-radius: 20px;
padding: 0;
width: 90%;
max-width: 800px;
max-height: 80vh;
overflow: hidden;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
border: 2px solid rgba(77, 192, 181, 0.3);
z-index: 10002;
backdrop-filter: blur(15px);
}

.translation-header {
background: linear-gradient(135deg, #4dc0b5, #3a9b91);
padding: 20px 30px;
display: flex;
justify-content: space-between;
align-items: center;
}

.translation-header h3 {
color: white;
margin: 0;
font-size: 1.4em;
font-weight: 600;
}

.close-translation {
background: rgba(255, 255, 255, 0.2);
border: none;
border-radius: 50%;
width: 35px;
height: 35px;
color: white;
font-size: 20px;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
}

.close-translation:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.1);
}

.translation-content {
padding: 30px;
max-height: 60vh;
overflow-y: auto;
}

.arabic-verse-display {
font-family: 'Amiri', serif;
font-size: 2em;
line-height: 2;
direction: rtl;
text-align: center;
color: #4dc0b5;
margin-bottom: 25px;
padding: 20px;
background: rgba(77, 192, 181, 0.1);
border-radius: 15px;
border: 1px solid rgba(77, 192, 181, 0.2);
}

.translation-text {
font-size: 1.3em;
line-height: 1.8;
color: #e0e0e0;
text-align: justify;
padding: 20px;
background: rgba(255, 255, 255, 0.05);
border-radius: 15px;
border-left: 4px solid #4dc0b5;
}

.translation-loading {
text-align: center;
padding: 40px;
color: #888;
}

/* Responsive Design */
@media (max-width: 768px) {
.translation-controls {
flex-direction: column;
gap: 10px;
}

.translation-select {
min-width: 250px;
width: 90%;
}

.language-grid {
grid-template-columns: 1fr;
gap: 10px;
padding: 10px;
}

.language-btn {
padding: 12px 15px;
font-size: 14px;
}

.language-btn .flag {
font-size: 20px;
min-width: 25px;
}

.translation-reading-box {
width: 95%;
max-height: 85vh;
}

.translation-content {
padding: 20px;
}

.arabic-verse-display {
font-size: 1.6em;
padding: 15px;
}

.translation-text {
font-size: 1.1em;
padding: 15px;
}
}

@media (max-width: 480px) {
.translation-select {
padding: 10px 15px;
font-size: 14px;
min-width: 200px;
}

.language-btn {
padding: 10px 12px;
font-size: 13px;
gap: 8px;
}

.language-btn .flag {
font-size: 18px;
min-width: 22px;
}

.arabic-verse-display {
font-size: 1.4em;
line-height: 1.8;
}

.translation-text {
font-size: 1em;
}
}

/* Loading overlay for translation section */
.translation-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
display: flex;
align-items: center;
justify-content: center;
z-index: 10001;
backdrop-filter: blur(5px);
}

.translation-overlay.hidden {
display: none;
} 

/* Translation text direction support */
.translation-text {
    transition: all 0.3s ease;
    font-size: 1.3em;
    line-height: 1.8;
    color: #e0e0e0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border-left: 4px solid #4dc0b5;
}

.translation-text[dir="rtl"] {
    border-left: none;
    border-right: 4px solid #4dc0b5;
    font-family: 'Amiri', serif;
    font-size: 1.4em;
    line-height: 2;
}

.translation-text[dir="ltr"] {
    font-family: 'Inter', sans-serif;
    text-align: justify;
}

/* Loading animation improvements */
.translation-loading {
    text-align: center;
    padding: 40px;
    color: #888;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.translation-loading::before {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #4dc0b5;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
} 

/* Hamburger Menu Button */
.menu-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1001;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Hamburger Icon */
.hamburger-icon {
  width: 24px;
  height: 18px;
  position: relative;
  transition: all 0.3s ease;
}

.hamburger-line {
  position: absolute;
  height: 2px;
  width: 100%;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-line:nth-child(1) {
  top: 0;
}

.hamburger-line:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-line:nth-child(3) {
  bottom: 0;
}

/* Cross Icon Animation */
.menu-toggle.active .hamburger-line:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Navigation Menu Animation */
.navigation-menu {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 8px;
  display: flex;
  gap: 8px;
  z-index: 1000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  min-width: fit-content;
  flex-direction: row;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.navigation-menu.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Backdrop Animation */
.menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
  transition: all 0.3s ease;
}

.menu-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .navigation-menu {
    bottom: 60px;
    padding: 6px;
    gap: 6px;
  }
  
  .navigation-menu.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 480px) {
  .navigation-menu {
    bottom: 60px;
    padding: 4px;
    gap: 4px;
  }
}

/* Documents Section Styles */
.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin: 30px 0;
  padding: 20px;
}

.document-card {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.document-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(77, 192, 181, 0.3);
  border-color: rgba(77, 192, 181, 0.5);
}

.document-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #4dc0b5, #3a9b91);
  border-radius: 15px 15px 0 0;
}

.document-icon {
  font-size: 3em;
  color: #F40F02;
  margin-bottom: 15px;
  text-align: center;
}

.document-title {
  color: #e0e0e0;
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
  min-height: 3.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.document-info {
  color: #888;
  font-size: 0.9em;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.document-size {
  background: rgba(77, 192, 181, 0.2);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  color: #4dc0b5;
}

.download-btn {
  background: linear-gradient(135deg, #4dc0b5, #3a9b91);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(77, 192, 181, 0.4);
  background: linear-gradient(135deg, #5dd4c7, #4dc0b5);
}

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

.download-btn i {
  font-size: 1.1em;
}

/* Loading state for documents */
.documents-loading {
  text-align: center;
  padding: 50px;
  color: #888;
}

.documents-loading::before {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid #4dc0b5;
  border-top: 4px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: block;
  margin: 0 auto 20px;
}

/* Responsive Design for Documents */
@media (max-width: 768px) {
  .documents-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }

  .document-card {
    padding: 20px;
  }

  .document-title {
    font-size: 1.1em;
  }

  .document-icon {
    font-size: 2.5em;
  }
}

@media (max-width: 480px) {
  .documents-grid {
    padding: 10px;
  }

  .document-card {
    padding: 15px;
  }

  .document-title {
    font-size: 1em;
    min-height: auto;
  }

  .download-btn {
    padding: 10px 15px;
    font-size: 0.9em;
  }
}

/* Documents Section Enhanced Styles */
.documents-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.documents-search-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-dropdown {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(77, 192, 181, 0.5);
  border-radius: 25px;
  padding: 12px 15px;
  color: #e0e0e0;
  font-size: 14px;
  min-width: 150px;
  cursor: pointer;
  transition: all 0.3s ease;
  direction: ltr;
}

.category-dropdown:focus {
  outline: none;
  border-color: #4dc0b5;
  box-shadow: 0 0 10px rgba(77, 192, 181, 0.3);
}

.documents-search-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(77, 192, 181, 0.5);
  border-radius: 25px;
  padding: 12px 20px;
  color: #e0e0e0;
  font-size: 16px;
  width: 300px;
  max-width: 90%;
  text-align: center;
  direction: ltr;
}

.documents-search-input::placeholder {
  color: #888;
}

.documents-search-input:focus {
  outline: none;
  border-color: #4dc0b5;
  box-shadow: 0 0 10px rgba(77, 192, 181, 0.3);
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
  padding: 20px;
  direction: ltr;
}

.document-card {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 280px;
}

.document-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(77, 192, 181, 0.3);
  border-color: rgba(77, 192, 181, 0.5);
}

.document-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #4dc0b5, #3a9b91);
  border-radius: 15px 15px 0 0;
}

.document-icon {
  font-size: 3em;
  color: #F40F02;
  margin-bottom: 15px;
  text-align: left;
}

.document-title {
  color: #e0e0e0;
  font-size: 1.2em;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
  text-align: left;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.document-info {
  color: #888;
  font-size: 0.9em;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.document-size {
  background: rgba(77, 192, 181, 0.2);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  color: #4dc0b5;
}

.document-category {
  background: rgba(255, 154, 158, 0.2);
  color: #ff9a9e;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  text-transform: capitalize;
}

.download-btn {
  background: linear-gradient(135deg, #4dc0b5, #3a9b91);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  align-self: flex-end;
  margin-top: auto;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(77, 192, 181, 0.4);
  background: linear-gradient(135deg, #5dd4c7, #4dc0b5);
}

.download-btn:active {
  transform: scale(0.98);
}

.download-btn.downloading {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  pointer-events: none;
}

.download-btn.downloaded {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  animation: downloadSuccess 0.6s ease-out;
}

@keyframes downloadSuccess {
  0% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.download-btn .download-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.3s ease;
  width: 0;
}

.no-documents {
  text-align: center;
  padding: 50px;
  color: #888;
  font-size: 1.1em;
}

.no-documents i {
  font-size: 3em;
  margin-bottom: 15px;
  display: block;
}

/* RTL Layout Fixes */
.documents-container[dir="ltr"] .documents-grid {
  direction: ltr;
}

.documents-container[dir="ltr"] .document-card {
  text-align: left;
}

.documents-container[dir="ltr"] .document-title,
.documents-container[dir="ltr"] .document-icon {
  text-align: left;
}

/* Responsive Design for Documents */
@media (max-width: 768px) {
  .documents-header {
    flex-direction: column;
    gap: 10px;
  }
  
  .documents-search-container {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  
  .category-dropdown,
  .documents-search-input {
    width: 100%;
    max-width: 300px;
    direction: ltr;
  }
  
  .documents-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }

  .document-card {
    padding: 20px;
    height: auto;
    min-height: 250px;
  }

  .document-title {
    font-size: 1.1em;
  }

  .document-icon {
    font-size: 2.5em;
  }
}

@media (max-width: 480px) {
  .documents-grid {
    padding: 10px;
  }

  .document-card {
    padding: 15px;
    min-height: 220px;
  }

  .document-title {
    font-size: 1em;
  }

  .download-btn {
    padding: 10px 15px;
    font-size: 0.9em;
  }
}
