/* ABA Exam — Animations */
/* Extended timings for more realistic scene transitions */

/* === DOOR ANIMATIONS === */
.aba-door-animate-open {
    animation: aba-door-open 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform-origin: left center;
}

@keyframes aba-door-open {
    0%   { transform: perspective(800px) rotateY(0deg); }
    60%  { transform: perspective(800px) rotateY(-65deg); }
    85%  { transform: perspective(800px) rotateY(-80deg); }
    100% { transform: perspective(800px) rotateY(-78deg); }
}

.aba-door-animate-close {
    animation: aba-door-close 1.0s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transform-origin: left center;
}

@keyframes aba-door-close {
    0%   { transform: perspective(800px) rotateY(-78deg); }
    40%  { transform: perspective(800px) rotateY(-20deg); }
    80%  { transform: perspective(800px) rotateY(-3deg); }
    100% { transform: perspective(800px) rotateY(0deg); }
}

/* === CORRIDOR WALKING === */
.aba-walk-forward {
    animation: aba-corridor-walk 2.2s ease-in-out forwards;
}

@keyframes aba-corridor-walk {
    0%   { transform: scale(1) translateY(0);    opacity: 1; }
    40%  { transform: scale(1.15) translateY(-8px); opacity: 0.95; }
    100% { transform: scale(1.6) translateY(-30px); opacity: 0; }
}

/* Corridor zoom-in when entering OSCE */
.aba-corridor-zoom {
    animation: aba-corridor-zoom 1.8s ease-in forwards;
}

@keyframes aba-corridor-zoom {
    0%   { transform: scale(1) perspective(2000px) translateZ(0);   opacity: 1; }
    100% { transform: scale(2) perspective(2000px) translateZ(400px); opacity: 0; }
}

/* Room enter reveal */
.aba-room-enter {
    animation: aba-room-enter 1.0s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes aba-room-enter {
    0%   { clip-path: inset(0 50% 0 50%); opacity: 0.6; }
    60%  { clip-path: inset(0 5% 0 5%);  opacity: 0.9; }
    100% { clip-path: inset(0 0% 0 0%);  opacity: 1; }
}

/* === CLIPBOARD PAGE FLIP === */
.aba-clipboard-flip {
    animation: aba-flip-page 0.7s ease forwards;
    transform-style: preserve-3d;
}

@keyframes aba-flip-page {
    0%   { transform: rotateX(0deg);   opacity: 1; }
    40%  { transform: rotateX(-88deg); opacity: 0.4; }
    100% { transform: rotateX(0deg);   opacity: 1; }
}

/* === SLIDE TRANSITIONS === */
.aba-slide-in-right {
    animation: aba-slide-right 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes aba-slide-right {
    from { transform: translateX(60px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.aba-slide-in-left {
    animation: aba-slide-left 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes aba-slide-left {
    from { transform: translateX(-60px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

.aba-slide-in-up {
    animation: aba-slide-up 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes aba-slide-up {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.aba-slide-out-up {
    animation: aba-slide-out-up 0.4s ease forwards;
}

@keyframes aba-slide-out-up {
    from { transform: translateY(0);    opacity: 1; }
    to   { transform: translateY(-40px); opacity: 0; }
}

/* === FADE === */
.aba-fade-in {
    animation: aba-fade-in 0.4s ease forwards;
}

.aba-fade-out {
    animation: aba-fade-out 0.3s ease forwards;
}

@keyframes aba-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes aba-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* === SCALE POP === */
.aba-pop-in {
    animation: aba-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes aba-pop {
    0%   { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

/* === BELL SHAKE === */
.aba-bell-ring {
    animation: aba-bell 0.55s ease 3;
}

@keyframes aba-bell {
    0%, 100% { transform: rotate(0deg);  }
    20%      { transform: rotate(16deg); }
    40%      { transform: rotate(-13deg);}
    60%      { transform: rotate(9deg);  }
    80%      { transform: rotate(-5deg); }
}

/* === TYPING INDICATOR === */
.aba-typing-dots {
    display: inline-flex;
    gap: 4px;
    padding: 6px 0;
}

.aba-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aba-gray-400);
    animation: aba-typing-bounce 1.4s ease infinite;
}

.aba-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.aba-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aba-typing-bounce {
    0%, 60%, 100% { transform: translateY(0);   opacity: 0.4; }
    30%           { transform: translateY(-8px); opacity: 1;   }
}

/* === WRISTBAND === */
.aba-wristband-animate {
    animation: aba-wristband 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes aba-wristband {
    0%   { transform: scale(0) rotate(-12deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}

/* === PULSE === */
.aba-pulse {
    animation: aba-pulse 2s ease-in-out infinite;
}

@keyframes aba-pulse {
    0%, 100% { box-shadow: 0 0 0 0  rgba(0,48,135,0.35); }
    50%      { box-shadow: 0 0 0 14px rgba(0,48,135,0);   }
}

/* === STAGGER CHILDREN === */
.aba-stagger-children > * {
    opacity: 0;
    animation: aba-slide-up 0.4s ease forwards;
}
.aba-stagger-children > *:nth-child(1) { animation-delay: 0.06s; }
.aba-stagger-children > *:nth-child(2) { animation-delay: 0.14s; }
.aba-stagger-children > *:nth-child(3) { animation-delay: 0.22s; }
.aba-stagger-children > *:nth-child(4) { animation-delay: 0.30s; }
.aba-stagger-children > *:nth-child(5) { animation-delay: 0.38s; }
.aba-stagger-children > *:nth-child(6) { animation-delay: 0.46s; }
.aba-stagger-children > *:nth-child(7) { animation-delay: 0.54s; }

/* === SKELETON LOADING === */
.aba-skeleton {
    background: linear-gradient(90deg,
        var(--aba-gray-200) 25%,
        var(--aba-gray-100) 50%,
        var(--aba-gray-200) 75%);
    background-size: 200% 100%;
    animation: aba-skeleton-shimmer 1.6s ease infinite;
    border-radius: var(--aba-radius-sm);
}

@keyframes aba-skeleton-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* === HOVER LIFT === */
.aba-hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.aba-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--aba-shadow-md);
}

/* === SCENE OVERLAY (between scenes) === */
.aba-scene-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 35%, #2d3238 100%), #2d3238;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.aba-scene-overlay.entering {
    animation: aba-overlay-enter 0.55s ease forwards;
}

.aba-scene-overlay.leaving {
    animation: aba-overlay-leave 0.65s ease forwards;
}

@keyframes aba-overlay-enter {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes aba-overlay-leave {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* ABA logo shown on overlay */
.aba-overlay-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: aba-fade-in 0.4s ease 0.3s both;
}

.aba-overlay-logo-img {
    max-width: 112px;
    height: auto;
    object-fit: contain;
}

.aba-overlay-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--aba-gold-mid);
    border-radius: 50%;
    animation: aba-spin 0.8s linear infinite;
}

.aba-overlay-message {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    margin: 0;
    text-align: center;
    max-width: 280px;
}

.aba-report-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top, rgba(212,168,67,0.18), transparent 32%),
        linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(19,28,39,0.92) 30%, rgba(19,28,39,0.98) 100%);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.aba-report-progress-overlay.is-visible {
    opacity: 1;
}

.aba-report-progress-overlay.is-leaving {
    opacity: 0;
}

.aba-report-progress-card {
    width: min(100%, 460px);
    padding: 28px 26px 24px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.14);
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    box-shadow: 0 24px 60px rgba(0,0,0,0.38);
    backdrop-filter: blur(18px);
    color: #fff;
}

.aba-report-progress-logo {
    width: 92px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 18px;
}

.aba-report-progress-kicker {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.62);
    margin-bottom: 8px;
}

.aba-report-progress-title {
    margin: 0;
    text-align: center;
    font-size: 25px;
    line-height: 1.15;
    color: #fff;
}

.aba-report-progress-subtitle {
    margin: 12px 0 18px;
    text-align: center;
    font-size: 14px;
    color: rgba(255,255,255,0.82);
    min-height: 20px;
}

.aba-report-progress-bar {
    position: relative;
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    margin-bottom: 18px;
}

.aba-report-progress-fill {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(212,168,67,0.18), rgba(212,168,67,0.98), rgba(255,255,255,0.92));
    box-shadow: 0 0 16px rgba(212,168,67,0.35);
    animation: aba-report-progress-slide 1.35s ease-in-out infinite;
}

.aba-report-progress-steps {
    display: grid;
    gap: 10px;
}

.aba-report-progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.58);
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.aba-report-progress-step.is-active {
    background: rgba(212,168,67,0.14);
    border-color: rgba(212,168,67,0.42);
    color: rgba(255,255,255,0.96);
    transform: translateX(4px);
}

.aba-report-progress-step.is-complete {
    color: rgba(255,255,255,0.82);
}

.aba-report-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
    background: rgba(255,255,255,0.24);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.04);
}

.aba-report-progress-step.is-active .aba-report-progress-dot {
    background: #d4a843;
    box-shadow: 0 0 0 4px rgba(212,168,67,0.18), 0 0 14px rgba(212,168,67,0.42);
}

.aba-report-progress-step.is-complete .aba-report-progress-dot {
    background: rgba(212,168,67,0.72);
}

.aba-report-progress-text {
    font-size: 14px;
    line-height: 1.35;
}

@keyframes aba-report-progress-slide {
    0% { transform: translateX(-90%); }
    100% { transform: translateX(250%); }
}

/* === BELL NOTIFICATION === */
.aba-bell-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--aba-navy);
    color: white;
    padding: 14px 28px;
    border-radius: var(--aba-radius-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    z-index: 9000;
    box-shadow: var(--aba-shadow-lg);
    border: 2px solid var(--aba-gold);
    animation: aba-bell-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes aba-bell-pop {
    0%   { transform: translateX(-50%) scale(0.8); opacity: 0; }
    100% { transform: translateX(-50%) scale(1);   opacity: 1; }
}

.aba-bell-icon {
    font-size: 22px;
    animation: aba-bell 0.5s ease 2;
}

.aba-bell-text {
    font-weight: 700;
}

.aba-bell-subtext {
    font-size: 13px;
    opacity: 0.75;
    margin-top: 1px;
}

.aba-bell-notification.aba-fade-out {
    animation: aba-bell-fade-out 0.4s ease forwards;
}

@keyframes aba-bell-fade-out {
    0%   { transform: translateX(-50%); opacity: 1; }
    100% { transform: translateX(-50%); opacity: 0; }
}
