/* ------------------ RESET ------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

/* ------------------ BODY ------------------ */
body {
  background: linear-gradient(to bottom right, #f2e6c0, #cdc7c7);
  color: #fdf6e3;
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  position: relative;
  min-height: 100vh;
}

/* Logo as centered background image */
body::before {
  content: "";
  background-image: url('logo for Al-Maktabah.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 300px 300px;
  opacity: 0.15;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  pointer-events: none;
  z-index: 0;
}

/* ------------------ HEADER ------------------ */
.app-header {
  background: linear-gradient(to right, #0f3d2e, #1a5c43);
  color: #fdf6e3;
  text-align: center;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border-bottom: 3px solid #d4af37;
}

.app-logo {
  height: 60px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.app-title-group {
  text-align: center;
  margin-top: 0.5em;
}

.app-subtitle {
  font-size: 0.8em; /* Much smaller than default */
  font-weight: 300;
  color: #fdf6e3;
  font-style: italic;
  margin-top: 0.2em;
}
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-around;
  padding: 5px 0;
}

.bottom-nav button {
  background: none;
  border: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
  padding: 5px 0;
}

.bottom-nav .icon {
  font-size: 22px;
}

.bottom-nav .label {
  font-size: 12px;
  margin-top: 3px;
  color: #000000;
}


/* ------------------ MAIN CONTENT ------------------ */
#hadith-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  margin-bottom: 60px;
  scroll-behavior: smooth;
}

/* ------------------ HADITH CARDS ------------------ */
.hadith-card {
  background-color: #1a5c43;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 15px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  transition: background 0.3s, color 0.3s, transform 0.3s ease;
}

.hadith-card:hover {
  transform: scale(1.02);
}

/* ------------------ BOTTOM NAVIGATION ------------------ */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  background: rgb(250, 233, 233);
  padding: 0.8rem;
  border-top: 1px solid #ddd;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 10;
}

.bottom-nav button {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: linear-gradient(to right, #0f3d2e, #1a5c43);
  transition: color 0.3s;
}

.bottom-nav button:hover {
  color: linear-gradient(to right, #0f3d2e, #1a5c43);
}

/* ------------------ DARK MODE ------------------ */
body.dark,
.app-wrapper.dark {
  background: #67676a;
  color: #fdf6e3;
}

body.dark .app-header {
  background:  linear-gradient(to right, #0f3d2e, #1a5c43);
  color: #fdf6e3;
  border-bottom: 2px solid #d4af37;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

body.dark .hadith-card {
  background-color: linear-gradient(to right, #0f3d2e, #1a5c43);
  color: #fdf6e3;
}
body.dark .categories-grid button {
  background-color: #1a5c43;
  color: #fdf6e3;
}

body.dark .bottom-nav {
  background: rgb(250, 233, 233);
  border-top: 1px solid #444;
}

body.dark .bottom-nav button {
  color: #000000;
}

/* ------------------ UTILITY ------------------ */
.hidden {
  display: none !important;
}

/* ------------------ FLOATING SEARCH BUTTON ------------------ */
.search-toggle {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 55px;
  height: 55px;
  background-color: linear-gradient(to right, #0f3d2e, #1a5c43);
  color: #0f3d2e;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  cursor: pointer;
  z-index: 20;
  transition: background 0.3s;
}

.search-toggle:hover {
  background-color: #0f3d2e;
}

/* ------------------ SEARCH INPUT FIELD ------------------ */
.search-box {
  margin-bottom: 1rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.search-box input {
  width: 100%;
  padding: 0.6rem;
  border-radius: 25px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

/* ------------------ ANIMATION ------------------ */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ------------------ MODERN SETTINGS SCREEN ------------------ */ 
.settings-title {
  font-size: 24px;
  margin-bottom: 16px;
  text-align: center;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Responsive 2-3 cols */
  gap: 16px;
  padding: 10px;
}

.settings-item {
  background-color: #1a5c43; /* Dark green */
  color: #fff;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.settings-item:hover {
  transform: scale(1.05);
  background-color: #21855a; /* Slightly brighter on hover */
}

.settings-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.settings-label {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}


.translation-card,
.info-card {
  background-color: #1a5c43;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  text-align: center;
}

.translation-card label {
  font-size: 16px;
  margin-bottom: 8px;
  display: block;
}

#translation-select {
  padding: 10px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ccc;
  width: 80%;
  max-width: 300px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 20px;
}

.categories-grid button {
  background-color: #1a5c43;
  color: #fdf6e3;
  font-size: 18px;
  padding: 15px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.categories-grid button:hover {
  background-color: #1a5c43;
  transform: scale(1.05);
}

.Names-box, .dua-box, .quran-box {
  background: #1a5c43;
  padding: 15px;
  margin: 10px 0;
  border-radius: 10px;
  box-shadow: 0 3px 6px rgba(4, 1, 1, 0.1);
  
  text-align: left;
}
/* ------------------ Section Headings ------------------ */
#hadith-container h2,
#hadith-container h3 {
  color: #422d2d; /* Make all section headings black */
  font-weight: bold;
  margin-bottom: 10px;
}

/* Words of Wisdom section */
#wisdom-container {
  color: #422d2d;  /* Black text for normal background */
  background-color: transparent; /* keep current background */
  line-height: 1.6;
  padding: 15px;
}

/* Headings inside Wisdom section */
#wisdom-container h2,
#wisdom-container h3 {
  color: #422d2d;  /* Black headings */
  font-weight: bold;
}

#wisdom-container li {
  color: #422d2d;  /* Black list items */
  margin-bottom: 0.5rem;
}

.back-btn {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  margin-bottom: 10px;
}

ul {
  list-style: "✨ ";
  padding-left: 20px;
}

button {
  margin-top: 15px;
}

/* ------------------ MOBILE RESPONSIVE ------------------ */
@media (max-width: 480px) {
  .app-header {
    font-size: 1.2rem;
    padding: 0.8rem;
    gap: 10px;
  }

  #hadith-container {
    padding: 0.8rem;
    margin-bottom: 70px;
  }

  .categories-grid {
    grid-template-columns: 1fr;
    padding: 15px;
  }

  .categories-grid button {
    font-size: 16px;
    padding: 12px;
  }

  .hadith-card,
  .Names-box,
  .dua-box,
  .quran-box {
    padding: 12px;
  }

  .bottom-nav button {
    font-size: 1.2rem;
  }
}

/* ------------------ TABLET RESPONSIVE ------------------ */
@media (min-width: 481px) and (max-width: 768px) {
  .app-header {
    font-size: 1.2rem;
    padding: 0.9rem;
    gap: 12px;
  }

  #hadith-container {
    padding: 1rem;
    margin-bottom: 65px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 15px;
  }

  .categories-grid button {
    font-size: 17px;
    padding: 14px;
  }

  .hadith-card,
  .Names-box,
  .dua-box,
  .quran-box {
    padding: 14px;
  }

  .bottom-nav button {
    font-size: 1.3rem;
    padding: 10px;
  }
}

/* ------------------ DESKTOP RESPONSIVE ------------------ */
@media (min-width: 769px) {
  .app-header {
    font-size: 1.3rem;
    padding: 1rem;
    gap: 15px;
  }

  #hadith-container {
    padding: 1rem;
    margin-bottom: 60px;
  }

  .categories-grid button {
    font-size: 18px;
    padding: 15px;
  }

  .hadith-card,
  .Names-box,
  .dua-box,
  .quran-box {
    padding: 15px;
  }

  .bottom-nav button {
    font-size: 1.4rem;
  }
}
/* ------------------ RESPONSIVE OPTIMIZATION ------------------ */

/* Small phones (up to 360px) */
@media only screen and (max-width: 360px) {
  .app-header {
    flex-direction: column !important;
    font-size: 1.1rem !important;
    padding: 0.6rem !important;
    gap: 5px !important;
  }

  .app-logo {
    height: 40px !important;
  }

  .bottom-nav button {
    font-size: 1.2rem !important;
  }

  .hadith-card,
  .Names-box,
  .dua-box,
  .quran-box {
    padding: 10px !important;
    margin: 8px 0 !important;
  }

  .categories-grid button {
    font-size: 16px !important;
    padding: 12px !important;
  }
}

/* Medium phones / small tablets (361px – 768px) */
@media only screen and (min-width: 361px) and (max-width: 768px) {
  .app-header {
    font-size: 1.3rem !important;
    gap: 10px !important;
  }

  .app-logo {
    height: 50px !important;
  }

  .bottom-nav button {
    font-size: 1.3rem !important;
  }

  .hadith-card,
  .Names-box,
  .dua-box,
  .quran-box {
    padding: 12px !important;
    margin: 9px 0 !important;
  }

  .categories-grid button {
    font-size: 17px !important;
    padding: 14px !important;
  }
}

/* Large tablets / small laptops (769px – 1024px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
  .app-header {
    font-size: 1.3rem !important;
    gap: 12px !important;
  }

  .app-logo {
    height: 55px !important;
  }

  .bottom-nav button {
    font-size: 1.35rem !important;
  }

  .hadith-card,
  .Names-box,
  .dua-box,
  .quran-box {
    padding: 13px !important;
    margin: 10px 0 !important;
  }

  .categories-grid button {
    font-size: 18px !important;
    padding: 15px !important;
  }
}
