/* ==========================================================
 * Qalbi Zikr - Stylesheet
 * ==========================================================
 *
 * Main stylesheet with custom styles for Qalbi Zikr PWA
 * Tailwind CSS loaded via CDN, this file contains custom
 * component styles and theme overrides.
 *
 * @package    Qalbi Zikr
 * @author     Muhammad Zaigham
 * @copyright  © MZift.com (@itsmzift) All rights reserved.
 * @license    Proprietary
 * @version    1.0.0
 *
 * SECTIONS:
 * 1. CSS Custom Properties
 * 2. Base Styles
 * 3. Layout Components
 * 4. Header & Navigation
 * 5. Cards & Containers
 * 6. Counter Component
 * 7. Buttons
 * 8. Form Elements
 * 9. Badges & Tags
 * 10. Tabs
 * 11. Modal & Overlays
 * 12. Toast Notifications
 * 13. Celebration Effects
 * 14. Typography
 * 15. Utilities
 * 16. Animations
 * 17. Print Styles
 * ========================================================== */


/* ==========================================================
 * 1. CSS CUSTOM PROPERTIES (Theme Colors)
 * ========================================================== */

:root {
  /* --------------------------------------------------------
   * mzift-primary: Islamic Green
   * -------------------------------------------------------- */
  --mzift-primary-50: #f0fdf4;
  --mzift-primary-100: #dcfce7;
  --mzift-primary-200: #bbf7d0;
  --mzift-primary-300: #86efac;
  --mzift-primary-400: #4ade80;
  --mzift-primary-500: #22c55e;
  --mzift-primary-600: #16a34a;
  --mzift-primary-700: #166534;
  --mzift-primary-800: #14532d;
  --mzift-primary-900: #052e16;

  /* --------------------------------------------------------
   * mzift-accent: Gold (for icons/stars only)
   * -------------------------------------------------------- */
  --mzift-accent-400: #facc15;
  --mzift-accent-500: #eab308;
  --mzift-accent-600: #ca8a04;

  /* --------------------------------------------------------
   * mzift-blue: Secondary Blue
   * -------------------------------------------------------- */
  --mzift-blue-400: #60a5fa;
  --mzift-blue-500: #3b82f6;
  --mzift-blue-600: #2563eb;

  /* --------------------------------------------------------
   * mzift-red: Danger/Error
   * -------------------------------------------------------- */
  --mzift-red-400: #f87171;
  --mzift-red-500: #ef4444;
  --mzift-red-600: #dc2626;

  /* --------------------------------------------------------
   * Dark Theme (Default)
   * -------------------------------------------------------- */
  --mzift-bg: #0a0a0a;
  --mzift-bg-elevated: #141414;
  --mzift-surface: #171717;
  --mzift-surface-hover: #1f1f1f;
  --mzift-border: #262626;
  --mzift-border-light: #333333;
  --mzift-text: #f8fafc;
  --mzift-text-secondary: #e2e8f0;
  --mzift-text-muted: #a3a3a3;
  --mzift-text-disabled: #525252;
  --mzift-overlay: rgba(0, 0, 0, 0.8);
  --mzift-glass: rgba(10, 10, 10, 0.9);
  --mzift-glass-border: rgba(255, 255, 255, 0.05);

  /* --------------------------------------------------------
   * Safe Area Insets (iOS notch support)
   * -------------------------------------------------------- */
  --mzift-safe-top: env(safe-area-inset-top, 0px);
  --mzift-safe-bottom: env(safe-area-inset-bottom, 0px);
  --mzift-safe-left: env(safe-area-inset-left, 0px);
  --mzift-safe-right: env(safe-area-inset-right, 0px);

  /* --------------------------------------------------------
   * Shadows
   * -------------------------------------------------------- */
  --mzift-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --mzift-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --mzift-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --mzift-shadow-glow: 0 0 20px rgba(34, 197, 94, 0.3);

  /* --------------------------------------------------------
   * Transitions
   * -------------------------------------------------------- */
  --mzift-transition-fast: 150ms ease;
  --mzift-transition: 200ms ease;
  --mzift-transition-slow: 300ms ease;

  /* --------------------------------------------------------
   * Border Radius
   * -------------------------------------------------------- */
  --mzift-radius-sm: 0.5rem;
  --mzift-radius: 0.75rem;
  --mzift-radius-lg: 1rem;
  --mzift-radius-xl: 1.5rem;
  --mzift-radius-full: 9999px;
}

/* ==========================================================
 * Light Theme Override
 * ========================================================== */

body.mzift-light {
  --mzift-bg: #ffffff;
  --mzift-bg-elevated: #f8fafc;
  --mzift-surface: #f1f5f9;
  --mzift-surface-hover: #e2e8f0;
  --mzift-border: #e2e8f0;
  --mzift-border-light: #cbd5e1;
  --mzift-text: #0f172a;
  --mzift-text-secondary: #1e293b;
  --mzift-text-muted: #64748b;
  --mzift-text-disabled: #94a3b8;
  --mzift-overlay: rgba(0, 0, 0, 0.5);
  --mzift-glass: rgba(255, 255, 255, 0.95);
  --mzift-glass-border: rgba(0, 0, 0, 0.05);
  --mzift-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --mzift-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  --mzift-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --mzift-shadow-glow: 0 0 20px rgba(22, 101, 52, 0.2);
}


/* ==========================================================
 * 2. BASE STYLES
 * ========================================================== */

/* --------------------------------------------------------
 * Reset & Box Sizing
 * -------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --------------------------------------------------------
 * HTML & Body
 * -------------------------------------------------------- */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--mzift-bg);
  color: var(--mzift-text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------
 * Selection
 * -------------------------------------------------------- */
::selection {
  background-color: var(--mzift-primary-500);
  color: white;
}

/* --------------------------------------------------------
 * Focus Visible
 * -------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--mzift-primary-500);
  outline-offset: 2px;
}


/* ==========================================================
 * 3. LAYOUT COMPONENTS
 * ========================================================== */

/* --------------------------------------------------------
 * App Container
 * -------------------------------------------------------- */
.mzift-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* --------------------------------------------------------
 * Main Content Area
 * -------------------------------------------------------- */
.mzift-main {
  flex: 1;
  padding-bottom: 5rem;
  overflow-y: auto;
}

/* --------------------------------------------------------
 * Safe Area Helpers
 * -------------------------------------------------------- */
.mzift-safe-top {
  padding-top: max(1rem, var(--mzift-safe-top));
}

.mzift-safe-bottom {
  padding-bottom: max(1rem, var(--mzift-safe-bottom));
}

/* --------------------------------------------------------
 * Max Width Container
 * -------------------------------------------------------- */
.mzift-container {
  width: 100%;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}


/* ==========================================================
 * 4. HEADER & NAVIGATION
 * ========================================================== */

/* --------------------------------------------------------
 * Header
 * -------------------------------------------------------- */
.mzift-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 1rem;
  background-color: var(--mzift-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mzift-glass-border);
}

/* --------------------------------------------------------
 * Bottom Navigation
 * -------------------------------------------------------- */
.mzift-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 0.5rem 1rem;
  background-color: var(--mzift-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--mzift-glass-border);
}

/* --------------------------------------------------------
 * Navigation Item
 * -------------------------------------------------------- */
.mzift-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--mzift-text-muted);
  text-decoration: none;
  transition: color var(--mzift-transition);
  border-radius: var(--mzift-radius);
}

.mzift-nav-item:hover {
  color: var(--mzift-primary-500);
}

.mzift-nav-item.active {
  color: var(--mzift-primary-500);
}

.mzift-nav-item svg {
  margin-bottom: 0.25rem;
}

/* --------------------------------------------------------
 * Header Icon Button
 * -------------------------------------------------------- */
.mzift-header-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mzift-radius);
  color: var(--mzift-text);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color var(--mzift-transition);
}

.mzift-header-btn:hover {
  background-color: var(--mzift-surface);
}


/* ==========================================================
 * 5. CARDS & CONTAINERS
 * ========================================================== */

/* --------------------------------------------------------
 * Base Card
 * -------------------------------------------------------- */
.mzift-card {
  background-color: var(--mzift-surface);
  border: 1px solid var(--mzift-border);
  border-radius: var(--mzift-radius-lg);
  padding: 1.25rem;
}

/* --------------------------------------------------------
 * Dhikr Card (Library items)
 * -------------------------------------------------------- */
.mzift-dhikr-card {
  display: block;
  background-color: var(--mzift-surface);
  border: 1px solid var(--mzift-border);
  border-radius: var(--mzift-radius-lg);
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: all var(--mzift-transition);
}

.mzift-dhikr-card:hover {
  border-color: var(--mzift-primary-500);
  box-shadow: var(--mzift-shadow-glow);
}

/* --------------------------------------------------------
 * Card Variants
 * -------------------------------------------------------- */
.mzift-card-warning {
  border-color: rgba(250, 204, 21, 0.3);
  background-color: rgba(250, 204, 21, 0.05);
}

.mzift-card-info {
  border-color: rgba(59, 130, 246, 0.3);
  background-color: rgba(59, 130, 246, 0.05);
}

.mzift-card-success {
  border-color: rgba(34, 197, 94, 0.3);
  background-color: rgba(34, 197, 94, 0.05);
}


/* ==========================================================
 * 6. COUNTER COMPONENT
 * ========================================================== */

/* --------------------------------------------------------
 * Counter Container
 * -------------------------------------------------------- */
.mzift-counter-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------
 * Counter Button
 * FIX: Removed translate, using scale only
 * -------------------------------------------------------- */
.mzift-counter-btn {
  position: relative;
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mzift-primary-500) 0%, var(--mzift-primary-700) 100%);
  color: white;
  font-size: 3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  box-shadow: 0 10px 40px rgba(22, 101, 52, 0.3);
  border: none;
  outline: none;
  transition: transform var(--mzift-transition), box-shadow var(--mzift-transition);
  transform: scale(1);
}

.mzift-counter-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 15px 50px rgba(22, 101, 52, 0.4);
}

.mzift-counter-btn:active {
  transform: scale(0.97);
}

/* --------------------------------------------------------
 * Counter Ripple Effect
 * -------------------------------------------------------- */
.mzift-counter-btn .mzift-ripple {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  animation: mzift-ripple 0.6s linear forwards;
  pointer-events: none;
}

/* --------------------------------------------------------
 * Progress Ring (SVG)
 * -------------------------------------------------------- */
.mzift-progress-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  pointer-events: none;
}

.mzift-progress-circle-bg {
  fill: none;
  stroke: var(--mzift-border);
  stroke-width: 8;
}

.mzift-progress-circle {
  fill: none;
  stroke: var(--mzift-primary-500);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease;
}

/* --------------------------------------------------------
 * Counter Completed State
 * -------------------------------------------------------- */
.mzift-counter-btn.completed {
  background: linear-gradient(135deg, var(--mzift-accent-400) 0%, var(--mzift-accent-600) 100%);
}


/* ==========================================================
 * 7. BUTTONS
 * ========================================================== */

/* --------------------------------------------------------
 * Primary Button
 * -------------------------------------------------------- */
.mzift-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--mzift-primary-500) 0%, var(--mzift-primary-700) 100%);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--mzift-radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--mzift-transition);
  box-shadow: var(--mzift-shadow);
}

.mzift-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--mzift-shadow-lg);
}

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

.mzift-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* --------------------------------------------------------
 * Secondary Button
 * -------------------------------------------------------- */
.mzift-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--mzift-surface);
  border: 1px solid var(--mzift-border);
  color: var(--mzift-text);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--mzift-radius);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--mzift-transition);
}

.mzift-btn-secondary:hover {
  background-color: var(--mzift-surface-hover);
  border-color: var(--mzift-border-light);
}

.mzift-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------------
 * Danger Button
 * -------------------------------------------------------- */
.mzift-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--mzift-red-500);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--mzift-radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--mzift-transition);
}

.mzift-btn-danger:hover {
  background-color: var(--mzift-red-600);
}

/* --------------------------------------------------------
 * Ghost Button
 * -------------------------------------------------------- */
.mzift-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: var(--mzift-text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--mzift-radius);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--mzift-transition);
}

.mzift-btn-ghost:hover {
  background-color: var(--mzift-surface);
  color: var(--mzift-text);
}

/* --------------------------------------------------------
 * Icon Button
 * -------------------------------------------------------- */
.mzift-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--mzift-text-muted);
  border-radius: var(--mzift-radius);
  cursor: pointer;
  transition: all var(--mzift-transition);
}

.mzift-btn-icon:hover {
  background-color: var(--mzift-surface);
  color: var(--mzift-text);
}

/* --------------------------------------------------------
 * Favorite Button
 * -------------------------------------------------------- */
.mzift-btn-favorite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--mzift-text-muted);
  background: transparent;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  transition: all var(--mzift-transition);
  line-height: 1;
}

.mzift-btn-favorite:hover,
.mzift-btn-favorite.active {
  color: var(--mzift-accent-400);
}


/* ==========================================================
 * 8. FORM ELEMENTS
 * ========================================================== */

/* --------------------------------------------------------
 * Input Field
 * -------------------------------------------------------- */
.mzift-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--mzift-surface);
  border: 1px solid var(--mzift-border);
  border-radius: var(--mzift-radius);
  color: var(--mzift-text);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--mzift-transition);
}

.mzift-input:focus {
  outline: none;
  border-color: var(--mzift-primary-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.mzift-input::placeholder {
  color: var(--mzift-text-muted);
}

.mzift-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------------
 * Textarea
 * -------------------------------------------------------- */
textarea.mzift-input {
  resize: vertical;
  min-height: 100px;
}

/* --------------------------------------------------------
 * Toggle Switch
 * -------------------------------------------------------- */
.mzift-toggle {
  position: relative;
  width: 3rem;
  height: 1.75rem;
  background-color: var(--mzift-border-light);
  border-radius: var(--mzift-radius-full);
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background-color var(--mzift-transition);
}

.mzift-toggle.active {
  background-color: var(--mzift-primary-500);
}

.mzift-toggle-knob {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.5rem;
  height: 1.5rem;
  background-color: white;
  border-radius: 50%;
  box-shadow: var(--mzift-shadow-sm);
  transition: transform var(--mzift-transition);
}

.mzift-toggle.active .mzift-toggle-knob {
  transform: translateX(1.25rem);
}

/* --------------------------------------------------------
 * Search Input
 * -------------------------------------------------------- */
.mzift-search {
  position: relative;
}

.mzift-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background-color: var(--mzift-surface);
  border: 1px solid var(--mzift-border);
  border-radius: var(--mzift-radius-full);
  color: var(--mzift-text);
  font-size: 0.875rem;
  transition: all var(--mzift-transition);
}

.mzift-search-input:focus {
  outline: none;
  border-color: var(--mzift-primary-500);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.mzift-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mzift-text-muted);
  pointer-events: none;
}

.mzift-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--mzift-text-muted);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--mzift-transition);
}

.mzift-search-clear:hover {
  background-color: var(--mzift-surface-hover);
  color: var(--mzift-text);
}


/* ==========================================================
 * 9. BADGES & TAGS
 * ========================================================== */

/* --------------------------------------------------------
 * Base Badge
 * -------------------------------------------------------- */
.mzift-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--mzift-radius-full);
  background-color: var(--mzift-surface);
  color: var(--mzift-text-muted);
}

/* --------------------------------------------------------
 * Category Badges
 * -------------------------------------------------------- */
.mzift-badge-morning {
  background-color: rgba(250, 204, 21, 0.15);
  color: #fbbf24;
}

body.mzift-light .mzift-badge-morning {
  background-color: rgba(202, 138, 4, 0.15);
  color: #a16207;
}

.mzift-badge-evening {
  background-color: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

body.mzift-light .mzift-badge-evening {
  background-color: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
}

.mzift-badge-after_salah {
  background-color: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

body.mzift-light .mzift-badge-after_salah {
  background-color: rgba(22, 163, 74, 0.15);
  color: #15803d;
}

.mzift-badge-general {
  background-color: rgba(163, 163, 163, 0.15);
  color: #a3a3a3;
}

body.mzift-light .mzift-badge-general {
  background-color: rgba(100, 116, 139, 0.15);
  color: #475569;
}


/* ==========================================================
 * 10. TABS
 * ========================================================== */

/* --------------------------------------------------------
 * Tabs Container
 * -------------------------------------------------------- */
.mzift-tabs {
  display: flex;
  gap: 0.25rem;
  background-color: var(--mzift-surface);
  padding: 0.25rem;
  border-radius: var(--mzift-radius);
}

/* --------------------------------------------------------
 * Tab Button
 * -------------------------------------------------------- */
.mzift-tab {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  border-radius: var(--mzift-radius-sm);
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--mzift-text-muted);
  transition: all var(--mzift-transition);
}

.mzift-tab:hover {
  color: var(--mzift-text);
}

.mzift-tab.active {
  background-color: var(--mzift-primary-700);
  color: white;
}

/* --------------------------------------------------------
 * Tab Content
 * -------------------------------------------------------- */
.mzift-tab-content {
  display: block;
}

.mzift-tab-content.hidden {
  display: none;
}

/* --------------------------------------------------------
 * Category Filter Pills
 * -------------------------------------------------------- */
.mzift-category-filter {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--mzift-radius-full);
  cursor: pointer;
  background-color: var(--mzift-surface);
  border: 1px solid var(--mzift-border);
  color: var(--mzift-text-muted);
  transition: all var(--mzift-transition);
}

.mzift-category-filter:hover {
  border-color: var(--mzift-primary-500);
  color: var(--mzift-primary-500);
}

.mzift-category-filter.active {
  background-color: var(--mzift-primary-700);
  border-color: var(--mzift-primary-700);
  color: white;
}


/* ==========================================================
 * 11. MODAL & OVERLAYS
 * ========================================================== */

/* --------------------------------------------------------
 * Modal Overlay
 * -------------------------------------------------------- */
.mzift-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: var(--mzift-overlay);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--mzift-transition);
}

.mzift-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------
 * Modal Content
 * -------------------------------------------------------- */
.mzift-modal {
  width: 100%;
  max-width: 24rem;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--mzift-surface);
  border: 1px solid var(--mzift-border);
  border-radius: var(--mzift-radius-xl);
  padding: 1.5rem;
  transform: scale(0.95);
  transition: transform var(--mzift-transition);
}

.mzift-modal-overlay.active .mzift-modal {
  transform: scale(1);
}

/* --------------------------------------------------------
 * Modal Header
 * -------------------------------------------------------- */
.mzift-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.mzift-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--mzift-text);
}

.mzift-modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--mzift-text-muted);
  cursor: pointer;
  border-radius: var(--mzift-radius-sm);
  transition: all var(--mzift-transition);
}

.mzift-modal-close:hover {
  background-color: var(--mzift-surface-hover);
  color: var(--mzift-text);
}

/* --------------------------------------------------------
 * Celebration Modal
 * -------------------------------------------------------- */
.mzift-celebration-modal {
  text-align: center;
}

.mzift-celebration-modal .mzift-modal {
  max-width: 20rem;
}


/* ==========================================================
 * 12. TOAST NOTIFICATIONS
 * ========================================================== */

/* --------------------------------------------------------
 * Toast Container
 * -------------------------------------------------------- */
.mzift-toast {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  z-index: 60;
  padding: 0.875rem 1.25rem;
  background-color: var(--mzift-surface);
  border: 1px solid var(--mzift-border);
  border-radius: var(--mzift-radius);
  box-shadow: var(--mzift-shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mzift-text);
  opacity: 0;
  visibility: hidden;
  transition: all var(--mzift-transition-slow);
}

.mzift-toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------
 * Toast Variants
 * -------------------------------------------------------- */
.mzift-toast-success {
  border-color: var(--mzift-primary-500);
  background-color: rgba(34, 197, 94, 0.1);
}

.mzift-toast-error {
  border-color: var(--mzift-red-500);
  background-color: rgba(239, 68, 68, 0.1);
}

.mzift-toast-info {
  border-color: var(--mzift-blue-500);
  background-color: rgba(59, 130, 246, 0.1);
}


/* ==========================================================
 * 13. CELEBRATION EFFECTS
 * ========================================================== */

/* --------------------------------------------------------
 * Particle Container
 * -------------------------------------------------------- */
.mzift-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--mzift-transition);
}

.mzift-particles.active {
  opacity: 1;
}

/* --------------------------------------------------------
 * Individual Particle
 * -------------------------------------------------------- */
.mzift-particle {
  position: absolute;
  font-size: 1.5rem;
  animation: mzift-particle 1.5s ease-out forwards;
}


/* ==========================================================
 * 14. TYPOGRAPHY
 * ========================================================== */

/* --------------------------------------------------------
 * Arabic Text - Noto Naskh Arabic (Primary)
 * Supports full harakat (tashkeel)
 * -------------------------------------------------------- */
.mzift-arabic {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  direction: rtl;
  text-align: right;
  line-height: 2;
  font-feature-settings: "liga" 1, "calt" 1;
}

/* --------------------------------------------------------
 * Arabic Display - Katibeh (For large headings only)
 * -------------------------------------------------------- */
.mzift-arabic-display {
  font-family: 'Katibeh', 'Noto Naskh Arabic', serif;
  direction: rtl;
  text-align: right;
  line-height: 1.6;
}

/* --------------------------------------------------------
 * Text Colors - Using CSS variables for consistency
 * FIX: Removed gold for text, using proper contrast colors
 * -------------------------------------------------------- */
.mzift-text-muted {
  color: var(--mzift-text-muted);
}

.mzift-text-secondary {
  color: var(--mzift-text-secondary);
}

.mzift-text-primary {
  color: var(--mzift-primary-500);
}

body.mzift-light .mzift-text-primary {
  color: var(--mzift-primary-700);
}

.mzift-text-success {
  color: var(--mzift-primary-400);
}

body.mzift-light .mzift-text-success {
  color: var(--mzift-primary-600);
}

.mzift-text-warning {
  color: #fbbf24;
}

body.mzift-light .mzift-text-warning {
  color: #b45309;
}

.mzift-text-danger {
  color: var(--mzift-red-400);
}

body.mzift-light .mzift-text-danger {
  color: var(--mzift-red-600);
}

.mzift-text-info {
  color: var(--mzift-blue-400);
}

body.mzift-light .mzift-text-info {
  color: var(--mzift-blue-600);
}

/* --------------------------------------------------------
 * Reference/Citation Text - Readable in both themes
 * FIX: Using muted gray instead of gold
 * -------------------------------------------------------- */
.mzift-text-reference {
  color: var(--mzift-text-muted);
  font-size: 0.75rem;
  font-style: italic;
}

/* --------------------------------------------------------
 * Section Headers
 * -------------------------------------------------------- */
.mzift-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mzift-text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mzift-section-title svg {
  color: var(--mzift-primary-500);
}


/* ==========================================================
 * 15. UTILITIES
 * ========================================================== */

/* --------------------------------------------------------
 * Hide Scrollbar
 * -------------------------------------------------------- */
.mzift-hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.mzift-hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------
 * Horizontal Scroll
 * -------------------------------------------------------- */
.mzift-scroll-x {
  display: flex;
  overflow-x: auto;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.mzift-scroll-x::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------
 * Visually Hidden (Accessibility)
 * -------------------------------------------------------- */
.mzift-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------
 * Empty State
 * -------------------------------------------------------- */
.mzift-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--mzift-text-muted);
}

.mzift-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* --------------------------------------------------------
 * Install Banner
 * -------------------------------------------------------- */
.mzift-install-banner {
  position: fixed;
  bottom: 5rem;
  left: 1rem;
  right: 1rem;
  z-index: 45;
  max-width: 24rem;
  margin: 0 auto;
  background-color: var(--mzift-surface);
  border: 1px solid var(--mzift-primary-500);
  border-radius: var(--mzift-radius-lg);
  padding: 1rem;
  transform: translateY(150%);
  transition: transform var(--mzift-transition-slow);
  box-shadow: var(--mzift-shadow-lg);
}

.mzift-install-banner.active {
  transform: translateY(0);
}

/* --------------------------------------------------------
 * Divider
 * -------------------------------------------------------- */
.mzift-divider {
  height: 1px;
  background-color: var(--mzift-border);
  margin: 1rem 0;
}

/* --------------------------------------------------------
 * Skeleton Loading
 * -------------------------------------------------------- */
.mzift-skeleton {
  background: linear-gradient(
    90deg,
    var(--mzift-surface) 25%,
    var(--mzift-surface-hover) 50%,
    var(--mzift-surface) 75%
  );
  background-size: 200% 100%;
  animation: mzift-skeleton 1.5s infinite;
  border-radius: var(--mzift-radius-sm);
}


/* ==========================================================
 * 16. ANIMATIONS
 * ========================================================== */

/* --------------------------------------------------------
 * Ripple Animation
 * -------------------------------------------------------- */
@keyframes mzift-ripple {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* --------------------------------------------------------
 * Particle Animation
 * -------------------------------------------------------- */
@keyframes mzift-particle {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) scale(0);
    opacity: 0;
  }
}

/* --------------------------------------------------------
 * Slide Up Animation
 * -------------------------------------------------------- */
@keyframes mzift-slide-up {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --------------------------------------------------------
 * Fade In Animation
 * -------------------------------------------------------- */
@keyframes mzift-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* --------------------------------------------------------
 * Pulse Animation
 * -------------------------------------------------------- */
@keyframes mzift-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* --------------------------------------------------------
 * Skeleton Loading Animation
 * -------------------------------------------------------- */
@keyframes mzift-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* --------------------------------------------------------
 * Shake Animation
 * -------------------------------------------------------- */
@keyframes mzift-shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}


/* ==========================================================
 * 17. PRINT STYLES
 * ========================================================== */

@media print {
  .mzift-header,
  .mzift-bottom-nav,
  .mzift-install-banner,
  .mzift-modal-overlay,
  .mzift-toast {
    display: none !important;
  }

  .mzift-main {
    padding: 0;
  }

  body,
  body.mzift-light {
    background: white;
    color: black;
  }

  .mzift-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}
