/* ==========================================================================
   ساعدني (Sa'idni) - Custom Styling & Micro-interactions
   ========================================================================== */

/* Google Fonts Import: Cairo and Readex Pro */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Readex+Pro:wght@300;400;500;600;700&display=swap');

:root {
  --primary-red: #DC2626;
  --primary-red-hover: #B91C1C;
  --primary-red-light: #FEE2E2;
  --urgent-glow: rgba(220, 38, 38, 0.45);
  --dark-slate: #0F172A;
  --surface-white: #FFFFFF;
  --surface-gray: #F8FAFC;
  --border-subtle: #E2E8F0;
  --text-main: #1E293B;
  --text-muted: #64748B;
}

/* Base resets & smooth scrolling */
html {
  scroll-behavior: smooth;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  direction: rtl;
  text-align: right;
}

body {
  background-color: #F8FAFC;
  color: var(--text-main);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Glassmorphism Classes */
.glass-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(241, 245, 249, 1);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

.glass-card:hover {
  box-shadow: 0 20px 30px -10px rgba(220, 38, 38, 0.08), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
}

/* Animations */
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 14px rgba(220, 38, 38, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.sos-beacon {
  animation: pulse-ring 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.15);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(1);
  }
}

.heartbeat-icon {
  animation: heartbeat 2.2s infinite ease-in-out;
  transform-origin: center;
}

@keyframes float-subtle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.floating-elem {
  animation: float-subtle 4s ease-in-out infinite;
}

/* Blood Drop Glow */
.blood-glow {
  filter: drop-shadow(0 4px 12px rgba(220, 38, 38, 0.35));
}

/* Blood Type Badge Styling */
.blood-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

/* Modal Transitions */
.modal-overlay {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-content {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.modal-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-hidden .modal-content {
  transform: scale(0.95) translateY(10px);
}

/* Toast Notification */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 90vw;
  width: 380px;
}

.toast {
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Custom interactive compatibility matrix */
.matrix-cell-active {
  background-color: #DC2626 !important;
  color: #FFFFFF !important;
  border-color: #DC2626 !important;
  transform: scale(1.05);
}
