/* ==========================================
   أكاديمية أسيست - Frontend Enhancements CSS
   ========================================== */

/* ─── SCROLL ANIMATIONS ───────────────────── */
.anim-hidden {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

/* ─── SHAKE ANIMATION ─────────────────────── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
    90% { transform: translateX(4px); }
}
.shake { animation: shake 0.55s ease; }


/* ─── HERO STATS BAR ──────────────────────── */
.hero-stats-bar {
    display: flex;
    gap: 32px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    min-width: 110px;
}

.hero-stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.hero-stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}


/* ─── TOAST NOTIFICATIONS ─────────────────── */
#toastContainer {
    position: fixed;
    bottom: 32px;
    left: 32px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 380px;
    width: calc(100vw - 64px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(26, 58, 92, 0.18);
    border: 1px solid rgba(74, 144, 226, 0.15);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-main);
    pointer-events: auto;
    transform: translateX(-110%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 4px;
    border-radius: 0 14px 14px 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(-110%);
    opacity: 0;
}

.toast-success::before { background: var(--color-success); }
.toast-error::before   { background: var(--color-danger); }
.toast-warning::before { background: #F59E0B; }
.toast-info::before    { background: var(--color-secondary); }

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}
.toast-success .toast-icon { color: var(--color-success); }
.toast-error .toast-icon   { color: var(--color-danger); }
.toast-warning .toast-icon { color: #F59E0B; }
.toast-info .toast-icon    { color: var(--color-secondary); }

.toast-msg {
    flex: 1;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.toast-close:hover { color: var(--color-text-main); }


/* ─── FLOATING WHATSAPP BUTTON ────────────── */
.floating-whatsapp {
    position: fixed;
    bottom: 36px;
    right: 36px;
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 0;
    background: #25D366;
    color: white;
    border-radius: 50px;
    padding: 14px 18px;
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.45);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    max-width: 58px;
}

.floating-whatsapp:hover {
    max-width: 220px;
    padding: 14px 22px;
    box-shadow: 0 12px 36px rgba(37, 211, 102, 0.6);
    transform: translateY(-3px);
}

.floating-whatsapp i {
    font-size: 1.6rem;
    flex-shrink: 0;
    transition: margin 0.3s ease;
}

.floating-whatsapp .wa-text {
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transition: max-width 0.35s ease, opacity 0.25s ease, margin 0.3s ease;
    font-size: 0.92rem;
}

.floating-whatsapp:hover .wa-text {
    max-width: 160px;
    opacity: 1;
    margin-right: 10px;
}

@keyframes waPulse {
    0% { box-shadow: 0 8px 28px rgba(37, 211, 102, 0.45); }
    50% { box-shadow: 0 8px 40px rgba(37, 211, 102, 0.75), 0 0 0 10px rgba(37, 211, 102, 0.1); }
    100% { box-shadow: 0 8px 28px rgba(37, 211, 102, 0.45); }
}
.floating-whatsapp {
    animation: waPulse 2.5s ease-in-out infinite;
}
.floating-whatsapp:hover {
    animation: none;
}


/* ─── SCROLL TO TOP BUTTON ────────────────── */
#scrollTopBtn {
    position: fixed;
    bottom: 104px;
    right: 36px;
    z-index: 4999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-secondary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    opacity: 0;
    transform: scale(0.7) translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
#scrollTopBtn.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}
#scrollTopBtn:hover {
    background: var(--color-primary);
    transform: scale(1.1) translateY(-2px);
}


/* ─── LIGHTBOX ────────────────────────────── */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

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

.lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#lightboxImg {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.25s ease;
    display: block;
}

#lightboxCaption {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-main);
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: -48px;
    left: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 9991;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.25); transform: translateY(-50%) scale(1.1); }
#lightboxPrev { right: 24px; }
#lightboxNext { left: 24px; }

.gallery-item-image::after {
    content: '\f00e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.gallery-item-image:hover::after { opacity: 1; }


/* ─── MULTI-STEP FORM ─────────────────────── */
.form-steps-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 36px;
    padding: 0 16px;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
}

.step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(-50% + 20px);
    width: calc(100% - 40px);
    height: 2px;
    background: var(--color-card-border);
    transition: background 0.4s ease;
    z-index: 0;
}

.step-indicator.completed:not(:last-child)::after {
    background: var(--color-secondary);
}

.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-card-bg);
    border: 2px solid var(--color-card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-text-muted);
    transition: all 0.35s ease;
    position: relative;
    z-index: 1;
}

.step-indicator.active .step-num {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: white;
    box-shadow: 0 0 0 6px rgba(74, 144, 226, 0.18);
}

.step-indicator.completed .step-num {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.step-indicator.completed .step-num::after {
    content: '✓';
    position: absolute;
}

.step-indicator.completed .step-num > span { display: none; }

.step-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-muted);
    white-space: nowrap;
    transition: color 0.3s;
}
.step-indicator.active .step-label { color: var(--color-secondary); }
.step-indicator.completed .step-label { color: var(--color-success); }

.form-step {
    display: none;
    flex-direction: column;
    gap: 0;
    animation: stepFadeIn 0.4s ease;
}

.form-step.active-step {
    display: flex;
}

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

.step-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .step-form-grid { grid-template-columns: 1fr; }
}

.step-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}


/* ─── TESTIMONIALS SECTION ────────────────── */
.testimonials-section {
    padding: 80px 0;
    background: linear-gradient(180deg, rgba(74, 144, 226, 0.04) 0%, var(--color-bg) 100%);
}

.testimonials-wrapper {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
}

.testimonials-track {
    position: relative;
    min-height: 300px;
    overflow: hidden;
}

.testimonial-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--border-radius-lg);
    padding: 40px 48px;
    box-shadow: var(--box-shadow-premium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
}

.testimonial-card.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    position: relative;
}

.testimonial-card.prev {
    opacity: 0;
    transform: translateX(-40px);
}

.testimonial-stars {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.testimonial-stars i {
    color: #F59E0B;
    font-size: 1.1rem;
}

.testimonial-text {
    font-size: 1.1rem;
    color: var(--color-text-main);
    line-height: 1.8;
    margin-bottom: 28px;
    position: relative;
}

.testimonial-text::before {
    content: '"';
    font-size: 5rem;
    color: rgba(74, 144, 226, 0.12);
    position: absolute;
    top: -20px;
    right: -10px;
    line-height: 1;
    font-family: serif;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    border: 3px solid rgba(74, 144, 226, 0.2);
}

.author-info h5 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.author-info p {
    font-size: 0.85rem;
    color: var(--color-secondary);
    font-weight: 600;
}

.testimonials-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 32px;
}

.testimonial-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    color: var(--color-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}
.testimonial-nav-btn:hover {
    background: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
    transform: scale(1.1);
}

.testimonials-dots {
    display: flex;
    gap: 8px;
}

.testimonial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-card-border);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.testimonial-dot.active {
    background: var(--color-secondary);
    transform: scale(1.3);
    width: 28px;
    border-radius: 5px;
}


/* ─── LAZY LOADING IMAGES ─────────────────── */
img[data-src] {
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: blur(4px);
}
img.loaded {
    opacity: 1;
    filter: blur(0);
}


/* ─── RESPONSIVE ──────────────────────────── */
@media (max-width: 768px) {
    .floating-whatsapp {
        bottom: 24px;
        right: 24px;
    }
    #scrollTopBtn {
        bottom: 88px;
        right: 24px;
    }
    #toastContainer {
        bottom: 20px;
        left: 16px;
        right: 16px;
        max-width: 100%;
        width: auto;
    }
    .testimonial-card {
        padding: 28px 24px;
    }
    .hero-stats-bar {
        gap: 12px;
    }
    .hero-stat-item {
        padding: 12px 14px;
        min-width: 90px;
    }
    .hero-stat-num {
        font-size: 1.6rem;
    }
    #lightboxPrev { right: 8px; }
    #lightboxNext { left: 8px; }
    .form-steps-progress {
        padding: 0 4px;
    }
    .step-label {
        font-size: 0.65rem;
    }
}
