/* ============================================================
   GLOBAL ANIMATIONS & MOTION EFFECTS — A2Z Faculty
   ============================================================ */

/* ===== Scroll Reveal Base ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Direction Variants */
.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays for children */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ===== Fade In Keyframes ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

/* Animation utility classes */
.anim-fade-up    { animation: fadeInUp 0.7s ease both; }
.anim-fade-down  { animation: fadeInDown 0.7s ease both; }
.anim-fade-left  { animation: fadeInLeft 0.7s ease both; }
.anim-fade-right { animation: fadeInRight 0.7s ease both; }
.anim-fade-in    { animation: fadeIn 0.6s ease both; }
.anim-scale-in   { animation: scaleIn 0.6s ease both; }

/* ===== Floating / Hover Effects ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

.pulse-hover:hover {
    animation: gentlePulse 0.6s ease;
}

/* ===== Gradient Shift ===== */
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

/* ===== Shimmer / Skeleton Loading ===== */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ===== Counter / Number Animation ===== */
.counter-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    display: inline-block;
}

/* ===== Typing Cursor ===== */
@keyframes blink {
    0%, 100% { border-color: transparent; }
    50%      { border-color: var(--primary); }
}

.typing-cursor::after {
    content: '|';
    animation: blink 0.8s step-end infinite;
    color: var(--primary);
    font-weight: 300;
}

/* ===== Underline Grow ===== */
.underline-grow {
    position: relative;
    display: inline-block;
}

.underline-grow::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #0dcaf0);
    border-radius: 2px;
    transition: width 0.5s ease, left 0.5s ease;
}

.underline-grow.visible::after,
.underline-grow:hover::after {
    width: 100%;
    left: 0;
}

/* ===== Icon Bounce ===== */
@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40%  { transform: translateY(-8px); }
    60%  { transform: translateY(-4px); }
}

.icon-bounce:hover i {
    animation: iconBounce 0.6s ease;
}

/* ===== Card Tilt on Hover ===== */
.tilt-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.tilt-card:hover {
    transform: perspective(800px) rotateY(-3deg) rotateX(2deg) translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* ===== Glow Effect ===== */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(13, 110, 253, 0.3); }
    50%      { box-shadow: 0 0 20px rgba(13, 110, 253, 0.5), 0 0 40px rgba(13, 110, 253, 0.2); }
}

.glow-on-hover:hover {
    animation: glow 1.5s ease infinite;
}

/* ===== Parallax-like depth layers ===== */
.parallax-slow  { transition: transform 0.3s ease; }
.parallax-fast  { transition: transform 0.15s ease; }

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(1, 41, 112, 0.5);
}

/* ===== Stats Section ===== */
.stats-section {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--navy) 100%);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.1) 0%, transparent 60%);
    animation: float 8s ease-in-out infinite;
}

.stat-item {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.stat-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5rem;
    color: #0dcaf0;
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover .stat-icon {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.95rem;
    opacity: 0.85;
    font-weight: 400;
}

/* ===== How It Works ===== */
.how-it-works {
    padding: 70px 0;
    background: white;
}

.step-card {
    text-align: center;
    padding: 30px 20px;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #0dcaf0);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
    transition: transform 0.3s ease;
}

.step-card:hover .step-number {
    transform: scale(1.15) rotate(10deg);
}

.step-connector {
    position: absolute;
    top: 50px;
    right: -15%;
    width: 30%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #0dcaf0);
    opacity: 0.4;
}

/* ===== Testimonials ===== */
.testimonials-section {
    padding: 70px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, rgba(13, 110, 253, 0.05) 100%);
}

.testimonial-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 4rem;
    color: rgba(13, 110, 253, 0.1);
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.testimonial-text {
    font-style: italic;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #0dcaf0);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.testimonial-name {
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 2px;
}

.testimonial-role {
    font-size: 0.85rem;
    color: #888;
}

/* ===== Timeline (About Page) ===== */
.timeline {
    position: relative;
    padding: 30px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary), #0dcaf0);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
    padding-right: 50px;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
    padding-left: 50px;
}

.timeline-dot {
    position: absolute;
    top: 30px;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px var(--primary);
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -8px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -8px;
}

.timeline-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-3px);
}

.timeline-year {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* ===== Partners / Trust Bar ===== */
.trust-bar {
    padding: 40px 0;
    background: white;
    text-align: center;
}

.trust-bar p {
    color: #999;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
}

@keyframes scrollLogos {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.logo-track {
    display: flex;
    animation: scrollLogos 20s linear infinite;
    width: max-content;
}

.logo-track img {
    height: 40px;
    margin: 0 40px;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.logo-track img:hover {
    opacity: 1;
    filter: grayscale(0%);
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .stat-number   { font-size: 2rem; }
    .stat-icon     { width: 55px; height: 55px; font-size: 1.2rem; }
    .counter-value { font-size: 2rem; }

    .timeline::before { left: 20px; }
    .timeline-item { width: 100%; left: 0 !important; padding-left: 50px !important; padding-right: 20px !important; text-align: left !important; }
    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot { left: 12px !important; right: auto !important; }

    .step-connector { display: none; }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-left, .reveal-right, .reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .float-animation { animation: none; }
    .gradient-animated { animation: none; }
    .logo-track { animation: none; }
    .back-to-top { transition: none; }
}
