/* CSS Variables */
:root {
  --primary-color: #047857; /* Emerald Green */
  --secondary-color: #065f46; /* Darker Green */
  --accent-color: #d4af37; /* Gold */
  --bg-color: #f8f9fa; /* Off-white */
  --text-color: #1f2937; /* Dark Gray */
  --white: #ffffff;
  --font-ui: "Cairo", sans-serif;
  --font-quran: "Amiri", serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px; /* Reduced from 20px for small screens */
}

/* Header */
header {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo h1 {
  color: var(--primary-color);
  font-size: 1.8rem;
  font-weight: 700;
}

/* Desktop Nav */
nav ul {
  display: flex;
  gap: 20px;
}

nav a {
  color: var(--text-color);
  font-weight: 600;
  transition: color 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a:hover,
nav a.active {
  color: var(--primary-color);
}

/* Mobile Menu Toggle (Hidden on Desktop) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
}

/* Mobile Responsive Styles */
@media (max-width: 900px) {
  .menu-toggle {
    display: block;
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem;
    display: none; /* Hidden by default */
    border-top: 1px solid #eee;
  }

  nav.active {
    display: block;
    animation: slideDown 0.3s ease-out;
  }

  nav ul {
    flex-direction: column;
    gap: 15px;
  }

  nav a {
    padding: 10px;
    border-radius: 8px;
  }

  nav a:hover {
    background: #f8f9fa;
  }

  /* Mobile specific adjustments */
  .hero {
    padding: 3rem 0;
    border-radius: 0 0 30px 30px / 15px;
  }

  .hero h2 {
    font-size: 1.5rem;
  }

  .current-time {
    font-size: 2.2rem;
  }

  .page-header h2 {
    font-size: 1.8rem;
  }

  .surah-name,
  .zikr-text {
    font-size: 1.2rem;
  }

  .masbaha-btn {
    width: 160px;
    height: 160px;
    font-size: 3rem;
  }

  .quick-links {
    margin-top: 0; /* Reset margin on mobile */
    padding: 1rem 0;
  }

  .quick-links .links-grid {
    grid-template-columns: repeat(2, 1fr); /* 2x2 on mobile */
    gap: 10px;
  }

  .quick-link-card {
    padding: 1rem;
    font-size: 0.9rem;
  }

  .tabs-nav {
    gap: 0.5rem;
  }

  .tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    flex: 1 1 auto; /* Grow to fill space */
    justify-content: center;
  }

  /* Qibla Compass Mobile */
  @media (max-width: 350px) {
    .compass-container {
      width: 250px !important;
      height: 250px !important;
    }
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Quick Links Styles */
.quick-links {
  margin-top: -40px;
  position: relative;
  z-index: 10;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.quick-link-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  text-align: center;
  font-weight: bold;
  color: var(--text-color);
}

.quick-link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  color: var(--primary-color);
}

.icon-circle {
  width: 50px;
  height: 50px;
  background: rgba(4, 120, 87, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--primary-color);
  transition: background 0.3s;
}

.quick-link-card:hover .icon-circle {
  background: var(--primary-color);
  color: var(--white);
}

/* Hero Section */
.hero {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--white);
  text-align: center;
  padding: 4rem 0;
  border-radius: 0 0 50% 50% / 20px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero #next-prayer {
  font-size: 1.2rem;
  opacity: 0.9;
}

.current-time {
  font-size: 3rem;
  font-weight: 700;
  margin-top: 1rem;
  font-family: monospace; /* For fixed width numbers */
}

/* Prayer Times */
.prayer-times {
  padding: 2rem 0;
}

.prayer-times h3,
.daily-content h3 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--primary-color);
  font-size: 1.8rem;
  position: relative;
  display: inline-block;
  width: 100%;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s;
  border-top: 4px solid var(--accent-color);
}

.card:hover {
  transform: translateY(-5px);
}

.prayer-card h4 {
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.prayer-card span {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0.5rem 0;
}

.prayer-card i {
  color: var(--accent-color);
  font-size: 1.2rem;
}

/* Daily Content */
.daily-content {
  padding: 2rem 0;
  background-color: #fff8e1; /* Very light gold/yellow */
}

.quran-text {
  font-family: var(--font-quran);
  font-size: 1.8rem;
  line-height: 2;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.source {
  display: block;
  font-weight: 600;
  color: var(--accent-color);
}

/* Footer */
/* Quran Section */
.page-header {
  background: var(--bg-color);
  padding: 2rem 0;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2rem;
}

.page-header h2 {
  color: var(--primary-color);
  font-size: 2.5rem;
}

.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.surah-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid transparent;
}

.surah-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.surah-number {
  background: var(--bg-color);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.surah-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text-color);
}

.surah-english {
  font-size: 0.9rem;
  color: #6b7280;
}

/* Quran Reader */
.hidden {
  display: none !important;
}

#surah-reader {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-back {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: all 0.3s;
}

.btn-back:hover {
  background: var(--primary-color);
  color: var(--white);
}

#reader-title {
  text-align: center;
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
  font-family: var(--font-quran);
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20h200' stroke='%23047857' stroke-width='2' stroke-dasharray='5,5'/%3E%3C/svg%3E");
  background-position: center bottom;
  background-repeat: no-repeat;
  padding-bottom: 1rem;
}

.quran-text-block {
  font-family: var(--font-quran);
  font-size: 1.8rem;
  line-height: 2.2;
  text-align: center;
  direction: rtl;
  margin-bottom: 2rem;
}

.aya-container {
  display: inline;
}

.aya-end {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='20' cy='20' r='18' fill='none' stroke='%23d4af37' stroke-width='2'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  font-size: 0.8rem;
  color: var(--secondary-color);
  margin: 0 5px;
  vertical-align: middle;
}

.reader-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.nav-btn {
  background: var(--bg-color);
  color: var(--text-color);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

.nav-btn:hover {
  background: #e5e7eb;
}

.azkar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.zikr-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border-top: 5px solid var(--primary-color);
  position: relative;
  overflow: hidden;
}

.zikr-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.zikr-text {
  font-family: var(--font-quran);
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.8;
  color: var(--text-color);
}

.counter-area {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  justify-content: center;
}

.btn-count {
  flex-grow: 1;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-size: 1.2rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition:
    background 0.3s,
    transform 0.1s;
  display: flex;
  justify-content: center;
  align-items: center;
  direction: ltr; /* To keep numbers aligned 0 / 100 */
}

.btn-count:hover {
  background: var(--secondary-color);
}

.btn-count:active {
  transform: scale(0.98);
}

.btn-count.completed {
  background: var(--accent-color);
  cursor: default;
}

.btn-reset {
  background: #ef4444;
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.3s,
    transform 0.3s;
}

.btn-reset:hover {
  background: #dc2626;
  transform: rotate(180deg);
}

.btn-reset:active {
  transform: rotate(180deg) scale(0.9);
}

/* Azkar Tabs & Refined Design */
.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.8rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-btn i {
  font-size: 1.2rem;
}

.tab-btn:hover {
  background: rgba(4, 120, 87, 0.1);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: var(--primary-color);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(4, 120, 87, 0.4);
  transform: translateY(-2px);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Zikr Card Overrides */
.zikr-card {
  background: #ffffff;
  border: none;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  height: 100%;
  border-top: 6px solid var(--accent-color);
}

.zikr-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4af37' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  z-index: 0;
  pointer-events: none;
}

.zikr-text {
  position: relative;
  z-index: 1;
  font-size: 1.6rem;
  color: #2c3e50;
  margin-bottom: 2.5rem;
}

.counter-area {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.btn-count {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  box-shadow: 0 4px 10px rgba(4, 120, 87, 0.3);
}

/* Navigation Styles */
.navigation-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  background: white;
  padding: 15px;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
}

.nav-select,
.nav-input {
  padding: 10px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 25px;
  font-size: 0.95rem;
  font-family: var(--font-ui);
  outline: none;
}

.nav-select {
  min-width: 150px;
  flex-grow: 1;
}

.nav-input {
  width: 100px;
  text-align: center;
}

.nav-btn-go {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: 8px;
  transition:
    background 0.3s,
    transform 0.1s;
}

.nav-btn-go:hover {
  background: var(--secondary-color);
}

/* Ramadan Theme Elements */
:root {
  --ramadan-gold: #ffd700;
  --ramadan-green: #047857;
  --ramadan-dark: #022c22;
}

body {
  background-color: #fdfbf7;
  /* Subtle Islamic Pattern Background */
  background-image:
    radial-gradient(#047857 0.5px, transparent 0.5px),
    radial-gradient(#047857 0.5px, #fdfbf7 0.5px);
  background-size: 20px 20px;
  background-position:
    0 0,
    10px 10px;
}

/* Lantern (Fanoos) Decorations */
.ramadan-decoration {
  position: absolute;
  top: 0;
  z-index: 100; /* Behind header but visible */
  pointer-events: none;
  width: 60px;
  animation: swing 3s infinite ease-in-out alternate;
  transform-origin: top center;
  opacity: 0.8;
}

.fanoos-left {
  left: 5%;
  animation-duration: 3.5s;
}

.fanoos-right {
  right: 5%;
  width: 80px;
  animation-duration: 4s;
}

@keyframes swing {
  from {
    transform: rotate(-5deg);
  }
  to {
    transform: rotate(5deg);
  }
}

/* Radio Specific Styles */
.station-card.active {
  background: linear-gradient(135deg, #f0fdf4, #fffbeb);
  border-color: var(--ramadan-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.player-container {
  background: linear-gradient(to bottom, #ffffff, #fcfcfc);
  border: 1px solid #fabd00;
}

.player-container.playing {
  border-color: var(--ramadan-green);
  box-shadow: 0 0 20px rgba(4, 120, 87, 0.15);
}

.visualizer .bar {
  background: linear-gradient(
    to top,
    var(--ramadan-green),
    var(--ramadan-gold)
  );
}

.schedule-header {
  color: var(--ramadan-dark);
  border-bottom: 2px solid var(--ramadan-gold);
}

.schedule-item.current-program {
  background: rgba(255, 215, 0, 0.1);
  border-right-color: var(--ramadan-gold);
}

.status-badge {
  background: #f3f4f6;
  transition: all 0.3s;
}

.current-program .status-badge {
  background: var(--ramadan-gold) !important;
  color: var(--ramadan-dark) !important;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Live Badge Pulse */
@keyframes pulse-red {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

#live-badge {
  animation: pulse-red 2s infinite;
  background: #dc2626 !important;
}

.nav-btn-go:active {
  transform: scale(0.95);
}

@media (max-width: 600px) {
  .navigation-bar {
    border-radius: 20px;
    flex-direction: column;
    gap: 15px;
  }

  .nav-select,
  .nav-input,
  .nav-btn-go {
    width: 100%;
    min-width: 0;
  }
}

/* Masbaha Styles */
.masbaha-section {
  padding: 4rem 0;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.masbaha-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.masbaha-display {
  text-align: center;
  background: white;
  padding: 1rem 3rem;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  min-width: 250px;
}

#masbaha-count {
  display: block;
  font-size: 4rem;
  font-weight: 700;
  font-family: monospace;
  color: var(--primary-color);
  line-height: 1;
}

.target-label {
  color: #666;
  font-size: 0.9rem;
}

.masbaha-btn {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(
    145deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  font-size: 4rem;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(4, 120, 87, 0.4);
  transition:
    transform 0.1s,
    box-shadow 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.masbaha-btn:active,
.masbaha-btn.clicked {
  transform: scale(0.95);
  box-shadow: 0 5px 15px rgba(4, 120, 87, 0.3);
}

.masbaha-btn.target-reached {
  background: var(--accent-color);
  animation: pulse 0.5s;
}

.masbaha-controls {
  display: flex;
  gap: 15px;
}

.control-btn {
  background: white;
  border: 1px solid #ddd;
  color: var(--text-color);
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  transition: all 0.2s;
}

/* Generator Styles */

.generator-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .generator-grid {
    grid-template-columns: 1fr;
  }
}

.controls-card,
.preview-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.controls-card h3,
.preview-card h3 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  border-bottom: 2px solid #eee;
  padding-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #4b5563;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 1rem;
}

.bg-options {
  display: flex;
  gap: 10px;
}

.bg-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s;
}

.bg-option.active {
  border-color: var(--text-color);
  transform: scale(1.1);
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn {
  background: white;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}

.nav-btn:hover {
  background: #f0fdf4;
}

.nav-btn.primary {
  background: var(--primary-color);
  color: white;
}

.nav-btn.primary:hover {
  background: var(--secondary-color);
}

/* Quick Links */
.links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Quran Flipbook Styles */
.flipbook-viewport {
  width: 100%;
  height: 600px; /* Adjust based on screen */
  overflow: hidden;
  position: relative;
  background: #f8f9fa; /* Match bg-color */
  display: flex;
  justify-content: center;
  align-items: center;
}

.flipbook {
  width: 800px; /* Double page width */
  height: 566px; /* A4 Ratio approx for images */
  margin: 0 auto;
  transition: margin-left 0.2s;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.flipbook .page {
  width: 400px; /* Single page width */
  height: 566px;
  background-color: white;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1); /* Inner shadow for depth */
}

.flipbook .page-wrapper {
  -webkit-perspective: 2000px;
  -moz-perspective: 2000px;
  -ms-perspective: 2000px;
  -o-perspective: 2000px;
  perspective: 2000px;
}

/* Controls */
.flipbook-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #fff;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

#page-indicator {
  font-weight: bold;
  min-width: 50px;
  text-align: center;
}

/* Mobile Responsiveness for Flipbook */
@media (max-width: 850px) {
  .flipbook-viewport {
    height: auto;
    min-height: 500px;
    overflow: visible; /* Allow scrolling if needed */
  }

  .flipbook {
    width: 100% !important; /* Single page view on mobile usually better, but turn.js handles scaling */
    height: auto !important;
    /* For turn.js single page mode */
    max-width: 400px;
  }

  .flipbook .page {
    width: 100% !important;
    height: 100% !important;
  }
}

.quick-link-card {
  background: white;
  padding: 1.5rem;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.quick-link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(4, 120, 87, 0.15);
}

.icon-circle {
  width: 60px;
  height: 60px;
  background: #f0fdf4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-color);
  transition:
    background 0.3s,
    color 0.3s;
}

.quick-link-card:hover .icon-circle {
  background: var(--primary-color);
  color: white;
}

.quick-link-card span {
  font-weight: 700;
  color: var(--text-color);
}

/* Offline Overlay */
#offline-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 9999;
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

#offline-overlay.active {
  display: flex; /* Visible when active (offline) */
}

.offline-content {
  text-align: center;
  padding: 2rem;
  max-width: 400px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #eee;
}

.offline-icon {
  font-size: 4rem;
  color: #ef4444;
  margin-bottom: 1rem;
}

.offline-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.offline-text {
  color: #666;
  margin-bottom: 1.5rem;
}

.btn-retry {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 50px;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s;
}

.btn-retry:hover {
  background: var(--secondary-color);
}

/* Quiz Styles */
.quiz-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
  font-weight: bold;
}

.score-box,
.lives-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
}

.lives-box i {
  color: #ef4444;
}

.progress-bar-container {
  background: #e5e7eb;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-bar {
  height: 100%;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.question-card {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.question-card h3 {
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}

.option-btn {
  background: #f8f9fa;
  border: 2px solid #e5e7eb;
  padding: 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 1.1rem;
  transition: all 0.2s;
  color: var(--text-color);
}

.option-btn:hover:not(:disabled) {
  background: #f0fdf4;
  border-color: var(--primary-color);
}

.option-btn.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #14532d;
}

.option-btn.wrong {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #7f1d1d;
}

.result-card {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.result-card h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 2rem;
}

.final-score span {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--accent-color);
  display: block;
  margin: 10px 0;
}

/* Leaderboard Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.close-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #666;
}

.leaderboard-table th,
.leaderboard-table td {
  border-bottom: 1px solid #eee;
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}
