@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');

:root {
  --bg-color: #f5f5f5;
  --text-color: #333;
  --card-bg: #fff;
  --border-color: #ccc;
  --toggle-bg: #f0f0f0;
  --toggle-text: #333;
  --menu-text: #333;
  --footer-text: #666;
  --dot-bg: #ccc;
  --dot-active: #333;
  --back-button-bg: #f0f0f0;
  --back-button-text: #333;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #fff;
  --card-bg: #5e5e5e;
  --border-color: #444;
  --toggle-bg: #2d2d2d;
  --toggle-text: #fff;
  --menu-text: #fff;
  --footer-text: #aaa;
  --dot-bg: #444;
  --dot-active: #fff;
  --back-button-bg: var(--card-bg);
  --back-button-text: #fff;
}

html {
  height: 100%;
  width: 100%;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

.scrollable-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.scrollable-card .card-content {
  overflow-y: auto;
  padding-right: 5px;
  margin-right: -5px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100% - 50px); /* Account for heading */
}

.scrollable-card h2 {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  margin-top: 0;
  padding-top: 10px;
  padding-bottom: 10px;
  z-index: 1;
}

/* Scrollbar styling for webkit browsers */
.card-content::-webkit-scrollbar {
  width: 5px;
}

.card-content::-webkit-scrollbar-track {
  background: var(--card-bg);
}

.card-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.menu-button {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s, color 0.3s;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
  margin: 5px auto;
}

.menu-container {
  text-align: center;
  width: 90%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.menu-title {
  font-size: 2em;
  margin-bottom: 20px;
  color: var(--text-color);
}

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background-color: var(--back-button-bg);
  color: var(--back-button-text);
  cursor: pointer;
}

.back-button {
  background-color: var(--back-button-bg);
  color: var(--back-button-text);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s, color 0.3s;
}

.arabic-text {
  font-family: 'Amiri', serif !important;
  font-size: 31px !important;
  line-height: 2 !important;
  text-align: center !important;
  direction: rtl !important;
  margin: 20px 0 !important;
  padding: 10px !important;
  color: var(--text-color) !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  font-weight: 500 !important;
}

/* Counter styling */
:root {
  --completed-bg: #4CAF50;
  --completed-text: white;
  --button-bg: #f44336;
  --button-text: white;
  --border-color: #ddd;
}

[data-theme='dark'] {
  --completed-bg: #2D8A30;
  --completed-text: white;
  --button-bg: #d32f2f;
  --button-text: white;
  --border-color: #444;
}

/* Ensure circle styles are applied */
.circle.completed,
#circle-1.completed, #circle-2.completed, #circle-3.completed, 
#circle-4.completed, #circle-5.completed, #circle-6.completed, #circle-7.completed {
  background-color: var(--completed-bg) !important;
  color: var(--completed-text) !important;
  border-color: var(--completed-bg) !important;
  transition: all 0.2s ease;
}

/* English text styling to match duas.html */
.card p {
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 20px 0;
  color: var(--text-color);
  text-align: center;
}

.card p em {
  font-style: italic;
  display: block;
  margin: 10px 0;
}

* {
  transition: background-color 0.3s, color 0.3s;
}

/* Card styles for all pages */
.cards-wrapper {
  width: 100%;
  display: flex;
  overflow: hidden;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  padding-top: 60px; /* Reduced from 80px to position cards closer to the top */
  padding-bottom: 50px; /* Add bottom padding to prevent overlap with navigation dots */
  height: calc(100vh - 110px); /* Set fixed height to ensure it stays above nav dots */
}

.card-container {
  display: flex;
  transition: transform 0.3s ease;
  width: 100%;
  align-items: flex-start; /* Align cards to the top */
  height: 100%;
}

.card {
  width: 100%;
  min-width: 100%;
  max-width: 600px;
  padding: 15px;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  background: var(--card-bg);
  color: var(--text-color);
  text-align: center;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.card h2 {
  color: var(--text-color);
  font-family: sans-serif;
}

.card p {
  color: var(--text-color);
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* Image styles */
.card img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 10px 0;
}

/* Navigation dots */
.navigation-dots {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10; /* Ensure dots are always on top */
  background-color: var(--bg-color);
  padding: 5px 10px;
  border-radius: 15px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-bg);
  cursor: pointer;
}

.dot.active {
  background: var(--dot-active);
}

/* Counter styles */
.circle {
  border-color: var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
}