/* ==========================================================================
   Mioo Islamic Finance Hub — Custom Styles
   Augments Tailwind with components, animations, and Islamic design motifs
   ========================================================================== */

/* Base */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

::selection { background: #D4A437; color: #0F4C3A; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #FAF7F2; }
::-webkit-scrollbar-thumb { background: #0F4C3A; border-radius: 5px; border: 2px solid #FAF7F2; }
::-webkit-scrollbar-thumb:hover { background: #16624d; }

/* Focus ring */
:focus-visible { outline: 2px solid #D4A437; outline-offset: 2px; border-radius: 4px; }

/* Navigation links */
.nav-link {
  @apply px-4 py-2 rounded-full font-semibold text-sm text-emerald-900/80 hover:text-emerald-900 hover:bg-emerald-900/5 transition-all duration-300;
}
.nav-active {
  @apply bg-emerald-900/10 text-emerald-900;
}

/* Mega menu links */
.mega-link {
  @apply flex items-center gap-3 p-3 rounded-xl hover:bg-emerald-50 transition-colors duration-200;
}
.mega-icon { @apply text-2xl flex-shrink-0; }
.mega-title { @apply font-semibold text-sm text-emerald-900; }
.mega-desc { @apply text-xs text-slatey; }

/* Hero gradient text */
.gradient-text {
  background: linear-gradient(120deg, #0F4C3A 0%, #1d7a5f 50%, #D4A437 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: gradientShift 8s ease infinite;
}

/* Decorative arabic divider */
.arabic-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #D4A437;
  font-size: 1.5rem;
}
.arabic-divider::before, .arabic-divider::after {
  content: '';
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(to right, transparent, #D4A437, transparent);
}

/* Card hover effect */
.card-hover {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px -12px rgba(15, 76, 58, 0.18);
}

/* Calculator card */
.calc-card {
  @apply bg-white rounded-3xl shadow-card border border-emerald-900/5 p-6 sm:p-8;
}

/* Tool input styling */
.tool-input {
  @apply w-full px-4 py-3 rounded-xl border-2 border-emerald-900/10 bg-cream/50 text-ink font-medium focus:outline-none focus:border-gold-400 focus:bg-white transition-all duration-200;
}
.tool-label {
  @apply block text-sm font-semibold text-emerald-900 mb-2;
}
.tool-select {
  @apply w-full px-4 py-3 rounded-xl border-2 border-emerald-900/10 bg-cream/50 text-ink font-medium focus:outline-none focus:border-gold-400 focus:bg-white transition-all duration-200 cursor-pointer;
}
.tool-button {
  @apply w-full px-6 py-3.5 rounded-xl bg-emerald-900 text-cream font-bold hover:bg-emerald-800 transition-all duration-300 hover:shadow-glow-gold hover:-translate-y-0.5 inline-flex items-center justify-center gap-2;
}
.tool-button-secondary {
  @apply w-full px-6 py-3.5 rounded-xl bg-white border-2 border-emerald-900/15 text-emerald-900 font-bold hover:bg-emerald-50 transition-all duration-300;
}

/* Result display */
.result-display {
  @apply bg-gradient-to-br from-emerald-900 to-emerald-800 rounded-2xl p-6 text-cream text-center;
}
.result-value {
  @apply font-display text-4xl sm:text-5xl font-bold text-gold-300;
}

/* Article body typography */
.prose-islamic {
  @apply text-slatey leading-relaxed;
}
.prose-islamic h2 {
  @apply font-display text-2xl sm:text-3xl font-bold text-emerald-900 mt-10 mb-4;
}
.prose-islamic h3 {
  @apply font-display text-xl sm:text-2xl font-bold text-emerald-900 mt-8 mb-3;
}
.prose-islamic h4 {
  @apply font-semibold text-lg text-emerald-900 mt-6 mb-2;
}
.prose-islamic p {
  @apply mb-5 text-[1.0625rem] leading-[1.8];
}
.prose-islamic ul {
  @apply mb-5 space-y-2 pl-5;
  list-style-type: none;
}
.prose-islamic ul li {
  @apply relative pl-6;
}
.prose-islamic ul li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 0.1em;
  color: #D4A437;
  font-size: 0.85em;
}
.prose-islamic ol {
  @apply mb-5 space-y-2 pl-5 list-decimal;
}
.prose-islamic ol li {
  @apply pl-2 marker:text-gold-500 marker:font-bold;
}
.prose-islamic blockquote {
  @apply my-6 pl-6 py-4 border-l-4 border-gold-400 bg-gold-50/50 rounded-r-xl italic text-emerald-900;
}
.prose-islamic strong {
  @apply font-bold text-emerald-900;
}
.prose-islamic a {
  @apply text-emerald-700 underline decoration-gold-400/50 underline-offset-2 hover:decoration-gold-400 transition-colors;
}
.prose-islamic table {
  @apply w-full my-6 border-collapse text-sm;
}
.prose-islamic th {
  @apply bg-emerald-900 text-cream px-4 py-3 text-left font-semibold;
}
.prose-islamic td {
  @apply px-4 py-3 border-b border-emerald-900/10;
}
.prose-islamic tr:nth-child(even) td {
  @apply bg-cream/50;
}

/* Arabic verse styling */
.verse {
  @apply font-arabic text-2xl sm:text-3xl text-emerald-900 text-center leading-loose my-6 py-4;
  direction: rtl;
}

/* Urdu text */
.urdu {
  font-family: 'Cairo', 'Noto Nastaliq Urdu', serif;
  direction: rtl;
  line-height: 2;
}

/* Animated background blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}
.blob-gold { background: #D4A437; }
.blob-emerald { background: #2a9d76; }

/* Shimmer skeleton */
.shimmer {
  background: linear-gradient(90deg, #f0e9d6 25%, #f5e9c8 50%, #f0e9d6 75%);
  background-size: 1000px 100%;
  animation: shimmer 3s linear infinite;
}

/* Pulse dot */
.pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3bbf8e;
}
.pulse-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: #3bbf8e;
  opacity: 0.4;
  animation: pulseRing 2s ease-out infinite;
}

/* Geometric pattern tile */
.pattern-tile {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23D4A437' stroke-width='0.8' stroke-opacity='0.15'%3E%3Cpath d='M30 0L60 30L30 60L0 30z'/%3E%3Cpath d='M30 15L45 30L30 45L15 30z'/%3E%3Ccircle cx='30' cy='30' r='8'/%3E%3C/g%3E%3C/svg%3E");
}

/* Tag chip */
.tag-chip {
  @apply inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-semibold;
}
.tag-emerald { @apply bg-emerald-50 text-emerald-800; }
.tag-gold { @apply bg-gold-50 text-gold-600; }

/* Reveal-on-scroll animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Number counter */
.counter {
  font-variant-numeric: tabular-nums;
}

/* Loading spinner */
.spinner {
  border: 3px solid rgba(212, 164, 55, 0.2);
  border-top-color: #D4A437;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Decorative section number */
.section-num {
  @apply font-display text-7xl font-bold text-gold-400/15 leading-none absolute -top-4 -left-2 select-none;
}

/* Tab styling */
.tab-btn {
  @apply px-5 py-2.5 rounded-full font-semibold text-sm transition-all duration-300;
}
.tab-btn-active {
  @apply bg-emerald-900 text-cream shadow-soft;
}
.tab-btn-inactive {
  @apply text-emerald-900/70 hover:bg-emerald-900/5;
}

/* Print styles for calculation results */
@media print {
  header, footer, .no-print { display: none !important; }
  body { background: white; color: black; }
  .calc-card { box-shadow: none; border: 1px solid #ccc; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
