:root {
  --bg-primary: #0a0612;
  --bg-secondary: #140a24;
  --bg-card: #1d1033;
  --violet-primary: #8b5cf6;
  --violet-dark: #6d28d9;
  --violet-light: #a78bfa;
  --gold-primary: #fbbf24;
  --gold-dark: #f59e0b;
  --gold-light: #fcd34d;
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;

  font-family: 'Arial', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  font-weight: 400;

  color-scheme: dark;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem;
  min-width: 320px;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(251, 191, 36, 0.08) 0%, transparent 50%);
  animation: gradient-shift 15s ease infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes gradient-shift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-5%, -5%) rotate(180deg); }
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  font-weight: 700;
  background: linear-gradient(135deg, var(--violet-light) 0%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.card {
  padding: 1.75rem;
  padding-top: 3.5rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(29, 16, 51, 0.8) 100%);
  border-radius: 16px;
  border: 1.5px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 4px 16px rgba(139, 92, 246, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.card-id {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(109, 40, 217, 0.4));
  color: var(--violet-light);
  border: 1px solid rgba(139, 92, 246, 0.5);
  border-radius: 12px;
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  z-index: 2;
}

.card:hover .card-id {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(109, 40, 217, 0.6));
  border-color: var(--violet-primary);
  color: var(--violet-primary);
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.card-total {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(109, 40, 217, 0.4));
  color: var(--gold-light);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 20px;
  min-width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  z-index: 2;
}

.card:hover .card-total {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(109, 40, 217, 0.6));
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.1), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.5),
              0 0 50px rgba(251, 191, 36, 0.4),
              0 4px 20px rgba(109, 40, 217, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, rgba(29, 16, 51, 0.95) 0%, rgba(109, 40, 217, 0.3) 100%);
}

.card:hover::before {
  opacity: 1;
  animation: pulse 2s ease-in-out infinite;
}

.card:hover::after {
  left: 100%;
}

@keyframes pulse {
  0%, 100% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.1) translate(10%, 10%); }
}

.card-arabe {
  font-family: 'Amiri', serif;
  font-size: 2.25rem;
  color: var(--gold-primary);
  margin-bottom: 0.75rem;
  font-weight: 600;
  text-shadow: 0 2px 12px rgba(251, 191, 36, 0.3);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  line-height: 1.3;
}

.card:hover .card-arabe {
  color: var(--gold-light);
  text-shadow: 0 4px 20px rgba(251, 191, 36, 0.6),
               0 0 30px rgba(251, 191, 36, 0.4);
  transform: scale(1.05);
}

.card-fr {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  line-height: 1.4;
}

.card:hover .card-fr {
  color: var(--text-primary);
  transform: translateY(-2px);
}
.nombre{
    font-size: 10px;
}

.variants {
  display: flex;
  font-size: 1.2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.variant-badge {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(109, 40, 217, 0.15));
  border: 1.5px solid rgba(139, 92, 246, 0.4);
  border-radius: 10px;
  font-size: 1.1rem;
  color: var(--violet-light);
  font-family: 'Amiri', serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
  font-weight: 500;
}

.variant-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--violet-primary), var(--gold-primary));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.variant-badge:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(251, 191, 36, 0.3));
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4),
              0 0 30px rgba(139, 92, 246, 0.3);
}

.variant-badge:hover::before {
  opacity: 1;
}

.card:hover .variant-badge {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(109, 40, 217, 0.2));
  border-color: rgba(139, 92, 246, 0.6);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(10, 6, 18, 0.85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-content {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(29, 16, 51, 0.95) 100%);
  margin: auto;
  padding: 2.5rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5),
              0 0 64px rgba(139, 92, 246, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(139, 92, 246, 0.1);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.6);
}

.close {
  color: var(--text-muted);
  float: right;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.close:hover,
.close:focus {
  color: var(--gold-primary);
  background: rgba(251, 191, 36, 0.1);
}

.modal-content h2 {
  font-family: 'Amiri', serif;
  font-size: 2rem;
  color: var(--gold-primary);
  margin-bottom: 2rem;
  text-align: center;
  text-shadow: 0 2px 16px rgba(251, 191, 36, 0.3);
}

#versetsList {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.verset {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(10, 6, 18, 0.5), rgba(29, 16, 51, 0.4));
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.verset::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--violet-primary), var(--gold-primary), var(--violet-primary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.verset:hover {
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, rgba(10, 6, 18, 0.7), rgba(29, 16, 51, 0.6));
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.25),
              0 0 40px rgba(251, 191, 36, 0.1);
  transform: translateX(4px);
}

.verset:hover::before {
  opacity: 1;
}

.verset strong {
  color: var(--gold-primary);
  font-size: 1rem;
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.verset-arabe {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  line-height: 2;
  direction: rtl;
  text-align: right;
  color: var(--text-primary);
  margin: 1rem 0;
  padding: 1.2rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(109, 40, 217, 0.05));
  border-radius: 10px;
  border: 1px solid rgba(139, 92, 246, 0.15);
  box-shadow: inset 0 2px 8px rgba(139, 92, 246, 0.1);
}

.verset-fr {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-top: 1rem;
  font-size: 1.05rem;
}

mark {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(251, 191, 36, 0.5));
  color: var(--gold-light);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.nav-button {
  position: fixed;
  bottom: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(109, 40, 217, 0.9));
  border: 2px solid rgba(251, 191, 36, 0.6);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4),
              0 0 40px rgba(139, 92, 246, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.nav-button-left {
  left: 2rem;
}

.nav-button-right {
  right: 2rem;
}

.nav-button:hover {
  transform: scale(1.1) translateY(-4px);
  background: linear-gradient(135deg, rgba(139, 92, 246, 1), rgba(109, 40, 217, 1));
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.6),
              0 0 60px rgba(251, 191, 36, 0.4),
              inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.nav-button:active {
  transform: scale(0.95) translateY(-2px);
}

.nav-button svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.5;
}

@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
  }

  .card {
    padding: 1.5rem;
    padding-top: 3.5rem;
    min-height: 220px;
  }

  .card-arabe {
    font-size: 2rem;
  }

  .card-fr {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
    padding-bottom: 5rem;
  }

  h1 {
    font-size: 1.65rem;
    margin-bottom: 1.5rem;
    line-height: 1.35;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
  }

  .card {
    padding: 1.75rem;
    padding-top: 4rem;
    min-height: 240px;
  }

  .card-id {
    min-width: 42px;
    height: 42px;
    font-size: 1rem;
    top: 12px;
    left: 12px;
  }

  .card-total {
    min-width: 48px;
    height: 48px;
    font-size: 1.25rem;
    top: 12px;
    right: 12px;
  }

  .card-arabe {
    font-size: 2.1rem;
    margin-bottom: 0.75rem;
  }

  .card-fr {
    font-size: 1.3rem;
  }

  .variants {
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .variant-badge {
    padding: 0.45rem 0.85rem;
    font-size: 1.15rem;
  }

  .nav-button {
    width: 54px;
    height: 54px;
    bottom: 1.25rem;
  }

  .nav-button-left {
    left: 1.25rem;
  }

  .nav-button-right {
    right: 1.25rem;
  }

  .nav-button svg {
    width: 24px;
    height: 24px;
  }

  .modal {
    padding: 1rem;
  }

  .modal-content {
    padding: 1.5rem;
    width: 95%;
    max-height: 88vh;
    border-radius: 16px;
  }

  .modal-content h2 {
    font-size: 1.65rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
  }

  .verset {
    padding: 1.35rem;
  }

  .verset-arabe {
    font-size: 1.5rem;
    padding: 1.1rem;
    line-height: 2.1;
  }

  .verset-fr {
    font-size: 1.05rem;
    line-height: 1.7;
  }

  .verset strong {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.875rem;
    padding-bottom: 5rem;
  }

  h1 {
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
    line-height: 1.35;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.5rem;
    padding-top: 3.75rem;
    min-height: 220px;
  }

  .card-id {
    min-width: 38px;
    height: 38px;
    font-size: 0.95rem;
    top: 10px;
    left: 10px;
  }

  .card-total {
    min-width: 44px;
    height: 44px;
    font-size: 1.15rem;
    top: 10px;
    right: 10px;
  }

  .card-arabe {
    font-size: 1.95rem;
    margin-bottom: 0.65rem;
  }

  .card-fr {
    font-size: 1.2rem;
    margin-bottom: 0.875rem;
  }

  .variants {
    gap: 0.45rem;
    margin-top: 0.875rem;
  }

  .variant-badge {
    padding: 0.4rem 0.75rem;
    font-size: 1.05rem;
  }

  .nav-button {
    width: 50px;
    height: 50px;
    bottom: 1rem;
  }

  .nav-button-left {
    left: 1rem;
  }

  .nav-button-right {
    right: 1rem;
  }

  .nav-button svg {
    width: 22px;
    height: 22px;
  }

  .modal-content {
    padding: 1.25rem;
    width: 96%;
    border-radius: 14px;
  }

  .modal-content h2 {
    font-size: 1.45rem;
    margin-bottom: 1.35rem;
    line-height: 1.4;
  }

  .close {
    font-size: 1.85rem;
    width: 30px;
    height: 30px;
  }

  .verset {
    padding: 1.15rem;
  }

  .verset-arabe {
    font-size: 1.4rem;
    padding: 0.95rem;
    line-height: 2;
  }

  .verset-fr {
    font-size: 1rem;
    line-height: 1.65;
  }

  .verset strong {
    font-size: 0.9rem;
    margin-bottom: 0.875rem;
  }

  mark {
    padding: 0.22rem 0.45rem;
    font-size: 1em;
  }
}
