/* =============================================================
   التحريكات الديناميكية - One Teacher Platform
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&family=Cairo:wght@300;400;600;700;900&display=swap');

/* ===== Keyframes أساسية ===== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-25px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(25px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

@keyframes pulseSlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.05); opacity: 0.85; }
}

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

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.3); }
    50%       { box-shadow: 0 0 25px rgba(var(--color-primary-rgb), 0.6); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes bounceIn {
    0%  { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100%{ transform: scale(1); opacity: 1; }
}

@keyframes ripple {
    0%   { transform: scale(0); opacity: 0.7; }
    100% { transform: scale(4); opacity: 0; }
}

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

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50%       { transform: scaleY(0.5); }
}

@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes particle-float {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* ===== فئات التحريك ===== */

.animate-fade-in           { animation: fadeIn 0.5s ease-out forwards; }
.animate-fade-in-down      { animation: fadeInDown 0.5s ease-out forwards; }
.animate-fade-in-left      { animation: fadeInLeft 0.5s ease-out forwards; }
.animate-fade-in-right     { animation: fadeInRight 0.5s ease-out forwards; }
.animate-scale-in          { animation: scaleIn 0.4s ease-out forwards; }
.animate-bounce-in         { animation: bounceIn 0.6s ease-out forwards; }
.animate-float             { animation: float 3s ease-in-out infinite; }
.animate-pulse             { animation: pulse 2s ease-in-out infinite; }
.animate-glow              { animation: glow 2.5s ease-in-out infinite; }
.animate-spin              { animation: spin 1s linear infinite; }
.animate-gradient          { 
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite; 
}

/* تأخيرات الحركة */
.delay-100  { animation-delay: 0.1s; }
.delay-200  { animation-delay: 0.2s; }
.delay-300  { animation-delay: 0.3s; }
.delay-400  { animation-delay: 0.4s; }
.delay-500  { animation-delay: 0.5s; }
.delay-700  { animation-delay: 0.7s; }
.delay-1000 { animation-delay: 1s; }

/* ===== Skeleton Loading (انتظار جميل) ===== */
.skeleton {
    background: linear-gradient(90deg,
        rgba(var(--color-primary-rgb), 0.05) 25%,
        rgba(var(--color-primary-rgb), 0.12) 50%,
        rgba(var(--color-primary-rgb), 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius);
}

/* ===== خلفية الجسيمات ===== */
.particles-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    animation: particle-float linear infinite;
}

/* ===== Ripple Effect ===== */
.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: ripple 0.7s linear;
    pointer-events: none;
}

/* ===== Scroll Reveal (يُفعَّل بـ JS) ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== تحريك بطاقات الداشبورد ===== */
.card-animated {
    transition: transform 0.3s var(--transition), 
                box-shadow 0.3s var(--transition);
}

.card-animated:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* ===== Page Transition ===== */
.page-transition {
    animation: fadeIn 0.45s ease-out;
}

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