/* قفل أثناء تبديل الثيم */
html.ra-css-lock, html.ra-css-lock * {
  transition: none !important;
  animation: none !important;
}

/**
 * Royal Atelier — تأثيرات حركية موحّدة
 * خفيفة، سريعة، وتحترم prefers-reduced-motion
 */

/* ===== مفاتيح عامة ===== */
@keyframes ra-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ra-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ra-fade-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ra-scale-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes ra-slide-rtl {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes ra-pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(201, 168, 76, 0); }
}
@keyframes ra-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes ra-spin {
  to { transform: rotate(360deg); }
}
@keyframes ra-bounce-in {
  0% { opacity: 0; transform: scale(0.85); }
  60% { opacity: 1; transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ===== انتقالات أساسية ===== */
.card, .panel, .r67-card, .st-card, .settings-card,
.btn-neon, .btn, button.btn, .rnav-item, .nav-links li a,
.modal-box, .custom-alert-box, .dropdown-content, .actions-menu,
.royal-user-chip, #current-user-display, .dress-item {
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s ease,
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.2s ease,
    opacity 0.2s ease !important;
}

/* ===== بطاقات ===== */
.card, .r67-card, .st-card, .dashboard-cards .card {
  animation: ra-fade-up 0.4s ease both;
}
.dashboard-cards .card:nth-child(1) { animation-delay: 0.02s; }
.dashboard-cards .card:nth-child(2) { animation-delay: 0.05s; }
.dashboard-cards .card:nth-child(3) { animation-delay: 0.08s; }
.dashboard-cards .card:nth-child(4) { animation-delay: 0.11s; }
.dashboard-cards .card:nth-child(5) { animation-delay: 0.14s; }
.dashboard-cards .card:nth-child(6) { animation-delay: 0.17s; }
.dashboard-cards .card:nth-child(7) { animation-delay: 0.2s; }
.dashboard-cards .card:nth-child(8) { animation-delay: 0.23s; }

.card:hover, .r67-card:hover, .st-card:hover, .dashboard-cards .card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12) !important;
}
.card:active, .r67-card:active, .st-card:active {
  transform: translateY(-1px) scale(0.98) !important;
}

/* ===== أزرار ===== */
.btn-neon, .btn, button.btn, .quick-actions button {
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.15s ease !important;
}
.btn-neon:hover, .btn:hover, button.btn:hover, .quick-actions button:hover {
  transform: translateY(-2px) !important;
}
.btn-neon:active, .btn:active, button.btn:active, .quick-actions button:active {
  transform: translateY(0) scale(0.97) !important;
}

/* ===== قائمة تنقل ===== */
.rnav-item, .nav-links li a, .rtm-item {
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease !important;
}
.rnav-item:hover, .nav-links li a:hover, .rtm-item:hover {
  transform: translateX(-2px);
}
.rnav-item.active, .nav-links li.active a, .rtm-item.active {
  transition: background 0.25s ease, box-shadow 0.25s ease !important;
}

/* ===== نوافذ منبثقة ===== */
.modal-overlay.active, .modal-overlay.show,
.custom-alert-overlay.active, #security-modal-overlay.active {
  animation: ra-fade-in 0.2s ease both;
}
.modal-overlay.active .modal-box,
.modal-overlay.show .modal-box,
.custom-alert-box,
.security-modal-box,
.print-options-box,
#royal80-data-modal.active .royal80-box,
#quick-action-modal.active .modal-box {
  animation: ra-scale-in 0.28s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

/* ===== قوائم منسدلة ===== */
.dropdown-content.show, .dropdown-menu.show, .actions-menu.show,
#royal-actions-portal .dropdown-content {
  animation: ra-fade-down 0.2s ease both;
}

/* ===== قائمة علوية ===== */
#royal-top-menu {
  animation: ra-fade-down 0.25s ease both;
}
#royal-top-menu .rtm-group {
  animation: ra-fade-up 0.35s ease both;
}
#royal-top-menu .rtm-group:nth-child(1) { animation-delay: 0.03s; }
#royal-top-menu .rtm-group:nth-child(2) { animation-delay: 0.06s; }
#royal-top-menu .rtm-group:nth-child(3) { animation-delay: 0.09s; }
#royal-top-menu .rtm-group:nth-child(4) { animation-delay: 0.12s; }
#royal-top-menu .rtm-group:nth-child(5) { animation-delay: 0.15s; }

/* ===== أقسام عند التبديل ===== */
.section-container.active {
  animation: ra-fade-in 0.3s ease both;
}

/* ===== توست ===== */
.royal-toast, #royal-toast-host .royal-toast {
  animation: ra-slide-rtl 0.3s ease both;
}
.royal-toast.out {
  animation: ra-fade-in 0.2s ease reverse both;
}

/* ===== شارة المستخدم ===== */
#current-user-display, .royal-user-chip, #r78-chip {
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
#current-user-display:hover, .royal-user-chip:hover {
  transform: scale(1.03) !important;
}

/* ===== عناصر الفساتين ===== */
.dress-item {
  transition: transform 0.2s ease, box-shadow 0.25s ease !important;
}
.dress-item:hover {
  transform: translateY(-2px) !important;
}

/* ===== تحميل / انتظار ===== */
.ra-spin, .fa-spinner, .fa-sync.spinning {
  animation: ra-spin 0.8s linear infinite;
}

/* ===== تأثير ظهور عند التمرير (يُفعَّل بالكلاس) ===== */
.ra-enter {
  animation: ra-fade-up 0.4s ease both;
}
.ra-enter-scale {
  animation: ra-scale-in 0.35s ease both;
}

/* ===== تبديل الثيم — وميض خفيف ===== */
html.ra-theme-switching body {
  animation: ra-fade-in 0.35s ease both;
}

/* ===== مستقبلي: توهج خفيف على hover ===== */
html[data-royal-shape="futuristic"] .btn-neon:hover,
html[data-royal-shape="futuristic"] .quick-actions button:hover {
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35) !important;
}
html[data-royal-shape="futuristic"] .card:hover,
html[data-royal-shape="futuristic"] .r67-card:hover {
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.15) !important;
}

/* ===== زجاجي: رفع ناعم ===== */
html[data-royal-shape="glass"] .card:hover,
html[data-royal-shape="glass"] .panel:hover {
  box-shadow: 0 12px 36px rgba(100, 80, 180, 0.18) !important;
}

/* ===== تقليل الحركة لذوي الحساسية ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
