/* الخطوط المعتمدة حصرياً: Tajawal + Diwani Bold */
/* arabic */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/assets/fonts/tajawal-7.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(/assets/fonts/tajawal-6.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/tajawal-1.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/tajawal-0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/tajawal-9.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/tajawal-8.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/tajawal-3.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/assets/fonts/tajawal-2.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* arabic */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/fonts/tajawal-5.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
/* latin */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(/assets/fonts/tajawal-4.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   الخطوط والتنسيقات الأساسية - Crystal Floral Blue
   ========================================================================== */

@font-face {
  font-family: 'Diwani Bold';
  src: url('/assets/fonts/Diwani-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #215589;
  --primary-dark: #163a5e;
  --secondary: #2f3a45;
  --bg-color: #fbf8f3;
  --accent-gold: #d4af37;
  --cfb-cw: 100vw;
  --cfb-gap: 250px;
  --cfb-off2: 150px;
  --cfb-garland: 50px;
}

@media (min-width: 768px) {
  :root {
    --cfb-gap: 500px;
    --cfb-off2: 300px;
    --cfb-garland: 100px;
  }
}

@media (min-width: 1024px) {
  :root {
    --cfb-cw: 898px;
    --cfb-gap: 600px;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', 'Cairo', 'Baskerville', sans-serif;
  background-color: #e5edf5;
  color: var(--secondary);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
}

/* ==========================================================================
   أنيميشن تساقط الأزهار والظرف (Envelope & Falling Petals Animations)
   ========================================================================== */

@keyframes ambient-fall {
  0% {
    transform: translateY(-8vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.8;
  }
  85% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(105vh) translateX(var(--sway, 25px)) rotate(360deg);
    opacity: 0;
  }
}

@keyframes seal-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 8px 22px rgba(20, 56, 94, 0.45);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 10px 28px rgba(20, 56, 94, 0.65);
  }
}

@keyframes seal-break {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: brightness(1);
  }
  40% {
    transform: scale(1.2) rotate(10deg);
    opacity: 0.9;
    filter: brightness(1.5);
  }
  100% {
    transform: scale(0) rotate(45deg);
    opacity: 0;
  }
}

@keyframes particle-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 50px)), calc(-50% + var(--dy, -50px))) scale(1.2) rotate(var(--rot-end, 180deg));
  }
}

@keyframes envelope-dissolve {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
    filter: blur(16px);
    pointer-events: none;
  }
}

@keyframes card-reveal {
  0% {
    opacity: 0.15;
    transform: scale(0.95) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes shine {
  0% {
    left: -100%;
  }
  20% {
    left: 200%;
  }
  100% {
    left: 200%;
  }
}

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

@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(33, 85, 137, 0.6);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 14px rgba(33, 85, 137, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(33, 85, 137, 0);
  }
}

/* ==========================================================================
   أزهار الخلفية المكررة (Garland Repeating Watermark)
   ========================================================================== */

.cfb-wm {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* صندوق البطاقة الأساسي */
.invitation-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--bg-color);
  color: var(--secondary);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  min-height: 100vh;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  .invitation-card {
    max-width: 820px;
    margin-top: 30px;
    margin-bottom: 50px;
    border-radius: 20px;
    border: 1px solid rgba(33, 85, 137, 0.15);
  }
}

/* ==========================================================================
   مشغل الموسيقى العائم (Floating Music Player - Creative Sound Waves)
   ========================================================================== */

.floating-music-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #215589, #14385e);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 25px rgba(20, 56, 94, 0.35), inset 0 1px 3px rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.floating-music-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.floating-music-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 30px rgba(20, 56, 94, 0.5);
}

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

.floating-music-btn.playing {
  animation: pulse-ring 2.2s infinite;
  border-color: rgba(212, 175, 55, 0.85);
}

.music-waves {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  height: 22px;
}

.wave-bar {
  width: 3px;
  height: 4px;
  border-radius: 99px;
  background-color: #ffffff;
  transition: height 0.3s ease, opacity 0.3s ease;
  opacity: 0.75;
}

/* حالة التوقف: شريط هادئ متساوي */
.floating-music-btn:not(.playing) .wave-bar {
  height: 4px;
  opacity: 0.7;
}

/* حالة التشغيل: موجات صوتية متحركة صعوداً وهبوطاً */
.floating-music-btn.playing .wave-bar {
  opacity: 1;
  animation: wave-bounce 1s ease-in-out infinite;
}

.floating-music-btn.playing .wave-bar:nth-child(1) {
  animation-delay: 0s;
  animation-duration: 0.85s;
}

.floating-music-btn.playing .wave-bar:nth-child(2) {
  animation-delay: 0.2s;
  animation-duration: 0.7s;
}

.floating-music-btn.playing .wave-bar:nth-child(3) {
  animation-delay: 0.4s;
  animation-duration: 0.9s;
}

.floating-music-btn.playing .wave-bar:nth-child(4) {
  animation-delay: 0.15s;
  animation-duration: 0.75s;
}

@keyframes wave-bounce {
  0%, 100% {
    height: 5px;
  }
  50% {
    height: 20px;
  }
}

/* ==========================================================================
   معرض الصور ثلاثي الأبعاد (3D Gallery Carousel)
   ========================================================================== */

.gallery-carousel {
  position: relative;
  width: 100%;
  height: 400px;
  perspective: 1400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  user-select: none;
  padding: 20px 0;
}

@media (min-width: 768px) {
  .gallery-carousel {
    height: 540px;
  }
}

.gallery-card {
  position: absolute;
  height: 82%;
  aspect-ratio: 2 / 3;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 22px 45px -12px rgba(22, 58, 94, 0.28), 0 8px 20px -6px rgba(22, 58, 94, 0.15);
  cursor: pointer;
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.9s ease, box-shadow 0.9s ease;
  will-change: transform, opacity;
  border: 3px solid rgba(255, 255, 255, 0.85);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   برنامج اليوم (Timeline)
   ========================================================================== */

.timeline-list {
  position: relative;
  margin: 0 auto;
  display: grid;
  width: 100%;
  max-width: 310px;
  grid-template-columns: 1fr 18px 1.35fr;
  align-items: center;
  column-gap: 14px;
  row-gap: 24px;
}

@media (min-width: 640px) {
  .timeline-list {
    max-width: 440px;
    grid-template-columns: 1fr 20px 1.25fr;
    column-gap: 20px;
    row-gap: 28px;
  }
}

.timeline-time {
  justify-self: end;
  text-align: center;
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(33, 85, 137, 0.15);
  padding: 4px 12px 2px;
  border-radius: 9999px;
  direction: ltr;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(33, 85, 137, 0.05);
}

.timeline-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.timeline-dot {
  position: relative;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33, 85, 137, 0.18);
  z-index: 2;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: -24px;
  width: 1.5px;
  transform: translateX(-50%);
  background-color: rgba(33, 85, 137, 0.22);
  z-index: 1;
}

@media (min-width: 640px) {
  .timeline-line {
    bottom: -28px;
  }
}

.timeline-title {
  justify-self: start;
  text-align: right;
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary);
  line-height: 1.4;
  padding-top: 2px;
}

@media (min-width: 640px) {
  .timeline-title {
    font-size: 17px;
  }
}

/* ==========================================================================
   صندوق الهدايا والتفاعل (Gift Box Animation)
   ========================================================================== */

.giftbox-interactive {
  position: relative;
  width: 260px;
  height: 270px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.giftbox-interactive:hover {
  transform: scale(1.04);
}

.giftbox-sparkle {
  position: absolute;
  color: var(--secondary);
  pointer-events: none;
  animation: float-gentle 2.5s infinite ease-in-out;
}

/* النوافذ المنبثقة (Modals) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background-color: rgba(16, 42, 68, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  background-color: var(--bg-color);
  width: 100%;
  max-width: 440px;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(33, 85, 137, 0.2);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  direction: rtl;
  text-align: right;
}

.modal-backdrop.active .modal-content {
  transform: translateY(0) scale(1);
}

/* التوست (Toast Notification) */
.toast-msg {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  z-index: 999999;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   ساعة العد التنازلي بالتقليب ثلاثي الأبعاد (3D Flip Countdown Clock)
   ========================================================================== */

.flip-countdown-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  direction: ltr;
}

@media (min-width: 768px) {
  .flip-countdown-wrapper {
    gap: 18px;
  }
}

.flip-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.flip-card {
  position: relative;
  width: 68px;
  height: 74px;
  perspective: 500px;
  border-radius: 14px;
  box-shadow: 0 6px 18px -4px rgba(33, 85, 137, 0.12), 0 2px 5px rgba(33, 85, 137, 0.05);
  border: 1px solid rgba(33, 85, 137, 0.12);
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 30px;
  user-select: none;
  background-color: #ffffff;
}

@media (min-width: 768px) {
  .flip-card {
    width: 84px;
    height: 90px;
    font-size: 38px;
    border-radius: 16px;
  }
}

.flip-top,
.flip-bottom,
.flip-leaf-front,
.flip-leaf-back {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  color: #215589;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-num {
  position: absolute;
  left: 0;
  width: 100%;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-top: 5px;
}

.flip-top .flip-num,
.flip-leaf-front .flip-num {
  top: 0;
}

.flip-bottom .flip-num,
.flip-leaf-back .flip-num {
  top: -100%;
}

.flip-top,
.flip-leaf-front {
  top: 0;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  transform-origin: bottom center;
}

.flip-bottom,
.flip-leaf-back {
  bottom: 0;
  border-bottom-left-radius: 13px;
  border-bottom-right-radius: 13px;
  background: linear-gradient(180deg, #f4f8fc 0%, #ffffff 100%);
  transform-origin: top center;
}

@media (min-width: 768px) {
  .flip-top,
  .flip-leaf-front {
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
  }
  .flip-bottom,
  .flip-leaf-back {
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
  }
}

/* أنيميشن التقليب للنصف العلوي والسفلي */
.flip-leaf-front {
  z-index: 3;
  transform: rotateX(0deg);
}

.flip-leaf-back {
  z-index: 2;
  transform: rotateX(90deg);
}

.flip-card.flipping .flip-leaf-front {
  animation: flip-top-down 0.28s ease-in forwards;
}

.flip-card.flipping .flip-leaf-back {
  animation: flip-bottom-up 0.28s 0.24s ease-out forwards;
}

/* خط المفصل فائق النعومة */
.flip-card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  right: 2px;
  height: 1px;
  background: rgba(33, 85, 137, 0.06);
  z-index: 10;
  pointer-events: none;
}

.flip-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(47, 58, 69, 0.78);
}

@keyframes flip-top-down {
  0% {
    transform: rotateX(0deg);
    filter: brightness(1);
  }
  100% {
    transform: rotateX(-90deg);
    filter: brightness(0.92);
  }
}

@keyframes flip-bottom-up {
  0% {
    transform: rotateX(90deg);
    filter: brightness(0.92);
  }
  100% {
    transform: rotateX(0deg);
    filter: brightness(1);
  }
}

@keyframes heart-beat {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(33, 85, 137, 0));
  }
  14% {
    transform: scale(1.14);
    filter: drop-shadow(0 0 3px rgba(33, 85, 137, 0.22));
  }
  26% {
    transform: scale(1.02);
    filter: drop-shadow(0 0 1px rgba(33, 85, 137, 0.08));
  }
  38% {
    transform: scale(1.09);
    filter: drop-shadow(0 0 2px rgba(33, 85, 137, 0.16));
  }
  56% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(33, 85, 137, 0));
  }
}

.heart-beating {
  display: inline-block;
  animation: heart-beat 2.2s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, filter;
}
