@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeSlideUpAnimation {
    opacity: 0;
    /* hidden until animated */
    animation: fadeSlideUp 0.4s ease forwards;
}

/* New Loading Animations */
@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Login button spinner */
.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* Login button with spinner */
.login-btn {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Success checkmark animation */
@keyframes checkmark-circle {
    0% {
        stroke-dashoffset: 166;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes checkmark-check {
    0% {
        stroke-dashoffset: 36;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    margin-right: 8px;
    vertical-align: middle;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke: #fff;
    fill: none;
    animation: checkmark-circle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: checkmark-check 0.3s 0.3s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 2rem;
    width: 100%;
    height: 100%;
    min-height: 200px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4299e1;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

.loader-text {
    color: #4a5568;
    font-size: 0.9rem;
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    height: 16px;
    margin-bottom: 8px;
}


/* Test result animations */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

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

.fade-in-animation {
    animation: fadeIn 0.5s ease-in-out forwards;
}

.slide-in-animation {
    opacity: 0;
    animation: slideInRight 0.4s ease-in-out forwards;
}


/* Expandable sidebar section animations */
.nav-group-title.expandable {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.expand-icon {
    transition: transform 0.3s ease;
    font-size: 18px;
    font-weight: bold;
}

.nav-group-title.expandable.expanded .expand-icon {
    transform: rotate(45deg);
}

.collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    opacity: 0;
}

.collapsible.expanded {
    max-height: 2000px; /* Large enough for any number of items */
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

/* Individual item animation for collapsible sections */
.collapsible li {
    transform: translateX(-10px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    /* Remove the transition-delay here as we'll set it dynamically with JS */
}

/* Remove the static nth-child selectors since we're handling delays with JS */

/* Subject page animations */
@keyframes tabSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.subject-tab {
    animation: tabSlideIn 0.3s ease-out forwards;
    opacity: 0;
}

/* Content fade in animation */
@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.subject-content {
    animation: contentFadeIn 0.4s ease-out;
}

/* Tab hover and active animations */
.subject-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #3182ce;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.subject-tab:hover::after {
    width: 80%;
}

.subject-tab.active::after {
    width: 100%;
}

/* Small spinner for tabs loading */
.loader-spinner.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* Teacher card animations */
.teacher-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.teacher-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Content expansion animation */
@keyframes expandContent {
    0% {
        max-height: 0;
        opacity: 0;
    }
    100% {
        max-height: 500px;
        opacity: 1;
    }
}

.result-card.expanded .result-content {
    animation: expandContent 0.5s ease forwards;
}

.hidden {
    display: none !important;
}