/* ===== Quote Section ===== */
.quote-card {
  position: relative;
  padding: 2rem;
  margin-bottom: 2rem;
  overflow: hidden;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-size: 200% 200%;
  background-attachment: fixed;
  animation: gradientBG 15s ease infinite;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  margin: 1.5rem 0;
  padding: 0 1rem;
}

.progress-container.bottom-progress {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  display: block;
  background: var(--card-bg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.6s ease, background-color 0.3s ease;
  width: 0%;
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(-45deg,
      rgba(255, 255, 255, 0.15) 25%,
      transparent 25%,
      transparent 50%,
      rgba(255, 255, 255, 0.15) 50%,
      rgba(255, 255, 255, 0.15) 75%,
      transparent 75%,
      transparent);
  background-size: 0.75rem 0.75rem;
}

/* For browsers that don't support progress element */
progress.progress-bar {
  background: var(--bg, #2d2d2d);
  /* Use theme's background variable */
  border-radius: 4px;
  height: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
}

progress.progress-bar::-webkit-progress-bar {
  background: var(--bg, #2d2d2d);
  /* Use theme's background variable */
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
}

.progress-bar {
  background-color: var(--bg, #2d2d2d) !important;
  /* Use theme's background variable */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
}

progress.progress-bar::-webkit-progress-value {
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
  background-image: linear-gradient(-45deg,
      rgba(255, 255, 255, 0.15) 25%,
      transparent 25%,
      transparent 50%,
      rgba(255, 255, 255, 0.15) 50%,
      rgba(255, 255, 255, 0.15) 75%,
      transparent 75%,
      transparent);
  background-size: 0.75rem 0.75rem;
}

progress.progress-bar::-moz-progress-bar {
  background: var(--accent);
  border-radius: 4px;
}

.progress-text {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Top Navigation */
.top-nav {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0.5rem 0;
}

.nav-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--text-light);
  padding: 0.5rem 1.5rem;
  margin: 0 0.25rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.nav-btn.active {
  background: var(--accent);
  color: #000 !important;
  font-weight: 600;
  text-shadow: none;
  -webkit-text-fill-color: #000;
  -webkit-text-stroke-width: 0;
}

.nav-btn:not(.active):hover {
  background: #FFFFFF1A;
}

/* Remove all hover/transition effects from the quote section except reference */

.quote-section-title {
  color: var(--accent);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  padding-bottom: 0.5rem;
}

.quote-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* Removed top border animation */

/* No hover effects on the card itself */

.quote-content {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 1.5rem;
}

.quote-text-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.quote-text {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-light);
  font-style: italic;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 2;
  transition: none !important;
}

.quote-content {
  transition: none !important;
}

.quote-text-container {
  transition: none !important;
}

.quote-card:hover,
.quote-card:active,
.quote-content:hover,
.quote-text-container:hover,
.quote-text:hover {
  /* Remove all hover effects */
  box-shadow: none !important;
  border-color: var(--border-color) !important;
  background: var(--card-bg) !important;
  color: var(--text-light) !important;
  transform: none !important;
  text-shadow: none !important;
}


.quote-ref {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.5rem;
  opacity: 0.9;
  transition: color 0.3s ease;
  display: inline-block;
  position: relative;
  z-index: 2;
}

.quote-ref:hover {
  color: var(--accent);
  opacity: 1;
}

.quote-ref::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}

.quote-ref:hover::after {
  width: 100%;
}


.quote-decoration {
  position: absolute;
  font-size: 8rem;
  opacity: 0.1;
  color: var(--accent);
  font-family: Georgia, serif;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  top: 0.5rem;
  display: none;
  /* Hide by default */
}

/* Only show the decorations we want */
.quote-decoration--left,
.quote-decoration--right {
  display: block;
  /* Show only these specific decorations */
}

.quote-decoration--left {
  left: 1.5rem;
  top: 0.5rem;
  position: absolute;
  transform: none;
}

.quote-decoration--right {
  right: 1.5rem;
  top: 0.5rem;
  position: absolute;
  transform: none;
}

.quote-decoration--right {
  right: 1.5rem;
  transform: none;
}

/* Hide any other quote decorations that might be created */
.quote-card .quote-decoration:not(.quote-decoration--left):not(.quote-decoration--right) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Remove browser default focus rings and outlines */
.quote-card:focus,
.quote-card:focus-within,
.quote-card:focus-visible,
.quote-card *:focus,
.quote-card *:focus-within,
.quote-card *:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* For Webkit browsers */
.quote-card {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* For Firefox */
.quote-card::-moz-focus-inner {
  border: 0;
}

/* New Quote Button - Simplified to avoid conflicts */
.btn-quote {
  background: var(--accent);
  border: none;
  border-radius: 50px;
  color: white;
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7rem 1.75rem;
  position: relative;
  transition: all 0.2s ease;
  z-index: 1;
  overflow: hidden;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

/* Remove focus outline for all browsers */
.btn-quote:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* For Firefox */
.btn-quote::-moz-focus-inner {
  border: 0 !important;
}

/* For Webkit/Blink browsers */
.btn-quote::-webkit-focus-outer,
.btn-quote::-webkit-focus-inner {
  border: 0 !important;
  outline: none !important;
}

/* Hover effects removed as per user request */
.btn-quote:active {
  transform: scale(0.98);
}

/* Reset all possible outline styles */
.btn-quote,
.btn-quote:focus,
.btn-quote:focus-visible,
.btn-quote:focus-within,
.btn-quote:active,
.btn-quote:visited,
.btn-quote:hover,
.btn-quote:-moz-focusring,
.btn-quote::-moz-focus-inner,
.btn-quote::-moz-focus-outer,
.btn-quote:-moz-focusring {
  outline: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-focus-ring-color: transparent !important;
  -moz-outline: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  border: none !important;
  background-clip: padding-box !important;
  -webkit-backface-visibility: hidden !important;
  backface-visibility: hidden !important;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Specific focus states */
:focus {
  outline: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px !important;
  border-radius: 4px !important;
}

:focus:not(:focus-visible) {
  outline: none !important;
}

/* For Firefox */
@-moz-document url-prefix() {
  .btn-quote {
    outline: 0 !important;
  }
}

/* For WebKit/Blink */
@media (-webkit-min-device-pixel-ratio: 0) {
  .btn-quote {
    outline: 0 !important;
  }
}

/* Button icon animation */
.btn-icon.spin {
  animation: spin 0.5s ease;
  pointer-events: none;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.btn-icon {
  font-size: 1rem;
  display: inline-block;
  transition: opacity 0.2s ease;
}

/* Disabled button state */
.btn-quote:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-quote:disabled .btn-icon {
  opacity: 0.7;
}

/* ===== Theme System ===== */
:root {
  /* Base theme variables (fallback) */
  --bg: #1a1a2e;
  --fg: #ffffff;
  --card-bg: #16213e;
  --card-shadow: 0 8px 32px #0000004D;
  --accent: #FF8C66;
  --accent-hover: #FFA07A;
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Prayer status colors */
  --color-on-time: #4CAF50;
  --color-late: #FFC107;
  --color-qaza: #F44336;
  --color-not-done: #2a3044;
  --color-period: #9C27B0;

  /* Theme-specific variables */
  --header-bg: transparent;
  --section-bg: #16213EB3;
  --border-color: #FFFFFF1A;
  --text-muted: #FFFFFFB3;
  --text-light: #FFFFFFE6;
  --shadow-sm: 0 2px 8px #0000001A;
  --shadow-md: 0 4px 12px #00000026;
  --shadow-lg: 0 8px 24px #00000033;

  /* typography */
  --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base Styles */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--fg);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
  color: #FFFFFFCC;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
}

/* Main content container */
#app {
  max-width: 90%;
  margin: 0 auto;
  padding: 0 5%;
}

/* Theme: Peach */
.theme-peach {
  --bg: #2a1a2c;
  --fg: #ffffff;
  --card-bg: #3A1D3E99;
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  --accent: #ff8a5c;
  --accent-hover: #ff9e7d;
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* prayer status variables */
  --color-on-time: #ff8a5c;
  --color-late: #ff6b4a;
  --color-qaza: #ffd3b6;
  --color-not-done: #FFFFFF1A;
  --color-period: #ffb8b8;
}

/* Theme Switcher */
.theme-switcher {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  max-width: 320px;
  width: 90%;
  max-width: 320px;
  box-sizing: border-box;
}

.theme-switcher h3 {
  text-align: left;
  margin: 0 0 1rem 0;
  color: var(--text-light);
  font-size: 1.1rem;
  padding: 0 0.5rem;
}

.theme-switcher h3 {
  margin: 0 0 1rem 0;
  color: var(--text-light);
  font-size: 1.1rem;
  text-align: center;
}

.theme-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.theme-preview {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 0.5rem;
  border: 2px solid var(--border-color);
}

.theme-preview.peach {
  background-color: #FF8C66;
}

.theme-preview.pink {
  background-color: #FF6B95;
}

.theme-preview.blue {
  background-color: #4CC9F0;
}

.theme-preview.green {
  background-color: #4CAF50;
}

.theme-preview.lavender {
  background-color: #9C89B8;
}

/* Remove scroll indicators */
.scroll-indicator {
  display: none !important;
}

header {
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.header-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, #ff8a5c, #ffb8b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: fadeIn 0.6s ease-out;
}

.header-subtitle {
  font-size: 1.1rem;
  color: #FFFFFFCC;
  font-weight: 400;
  text-align: center;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0;
}

main {
  flex: 1;
  padding: var(--spacing-lg) 0;
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.main-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

footer {
  text-align: center;
  padding: var(--spacing-lg) 0;
  background: var(--bg);
  margin-top: auto;
  width: 100%;
  border-top: 1px solid var(--border-color);
}

/* Card Styles */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  background-size: 200% 200%;
  background-attachment: fixed;
  animation: gradientBG 15s ease infinite;
}

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

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color);
}


.card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

/* Buttons */
.theme-btn {
  background: #FFFFFF0D;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  color: #FFFFFFCC;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: none;
  box-shadow: 0 4px 15px #0000001A;
  min-width: 100px;
  /* Ensure minimum width for better touch targets */
  white-space: nowrap;
  /* Prevent text wrapping */
}

/* Make theme buttons stack on smaller screens (matches legend container breakpoint) */
@media (max-width: 780px) {
  .theme-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .theme-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    gap: 0.4rem;
  }

  .theme-preview {
    width: 14px;
    height: 14px;
  }
}

.btn {
  background: var(--accent);
  color: var(--text-light);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(#FFFFFF1A, transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-icon {
  margin-right: 0.5rem;
}

/* ===== Base Elements ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Smooth theme transitions */
body.theme-transition * {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Page load animation */
body.loaded #app {
  animation: fadeIn 0.6s ease-out;
}

/* Prayer name in table headers */
.prayer-name {
  display: inline-block;
  margin-left: 0.3rem;
  vertical-align: middle;
}

/* Loading overlay */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease-out;
}

.loader-spinner {
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.spinner-circle {
  width: 50px;
  height: 50px;
  margin: 0 auto 1rem;
  border: 3px solid #FFFFFF1A;
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
}

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

.spinner-text {
  color: #FFFFFFB3;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

/* Ripple effect for buttons */
.ripple {
  position: absolute;
  border-radius: 50%;
  background-color: #FFFFFF4D;
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Confetti animation */
@keyframes confetti-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #f00;
  opacity: 0;
  animation: confetti-fall 3s ease-in-out forwards;
}

/* Hover effect for table rows */
tr {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px #0000001A;
}

/* Pulse animation for today's row */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 #FF6B95B3;
  }

  70% {
    box-shadow: 0 0 0 10px #FF6B9500;
  }

  100% {
    box-shadow: 0 0 0 0 #FF6B9500;
  }
}

.today {
  position: relative;
  background: #FFFFFF08 !important;
  border-left: 3px solid var(--accent);
}

.today::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #FF6B951A, transparent);
  pointer-events: none;
  z-index: -1;
  animation: pulse-glow 2s infinite;
  border-radius: 8px;
}

/* Table header styles */
.table-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

@media (min-width: 768px) {
  .table-header {
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-lg);
  }

  .table-header h2 {
    margin: 0;
    white-space: nowrap;
  }

  .legend-container {
    margin: 0;
    flex: 1;
    display: flex;
    justify-content: flex-start;
    gap: var(--spacing-md);
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .legend-item {
    white-space: nowrap;
  }
}

.table-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
}

.legend-container {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: var(--spacing-sm);
}

@media (min-width: 768px) {
  .legend-container {
    justify-content: flex-end;
    margin-top: 0;
  }
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  background: var(--card-bg);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.legend-icon {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF1A;
  font-size: 16px;
  /* Changed from 0.8rem */
  font-weight: normal;
  /* Changed from bold */
}

.legend-item[data-status="on-time"] .legend-icon {
  background-color: var(--color-on-time);
  color: black;
  /* Changed from white */
}

.legend-item[data-status="late"] .legend-icon {
  background-color: var(--color-late);
  color: #000;
}

.legend-item[data-status="qaza"] .legend-icon {
  background-color: var(--color-qaza);
  color: white;
}

.legend-item[data-status="period"] .legend-icon {
  background-color: var(--color-period);
  color: white;
}

/* Prayer status tooltips */
.status-circle {
  position: relative;
}

.status-circle::after {
  content: attr(data-status-text);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background: #000000CC;
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.status-circle:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-10px);
}

/* Status text for tooltips */
.status-not-done::after {
  content: 'Not Done';
}

.status-on-time::after {
  content: 'On Time';
}

.status-late::after {
  content: 'A Bit Late';
}

.status-qaza::after {
  content: 'Qaza';
}

.status-period::after {
  content: 'Period';
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== Layout ===== */
.container {
  width: min(95%, 1000px);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, #FF6B951A 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, #6B6BFF1A 0%, transparent 50%),
    var(--bg);
  z-index: -1;
  pointer-events: none;
}

/* ===== Header ===== */
header {
  background: var(--bg);
  padding: var(--spacing-lg) var(--spacing-md);
  position: relative;
  overflow: hidden;
  width: 100%;
  box-shadow: 0 2px 10px #0000001A;
  margin-bottom: 0;
}

.sticky-header {
  position: relative;
  background: var(--header-bg);
  z-index: 1000;
  box-shadow: 0 2px 10px #0000001A;
  padding: 0.5rem 0;
  width: 100%;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #ff8e53);
  border-radius: 2px;
}

h1 {
  margin: 0;
  font-size: 2.75rem;
  font-weight: 700;
  background: linear-gradient(45deg, #fff 0%, #d1d5db 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--spacing-xs);
  letter-spacing: -0.5px;
  animation: fadeInUp 0.6s ease-out;
}

.subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: #FFFFFFCC;
  margin-top: 0;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.storage-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--spacing-md);
  font-size: 0.8rem;
  font-weight: 500;
  background: #FFC10726;
  color: #ffc107;
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
  backdrop-filter: blur(5px);
  border: 1px solid #FFC1071A;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

.storage-note::before {
  content: '';
  font-size: 1rem;
}

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  margin-bottom: var(--spacing-md);
  animation: fadeIn 0.6s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color);
}

/* ===== Quote Section ===== */
#quote-section {
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  transform: translateY(10px);
  opacity: 0;
  animation: fadeIn 0.6s ease-out 0.3s forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Animate quote change */
.quote-text {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.quote-text.fade-out {
  opacity: 0;
  transform: translateY(-5px);
}

.quote-text.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Loading state for quote refresh */
#quote-section.loading .quote-text,
#quote-section.loading .quote-ref {
  opacity: 0.6;
  position: relative;
}

#quote-section.loading .quote-text::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateY(10px);
  opacity: 0.5;
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0% {
    opacity: 0.3;
    transform: translateY(10px) scaleX(0.8);
  }

  50% {
    opacity: 0.8;
    transform: translateY(10px) scaleX(1);
  }

  100% {
    opacity: 0.3;
    transform: translateY(10px) scaleX(0.8);
  }
}



#quote-section h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--spacing-md);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

#quote-section h2 .icon {
  font-size: 1.2em;
}

.quote-text {
  position: relative;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.7;
  margin: var(--spacing-md) 0;
  padding: 0 var(--spacing-sm);
  transition: var(--transition);
  animation: fadeIn 0.6s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.quote-ref {
  display: block;
  font-size: 0.9rem;
  color: var(--accent);
  text-align: right;
  margin-top: var(--spacing-sm);
  font-style: normal;
  font-weight: 300;
  transition: var(--transition);
}

/* ===== Buttons ===== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: var(--spacing-sm) auto 0;
  padding: 0.7rem 1.75rem;
  background: var(--accent);
  border: none;
  border-radius: 50px;
  color: white;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px #FF6B954D;
  z-index: 1;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

.btn:hover {
  background: var(--accent-hover, #ff6b95);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px #FF6B9566;
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px #FF6B954D;
}

/* Ripple effect - disabled for now as it was causing issues */
/* .btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(circle, #FFFFFFCC 10%, transparent 10.01%) no-repeat 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 1s;
  pointer-events: none;
  border-radius: 50px;
  overflow: hidden;
}

.btn:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
} */

/* ===== Table ===== */
/* Center status-circle icons in tracker-table cells */
#tracker-table td {
  text-align: center;
  /* horizontal centering */
  vertical-align: middle;
  /* vertical centering within the cell */
}

#tracker-table td .status-circle {
  margin: 0 auto;
  /* ensure icon sits in the middle horizontally */
}

/* Header Layout */
.sticky-header {
  padding: 0.5rem 0;
  background: var(--header-bg);
  position: relative;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
  position: relative;
}

.header-title {
  grid-column: 2;
  justify-self: center;
  margin: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.header-subtitle {
  text-align: center;
  margin: 0.25rem 0 0;
  color: var(--fg, #ffffff);
  opacity: 0.8;
  font-size: 0.9rem;
  padding: 0 1rem;
}

.auth-buttons {
  grid-column: 3;
  justify-self: end;
  margin-left: auto;
}

/* Authentication Modal */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.auth-modal.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.auth-modal-content {
  background: var(--card-bg, #1a1a1a) !important;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid var(--border-color, #333) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  color: var(--fg, #ffffff) !important;
  background-color: var(--card-bg, #1a1a1a) !important;
}

.auth-modal-content * {
  color: inherit !important;
}

.auth-modal-content[style*="background"] {
  background: var(--card-bg, #1a1a1a) !important;
}

.auth-modal-content[style*="color"] {
  color: var(--fg, #ffffff) !important;
}

/* Auth form elements */
.auth-form {
  margin-top: 1rem;
}

.auth-form h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--fg, #ffffff);
  text-align: center;
}

.auth-form-group {
  margin-bottom: 1.25rem;
}

.auth-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--fg, #ffffff);
  font-weight: 500;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
  background-color: var(--input-bg, #2a2a2a);
  color: var(--fg, #ffffff);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent, #4CAF50);
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* Auth buttons */
.auth-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  margin-top: 1rem;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Auth tabs */
.auth-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color, #444);
  padding-bottom: 0.5rem;
}

.auth-tab-btn {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  cursor: pointer;
  color: var(--fg, #ffffff);
  opacity: 0.7;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  transition: all 0.2s ease;
  border-bottom: none !important;
  box-shadow: none !important;
}

.auth-tab-btn:hover {
  opacity: 0.9;
  color: var(--accent, #4CAF50);
  background-color: transparent;
}

.auth-tab-btn.auth-active {
  opacity: 1;
  color: var(--accent, #4CAF50);
  font-weight: 600;
  transform: translateY(-1px);
  border-bottom: none !important;
  box-shadow: none !important;
  background-color: transparent;
}

/* Close button */
.auth-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--fg, #ffffff);
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
}

.auth-close-btn:hover {
  opacity: 1;
  background-color: var(--hover-bg, rgba(255, 255, 255, 0.1));
}

/* Auth Forms */
.auth-form {
  padding: 0.5rem 0;
}

.auth-form h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--fg);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

.auth-form-group {
  margin-bottom: 1.25rem;
}

.auth-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 500;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--input-bg, var(--card-bg));
  color: var(--fg);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.auth-text-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-top: 0.5rem;
  display: inline-block;
  text-align: left;
  transition: opacity 0.2s ease;
}

.auth-text-btn:hover {
  opacity: 0.9;
  text-decoration: underline;
}

/* Base auth button styles are defined above */

.auth-btn-primary {
  background-color: var(--accent) !important;
  color: white !important;
  opacity: 0.9;
  transform: translateY(-1px);
  border: none !important;
  box-shadow: none !important;
}

.auth-btn-primary:hover {
  background-color: var(--accent-hover) !important;
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .auth-modal-content {
    max-width: 90%;
    padding: 1.25rem;
  }

  .auth-tabs {
    justify-content: space-between;
  }

  .auth-tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    margin-right: 0;
    flex: 1;
    text-align: center;
  }
}

/* Account Button */
.account-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--fg, #ffffff);
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 10;
}

.account-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.account-btn:active {
  transform: scale(0.95);
}

.account-icon {
  width: 24px;
  height: 24px;
  color: inherit;
}

/* Auth Buttons Container */
.auth-buttons {
  position: relative;
  margin-left: auto;
}

/* User Menu */
.user-menu {
  position: relative;
  display: inline-block;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--fg, #ffffff);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  transition: background-color 0.2s ease;
}

.user-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background-color: var(--accent, #4a90e2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 0.9rem;
}

.user-email {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--card-bg, #2d2d2d);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
}

.user-menu:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  background: none;
  border: none;
  color: var(--fg, #ffffff);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Make sure the header has proper spacing */
.sticky-header {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

.table-header {
  opacity: 0;
  animation: fadeIn 0.6s ease-out 0.4s forwards;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  padding: 1.5rem 1.5rem 1rem;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  background: var(--card-bg);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  border-bottom: 1px solid var(--border-color);
}

/* Main table container */
.table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--border-radius);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

#quote-section {
  position: relative;
  padding: 1.5rem;
  margin: 0 1rem 2rem;
  border-radius: var(--border-radius);
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.quote-content {
  width: 100%;
  margin-bottom: 1rem;
  min-height: 120px;
  /* Ensure enough space for the quote */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease-in-out;
}

.quote-text {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease-in-out;
}

.quote-ref {
  font-style: italic;
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.3s ease-in-out;
  margin-top: 0.5rem;
}

.btn-quote {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  width: auto;
  min-width: 160px;
  box-shadow: none;
  z-index: 1;
  white-space: nowrap;
  /* Prevent text wrapping */
  overflow: hidden;
  /* Ensures the pseudo-element stays within border-radius */
  position: relative;
}

.btn-quote::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50px;
  background: var(--accent);
  z-index: -1;
  opacity: 0.4;
  filter: blur(8px);
  transform: scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.btn-quote:active::before {
  transform: scale(0.95);
  opacity: 0.3;
}

/* Ensure button text is always visible */
.btn-text {
  display: inline-block !important;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  clip-path: none !important;
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Hover effects removed as per user request */
.btn-quote:active {
  transform: scale(0.98);
}

.btn-icon {
  margin-right: 0.5rem;
  font-size: 1rem;
}

.btn-text {
  font-size: 0.9rem;
}

/* Ensure table has a minimum width to prevent content from being too squished */
#tracker-table {
  min-width: 600px;
  /* Minimum width before scrolling starts */
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--card-bg);
  padding: 0 0.5rem;
  box-sizing: border-box;
  border-radius: var(--border-radius);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .table-container {
    margin: 0 -1rem;
    width: calc(100% + 2rem);
    border-radius: 0;
    box-shadow: none;
  }

  #tracker-table {
    min-width: 100%;
    padding: 0 1rem;
  }

  /* Adjust cell padding for mobile */
  #tracker-table td,
  #tracker-table th {
    padding: 0.5rem 0.25rem;
    font-size: 0.9em;
  }

  /* Make the first column (day numbers) slightly wider for better touch targets */
  #tracker-table td:first-child {
    width: 50px;
    min-width: 50px;
  }

  /* Adjust prayer header icons */
  .prayer-header .prayer-icon {
    font-size: 1.1em;
  }

  .prayer-header .prayer-name {
    font-size: 0.7em;
  }
}

#tracker-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  background: var(--card-bg);
  padding: 1.5rem;
  box-sizing: border-box;
  border-radius: var(--border-radius);
}

thead th {
  text-align: center;
  padding: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  min-width: 0;
  width: auto;
  vertical-align: middle;
  box-sizing: border-box;
}

/* First column (day number) */
thead th:first-child {
  min-width: 60px;
  width: 60px;
  text-align: center;
  padding: 0.5rem;
  box-sizing: border-box;
}

.prayer-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 1.1rem;
  height: 100%;
  padding: 0.5rem 0;
  box-sizing: border-box;
}

.prayer-header .prayer-name {
  font-size: 0.75rem;
  opacity: 0.8;
  font-weight: 500;
}

#tracker-table tbody tr {
  background: #FFFFFF08;
  border-radius: 8px;
  transition: all 0.2s ease;
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
  border: 1px solid #FFFFFF0D;
  height: 60px;
  position: relative;
}

#tracker-table tbody tr:hover {
  background: #FFFFFF0D;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px #00000033;
}

#tracker-table td {
  padding: 0.5rem;
  text-align: center;
  vertical-align: middle;
}

/* Table cells */
#tracker-table td {
  padding: 0.75rem 0.5rem;
  text-align: center;
  vertical-align: middle;
  position: relative;
  border-bottom: 1px solid #FFFFFF0D;
  line-height: 1;
  height: 60px;
  box-sizing: border-box;
}

/* First column (day numbers) */
#tracker-table td:first-child {
  font-weight: 500;
  color: var(--text-secondary);
  width: 40px;
  /* Reduced from 60px */
  min-width: 40px;
  /* Reduced from 60px */
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  /* Center the day number */
}

/* Today's date cell */
#tracker-table tr.today td:first-child {
  position: relative;
  z-index: 1;
  color: white;
  font-weight: 600;
}

#tracker-table tr.today td:first-child::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.9;
  aspect-ratio: 1 / 1;
  /* Ensure perfect circle */
}

/* Remove any leftover border accent */
#tracker-table td:first-child::after {
  display: none;
}

#tracker-table tr:hover td:first-child::after {
  height: 80%;
  opacity: 1;
}

/* ===== Table Card ===== */
.table-card {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem;
  box-sizing: border-box;
}

/* ===== Table Container ===== */
.table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#tracker-table {
  width: 100%;
  min-width: 100%;
  /* Ensure table always fills container */
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

/* Force header and body sections to span the full table width */
#tracker-table thead,
#tracker-table tbody {
  width: 100%;
}

/* Center header cells */
#tracker-table thead th {
  text-align: center;
}

/* Mobile Responsive Styles */
@media (max-width: 780px) {
  #quote-section {
    margin: 0 0.5rem 1.5rem;
    padding: 1.25rem;
  }

  .quote-content {
    min-height: 100px;
  }

  .quote-text {
    font-size: 1rem;
    line-height: 1.5;
  }

  .btn-quote {
    width: auto;
    min-width: 200px;
    padding: 0.75rem 1.5rem;
    margin: 0.5rem auto 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }

  .btn-icon {
    display: inline-flex !important;
    margin-right: 0.5rem !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
  }

  .btn-text {
    display: inline-block !important;
    font-size: 0.95rem;
    position: static !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    clip-path: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 1 !important;
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .legend-container {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.75rem;
  }

  .legend-item {
    font-size: 0.85rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .legend-container {
    gap: 0.5rem;
  }

  .legend-item {
    font-size: 0.8rem;
  }

  .legend-icon {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }

  .btn-quote {
    font-size: 0.95rem;
  }

  .btn-icon {
    margin-right: 0.4rem;
  }

  .btn-text {
    font-size: 0.85rem;
  }

  #tracker-table {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
    font-size: 0.85rem;
    margin: 0;
    padding: 0;
  }

  /* Adjust column widths */
  #tracker-table th:first-child,
  #tracker-table td:first-child {
    width: 12%;
    min-width: 40px;
    padding: 0 2px;
  }

  #tracker-table th:not(:first-child),
  #tracker-table td:not(:first-child) {
    width: 17.6%;
    /* (100% - 12%) / 5 */
    min-width: 0;
    padding: 0 2px;
  }

  /* Show prayer names in small text below icons on mobile */
  .prayer-name {
    display: block;
    font-size: 0.6rem;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Adjust header cell height to accommodate the text */
  #tracker-table th {
    height: 50px;
    vertical-align: bottom;
    padding-bottom: 4px;
  }

  /* Specifically target the first th (Day header) for perfect vertical centering */
  #tracker-table thead th:first-child {
    vertical-align: middle;
    padding-bottom: 0;
  }

  /* Legend adjustments for mobile */
  .legend-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.5rem 0;
    width: 100%;
  }

  .legend-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #FFFFFF1A;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    border: 1px solid #FFFFFF1A;
    transition: all 0.2s ease;
  }

  .legend-item .legend-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 0.8rem;
  }
}

/* Desktop legend layout */
.legend-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
  align-items: center;
  margin: 1rem 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== Legend ===== */
.legend-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  background: var(--card-bg);
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  margin: 0.5rem 0 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

/* Desktop layout - horizontal legend */
@media (min-width: 768px) {
  .table-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .table-header h2 {
    margin: 0;
  }

  .legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin: 0;
    padding: 0.5rem 1rem;
    width: auto;
  }
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #FFFFFFE6;
  font-weight: 400;
}

.legend-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
  background: #FFFFFF1A;
}

/* Status colors - using theme variables */
:root {
  --color-on-time: #4caf50;
  --color-late: #ff9800;
  --color-qaza: #f44336;
  --color-period: #9c27b0;

  /* Add theme-specific colors */
  --bg: #0a0f1f;
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-color: #FFFFFF1A;
  --text-primary: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.7);
  --accent: #ff8a5c;
}

/* Status-specific styles for both legend and table cells */
.status-on-time {
  background-color: var(--color-on-time);
}

.status-late {
  background-color: var(--color-late);
}

.status-qaza {
  background-color: var(--color-qaza);
}

.status-period {
  background-color: var(--color-period);
  position: relative;
  overflow: visible;
}

/* Hollow circle for period status */
.status-period::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Legend container */
.legend-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  width: 100%;
}

/* Legend item styles */
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.legend-item:hover {
  background: #FFFFFF0D;
  transform: translateY(-1px);
}

.legend-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  color: white !important;
}

/* Status-specific icon styles for legend */
.legend-item[data-status="on-time"] .legend-icon {
  background-color: var(--color-on-time);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
  color: white !important;
}

.legend-item[data-status="late"] .legend-icon {
  background-color: var(--color-late);
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
  color: white !important;
}

.legend-item[data-status="qaza"] .legend-icon {
  background-color: var(--color-qaza);
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
  color: black !important;
  /* Keep Qaza icon black */
  font-weight: bold;
}

.legend-item[data-status="period"] .legend-icon {
  background-color: #ff4444;
  /* Red color for period */
  box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
  position: relative;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white !important;
}

/* Ensure the actual content of the legend icon is displayed */
.legend-icon::before {
  display: none;
  /* Hide any ::before pseudo-elements */
}

.legend-icon {
  /* Make sure the actual content is visible */
  content: attr(data-content);
}

/* Status circle styles */
.status-circle {
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  width: 32px;
  height: 32px;
  min-width: 32px;
  /* Ensure minimum size for touch targets */
  min-height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* Plan Tabs Styling */
.plan-tabs {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.plan-tab {
  background-color: #5a3d5c;
  /* Default background color */
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 0 5px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.plan-tab:hover {
  background-color: #6f4e71;
}

.plan-tab.active {
  background-color: #8e6b90;
  /* Highlight color for active tab */
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Status states */
.status-circle.status-not-done {
  background: var(--color-not-done);
  border-color: var(--border-color);
}

.status-circle.status-on-time {
  background: var(--color-on-time);
  border-color: var(--color-on-time);
  color: rgb(255, 255, 255);
  /* Make icon black */
}

.status-circle.status-late {
  background: var(--color-late);
  border-color: var(--color-late);
  color: rgb(255, 255, 255);
  /* Make icon black */
}

.status-circle.status-qaza {
  background: var(--color-qaza);
  border-color: var(--color-qaza);
  color: rgb(0, 0, 0);
  /* Set icon color to black */
  font-weight: bold;
  /* Make the cross bolder */
}

.status-circle.status-period {
  background: #ff4444;
  /* Red color for period */
  border-color: #ff4444;
  color: rgb(255, 255, 255);
  /* Changed from white to black for better visibility */
  font-weight: bold;
}

/* Status icon */
.status-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: white;
  /* Ensure all status icons are white by default */
}

/* Ensure period status icon is white */
.status-period .status-icon {
  color: white !important;
}

/* Make Qaza status icon black in prayer table */
.status-qaza .status-icon {
  color: black !important;
}

/* Hover effects */
.status-circle:not(.status-not-done):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.status-circle:active {
  transform: scale(0.95);
}

/* Focus state for accessibility */
.status-circle:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-transparent);
}

/* Make status circles slightly smaller on mobile */
@media screen and (max-width: 480px) {
  .status-circle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  /* Adjust highlight circle for today's date */
  #tracker-table tr.today td:first-child::before {
    width: 32px;
    height: 32px;
  }
}

.status-circle.status-not-done {
  background: #FFFFFF0D;
  border-color: rgba(255, 255, 255, 0.1);
}

.status-circle:hover {
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.status-circle:active {
  transform: translateY(0) scale(0.95);
}

.status-icon {
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.status-circle:hover .status-icon {
  transform: scale(1.2);
}

/* Status-specific styles */
.status-on-time {
  background-color: #4caf50;
  /* Green */
}

.status-late {
  background-color: #ff9800;
  /* Orange */
}

.status-qaza {
  background-color: #f44336;
  /* Red */
}

.status-period {
  background-color: #9c27b0;
  /* Purple */
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Remove the pseudo-element approach */
.status-period::after {
  content: none;
}

/* Ensure the pause icon is properly displayed */
.status-period .status-icon {
  color: black;
  /* Changed from white to black */
  z-index: 1;
}

/* Fix hover effect for period status */
.status-period:hover {
  opacity: 0.9;
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Removed duplicate circle styles for legend items */

/* ===== Theme Switcher ===== */
#theme-switcher {
  opacity: 0;
  animation: fadeIn 0.6s ease-out 0.7s forwards;
  margin-top: 2.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition);
  padding: 1.5rem;
  border-radius: var(--border-radius);
}

#theme-switcher h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

#theme-switcher h3::before {
  content: '';
  font-size: 1.2em;
}

.theme-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1rem;
}

.theme-btn {
  position: relative;
  padding: 0.6rem 1.2rem 0.6rem 2.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  color: var(--text-light);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
}

.theme-preview {
  position: absolute;
  left: 1rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
  pointer-events: none;
}

.theme-btn.active .theme-preview {
  outline: 2px solid white;
  outline-offset: 2px;
}

.theme-btn::before,
.theme-btn::after {
  content: none !important;
}

.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--shadow-accent);
}

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

/* ===== Theme Definitions ===== */
/* Peach Theme (Default) - Subtle */
:root,
.theme-peach {
  /* Base Colors */
  --bg: #1a1a1a;
  --fg: #f0f0f0;
  --card-bg: #302222;
  --card-hover: rgba(255, 200, 180, 0.05);
  --accent: #D4A373;
  /* Muted peach */
  --accent-hover: #E6B28A;
  --accent-light: rgba(212, 163, 115, 0.1);
  --accent-transparent: rgba(212, 163, 115, 0.2);

  /* Status Colors */
  --color-on-time: #6a9c6a;
  /* Muted green */
  --color-late: #D4A373;
  /* Muted yellow */
  --color-qaza: #c46c6c;
  /* Muted red */
  --color-period: #a67fb1;
  /* Muted purple */
  --color-not-done: #3a3a3a;

  /* UI Elements */
  --header-bg: linear-gradient(135deg, #2a2222 0%, #3a2a2a 100%);
  --section-bg: linear-gradient(145deg, #281E1EE6 0%, #3C2828E6 100%);
  --border-color: #D4A3730F;
  --border-hover: #D4A3731A;
  --text-muted: #C8C4C4;
  --text-light: #f0f0f0;
  --text-on-accent: #2c1313;
  --shadow-sm: 0 2px 8px #0000001A;
  --shadow-md: 0 4px 12px #00000026;
  --shadow-lg: 0 8px 24px #00000033;
  --shadow-accent: 0 0 0 2px #FFC7C7;

  /* Buttons */
  --btn-bg: var(--accent);
  --btn-text: var(--text-on-accent);
  --btn-hover: var(--accent-hover);
  --btn-shadow: 0 4px 6px -1px #0000001A, 0 2px 4px -1px #0000000F;
  --btn-hover-shadow: 0 10px 15px -3px #0000001A, 0 4px 6px -2px #0000000F;

  /* Inputs */
  --input-bg: #FFFFFF0A;
  --input-border: #FFFFFF0F;
  --input-text: var(--text-light);
  --input-placeholder: #FFFFFF50;
  --input-focus: var(--accent-transparent);

  /* Table */
  --table-header-bg: #0000000F;
  --table-row-hover: #FFFFFF03;
  --table-border: #FFFFFF05;

  /* Status Badges */
  --status-bg: #FFFFFF05;
  --status-border: #FFFFFF0F;

  /* Theme Switcher */
  --theme-btn-bg: #FFFFFF05;
  --theme-btn-hover: #FFFFFF0A;
  --theme-btn-active: var(--accent);
  --theme-btn-text: var(--text-light);
}

/* Pink Theme - Subtle */
.theme-pink {
  /* Base Colors */
  --bg: #1a1518;
  --fg: #f0f0f0;
  --card-bg: #38212e;
  --card-hover: #FFC0CB;
  --accent: #C586B5;
  /* Muted pink */
  --accent-hover: #D49EC4;
  --accent-light: #C586B50F;
  --accent-transparent: #C586B50D;

  /* Status Colors */
  --color-on-time: #6a9c6a;
  /* Muted green */
  --color-late: #D4A373;
  /* Muted yellow */
  --color-qaza: #c46c6c;
  /* Muted red */
  --color-period: #a67fb1;
  /* Muted purple */
  --color-not-done: #2a2226;

  /* UI Elements */
  --header-bg: linear-gradient(135deg, #3a2830 0%, #4a3040 100%);
  --section-bg: linear-gradient(145deg, #321E28E6 0%, #46283CE6 100%);
  --border-color: #C586B50F;
  --border-hover: #C586B51A;
  --text-muted: #D7C4D7;
  --text-light: #f0f0f0;
  --text-on-accent: #3a0e2a;
  --shadow-sm: 0 2px 8px #0000001A;
  --shadow-md: 0 4px 12px #00000026;
  --shadow-lg: 0 8px 24px #00000033;
  --shadow-accent: 0 0 0 2px rgba(255, 105, 180, 0.3);

  /* Buttons */
  --btn-bg: var(--accent);
  --btn-text: var(--text-on-accent);
  --btn-hover: var(--accent-hover);

  /* Inputs */
  --input-focus: var(--accent-transparent);

  /* Table */
  --table-header-bg: rgba(0, 0, 0, 0.2);
  --table-row-hover: rgba(255, 255, 255, 0.05);

  /* Theme Switcher */
  --theme-btn-active: var(--accent);
  --theme-btn-bg: rgba(255, 255, 255, 0.05);
  --theme-btn-hover: rgba(255, 255, 255, 0.1);
  --theme-btn-text: var(--text-light);
}

/* Blue Theme */
.theme-blue {
  /* Base Colors */
  --bg: #0f1a2e;
  --fg: #ffffff;
  --card-bg: #1a2b4a;
  --card-hover: #223a66;
  --accent: #4CC9F0;
  --accent-hover: #72DDF7;
  --accent-light: rgba(76, 201, 240, 0.1);
  --accent-transparent: rgba(76, 201, 240, 0.2);

  /* Status Colors */
  --color-on-time: #4CAF50;
  --color-late: #FFC107;
  --color-qaza: #F44336;
  --color-period: #9C27B0;
  --color-not-done: #1a2b4a;

  /* UI Elements */
  --header-bg: linear-gradient(135deg, rgba(15, 26, 46, 0.95) 0%, rgba(26, 43, 74, 0.95) 100%);
  --section-bg: rgba(26, 43, 74, 0.8);
  --border-color: rgba(76, 201, 240, 0.2);
  --border-hover: rgba(76, 201, 240, 0.4);
  --shadow-accent: 0 0 0 2px rgba(76, 201, 240, 0.3);

  /* Buttons */
  --btn-bg: var(--accent);
  --btn-hover: var(--accent-hover);

  /* Inputs */
  --input-focus: var(--accent-transparent);

  /* Theme Switcher */
  --theme-btn-active: var(--accent);
}

/* Green Theme */
.theme-green {
  /* Base Colors */
  --bg: #0d1f1d;
  --fg: #ffffff;
  --card-bg: #1a3a37;
  --card-hover: #204a46;
  --accent: #4CAF50;
  --accent-hover: #66BB6A;
  --accent-light: rgba(76, 175, 80, 0.1);
  --accent-transparent: rgba(76, 175, 80, 0.2);

  /* Status Colors */
  --color-on-time: #4CAF50;
  --color-late: #FFC107;
  --color-qaza: #F44336;
  --color-period: #9C27B0;
  --color-not-done: #1a3a37;

  /* UI Elements */
  --header-bg: linear-gradient(135deg, rgba(13, 31, 29, 0.95) 0%, rgba(26, 58, 55, 0.95) 100%);
  --section-bg: rgba(26, 58, 55, 0.8);
  --border-color: rgba(76, 175, 80, 0.2);
  --border-hover: rgba(76, 175, 80, 0.4);
  --shadow-accent: 0 0 0 2px rgba(76, 175, 80, 0.3);

  /* Buttons */
  --btn-bg: var(--accent);
  --btn-hover: var(--accent-hover);

  /* Inputs */
  --input-focus: var(--accent-transparent);

  /* Theme Switcher */
  --theme-btn-active: var(--accent);
}

/* Lavender Theme */
.theme-lavender {
  /* Base Colors */
  --bg: #1a1625;
  --fg: #ffffff;
  --card-bg: #2a2438;
  --card-hover: #3a324b;
  --accent: #9C89B8;
  --accent-hover: #B8B8FF;
  --accent-light: rgba(156, 137, 184, 0.1);
  --accent-transparent: rgba(156, 137, 184, 0.2);

  /* Status Colors */
  --color-on-time: #4CAF50;
  --color-late: #FFC107;
  --color-qaza: #F44336;
  --color-period: #9C27B0;
  --color-not-done: #2a2438;

  /* UI Elements */
  --header-bg: linear-gradient(135deg, rgba(26, 22, 37, 0.95) 0%, rgba(42, 36, 56, 0.95) 100%);
  --section-bg: rgba(42, 36, 56, 0.8);
  --border-color: rgba(156, 137, 184, 0.2);
  --border-hover: rgba(156, 137, 184, 0.4);
  --shadow-accent: 0 0 0 2px rgba(156, 137, 184, 0.3);

  /* Buttons */
  --btn-bg: var(--accent);
  --btn-hover: var(--accent-hover);

  /* Inputs */
  --input-focus: var(--accent-transparent);

  /* Theme Switcher */
  --theme-btn-active: var(--accent);
}

/* Theme button colors */
.theme-btn[data-theme="peach"] {
  --btn-color: #FF8C66;
}

.theme-btn[data-theme="pink"] {
  --btn-color: #FF6B95;
}

.theme-btn[data-theme="blue"] {
  --btn-color: #4CC9F0;
}

.theme-btn[data-theme="green"] {
  --btn-color: #4CAF50;
}

.theme-btn[data-theme="lavender"] {
  --btn-color: #9C89B8;
}

.theme-btn[data-theme]::before {
  background: var(--btn-color);
}

.theme-btn[data-theme]::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--btn-color);
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.theme-btn:hover::after {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

/* Active theme button */
.theme-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: var(--btn-color);
  box-shadow: 0 0 0 2px var(--btn-color), 0 4px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.theme-btn.active::after {
  transform: scale(1);
  box-shadow: 0 0 0 2px var(--btn-color), 0 0 10px var(--btn-color);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  font-size: 0.8rem;
  margin: 1rem 0;
  padding: 1rem 0;
  color: rgba(255, 255, 255, 0.5);
  animation: fadeIn 0.8s ease-out 0.4s both;
}

footer a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
  border-bottom: 1px dashed transparent;
}

footer a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Add animation classes */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-up {
  animation: slideInUp 0.6s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Staggered animations */
[data-animate] {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

/* Generate staggered animation delays */
[data-animate-delay="100"] {
  animation-delay: 0.1s;
}

[data-animate-delay="200"] {
  animation-delay: 0.2s;
}

[data-animate-delay="300"] {
  animation-delay: 0.3s;
}

[data-animate-delay="400"] {
  animation-delay: 0.4s;
}

[data-animate-delay="500"] {
  animation-delay: 0.5s;
}

[data-animate-delay="600"] {
  animation-delay: 0.6s;
}

[data-animate-delay="700"] {
  animation-delay: 0.7s;
}

[data-animate-delay="800"] {
  animation-delay: 0.8s;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  #app {
    max-width: 95%;
    padding: 0 2.5%;
  }
}

@media (max-width: 780px) {
  .header-content {
    text-align: center;
  }

  .header-decoration {
    justify-content: center;
    margin-top: 1rem;
  }

  .legend-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .legend-item {
    margin: 0.25rem;
  }

  .table-container {
    margin: 0 -1rem;
    padding: 0 1rem;
    overflow-x: auto;
  }

  .scroll-indicator {
    display: none;
    /* Hide scroll indicators on mobile */
  }

  #tracker-table {
    font-size: 0.9rem;
  }

  .theme-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .theme-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  .theme-btn {
    min-width: 97px !important;
    padding: 0.7rem 0.5rem !important;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    margin: 0.2rem 0;
    position: relative;
    overflow: hidden;
  }

  .theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .theme-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--shadow-accent);
  }

  .theme-preview {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  .theme-btn span:not(.theme-preview) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    margin-left: auto;
    padding-left: 0.5rem;
  }

  .btn-quote {
    padding: 0.75rem 1rem;
    min-width: auto;
  }

  .btn-quote .btn-text {
    display: inline-block !important;
    font-size: 0.9rem;
  }

  .btn-quote .btn-icon {
    margin-right: 0.5rem !important;
  }

  .quote-card {
    padding: 1.25rem;
  }

  .quote-text {
    font-size: 1rem;
    line-height: 1.5;
  }

  .quote-ref {
    font-size: 0.8rem;
    text-align: center;
  }

  .table-header h2 {
    font-size: 1.25rem;
  }

  footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Print styles */
@media print {
  body * {
    visibility: hidden;
  }

  .table-container,
  .table-container * {
    visibility: visible;
  }

  .table-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  /* Hide interactive elements when printing */
  .btn,
  #theme-switcher,
  #legend,
  .scroll-indicator {
    display: none !important;
  }

  /* Ensure table is readable */
  #tracker-table {
    width: 100%;
    border-collapse: collapse;
  }

  #tracker-table th,
  #tracker-table td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: center;
  }

  /* Ensure contrast for printing */
  body {
    background: white !important;
    color: black !important;
  }

  .status-circle {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  80% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 #FF6B95B3;
  }

  70% {
    box-shadow: 0 0 0 8px rgba(255, 107, 149, 0);
  }

  100% {
    box-shadow: 0 0 0 0 #FF6B9500;
  }
}

/* ===== Color Themes ===== */
body.theme-pink {
  --accent: #ff6b95;
  --accent-hover: #ff8aae;
  --color-on-time: #ff6b95;
  --color-late: #ff8aae;
  --color-qaza: #ffc0d1;
}

body.theme-blue {
  --accent: #4dabf7;
  --accent-hover: #74c0fc;
  --color-on-time: #1971c2;
  --color-late: #339af0;
  --color-qaza: #a5d8ff;
}

body.theme-green {
  --accent: #51cf66;
  --accent-hover: #69db7c;
  --color-on-time: #2b8a3e;
  --color-late: #40c057;
  --color-qaza: #b2f2bb;
}

body.theme-lavender {
  --accent: #9775fa;
  --accent-hover: #b197fc;
  --color-on-time: #5f3dc4;
  --color-late: #7950f2;
  --color-qaza: #d0bfff;
}

body.theme-peach {
  --accent: #ff8787;
  --accent-hover: #ffa8a8;
  --color-on-time: #e8590c;
  --color-late: #ff922b;
  --color-qaza: #ffd8a8;
}

/* ===== Responsive ===== */
@media (max-width: 780px) {
  :root {
    --spacing-sm: 0.75rem;
    --spacing-md: 1.25rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .legend {
    width: 100%;
    border-radius: 12px;
    padding: 0.8rem;
  }

  .theme-buttons {
    gap: 0.5rem;
  }

  .theme-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    min-width: auto;
  }

  .theme-btn::after {
    display: none;
  }
}

@media (max-width: 600px) {
  #tracker-table {
    font-size: 0.85rem;
  }

  #tracker-table th,
  #tracker-table td {
    padding: 0.6rem 0.2rem;
  }

  .status-circle {
    width: 30px;
    height: 30px;
  }

  #tracker-table tr.today td:first-child::before {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.9;
    aspect-ratio: 1 / 1;
    display: block;
    margin: 0;
    padding: 0;
  }
}

/* Extra small devices (phones, 360px and below) */
@media (max-width: 360px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0.5rem;
  }

  #tracker-table {
    font-size: 0.75rem;
  }

  #tracker-table th,
  #tracker-table td {
    padding: 0.3rem 0.1rem;
  }

  .status-circle {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }

  .header-content h1 {
    font-size: 1.5rem;
  }

  .theme-buttons {
    gap: 0.3rem;
  }

  .theme-btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
  }

  .legend {
    padding: 0.5rem;
  }

  .legend-item {
    padding: 0.3rem 0.6rem;
  }
}

/* Small devices (phones, 480px and below) */
@media (max-width: 480px) {
  .status-circle {
    width: 28px;
    height: 28px;
  }

  .legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    border-radius: 12px;
  }

  .legend-item {
    width: 100%;
    justify-content: space-between;
    padding: 0.4rem 0.8rem;
  }

  .theme-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
}

#legend {
  text-align: center;
  width: max-content;
  display: inline-flex;
  align-self: flex-start;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.table-header h2 {
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 0;
}

#legend {
  width: max-content;
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  overflow-x: auto;
}

.legend-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-left: 0;
  width: fit-content;
  max-width: 100%;
  min-width: fit-content;
}

/* Mobile styles (2x2 grid) */
@media (max-width: 480px) {

  /* Make the Spiritual Reminder heading two lines and smaller */
  .quote-section-title {
    font-size: 1.1rem;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    display: block;
  }

  /* Make quote decorations smaller on mobile */
  .quote-decoration {
    font-size: 3.2rem !important;
    top: 0.1rem !important;
    opacity: 0.13 !important;
  }

  #legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
    font-size: 0.9em;
    /* Base font size reduction */
  }

  .legend-item {
    padding: 0.3rem 0.5rem;
    /* Reduced padding */
    font-size: 0.85em;
    /* Slightly smaller font */
    gap: 0.25rem;
    /* Reduced gap between icon and text */
    min-width: 0;
    /* Allow items to shrink below content size */
    justify-content: center;
    text-align: center;
  }

  .legend-icon {
    font-size: 0.9em;
    /* Scale down icons proportionally */
  }
}

@media (max-width: 780px) {
  #legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
  }

  .legend-item {
    justify-content: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    text-align: center;
  }
}

/* Friday Highlight */
#tracker-table td.friday-highlight {
  color: #FFD700 !important;
  /* Gold */
  font-weight: bold !important;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}