/* flashcards.css */

/* Container adjustments to work within ActivityManager */
.activity-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 94px); /* Subtract the header height */
}

/* Make sure container fills the available space */
.container.h-100 {
    /*height: 100% !important;
    display: flex;
    flex-direction: column;*/
}

/* Card Container */
.card-container {
    overflow: hidden;
    position: relative;
    border-radius: var(--border-radius, 0.5rem);
    box-shadow: 0 0 0 0.2rem var(--secondary-color-rgba-50, rgba(108, 117, 125, 0.5));
    border: 0.0625rem solid var(--secondary-color-dark, #5a6268);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Card Top Section */
.card-container .card-top {
    background-color: var(--secondary-color, #6c757d);
    padding: 1.5rem;
    border-top-left-radius: var(--border-radius, 0.5rem);
    border-top-right-radius: var(--border-radius, 0.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-container .card-heading {
    color: var(--white, white);
    text-align: center;
    font-size: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    width: 100%;
}

/* Study Card Image Container */
.study-card-image-container {
    width: 100%;
    height: 180px;
    border-radius: var(--half-radius, 0.25rem);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.1);
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Loading indicator */
.image-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* Image Error Fallback */
.image-error-fallback {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    background-color: var(--md-yellow-400, #ffee58);
    border-radius: var(--half-radius, 0.25rem);
}

.image-error-fallback i {
    color: var(--black);
    line-height: 1;
}

.image-error-fallback p {
    text-align: center;
    margin: 0.5rem 0;
    color: var(--black);
}

.image-error-fallback button {
    margin-top: 0.5rem;
}

/* Card Bottom Section */
.card-container .card-bottom {
    background-color: var(--white, white);
    padding: 1.5rem;
    border-bottom-left-radius: var(--border-radius, 0.5rem);
    border-bottom-right-radius: var(--border-radius, 0.5rem);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.card-container .card-bottom h6 {
    color: var(--md-gray-600, #6c757d);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.card-container .card-bottom .card-text {
    color: var(--black, #212529);
    font-size: 1rem;
}

/* Flashcard Progress */
.progress-indicator {
    height: 0.625rem;
    margin: 1rem 0;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.progress-indicator .progress-bar {
    flex: 1;
    max-width: 3rem;
    background-color: var(--md-gray-100, #f8f9fa);
    border-radius: 0.3125rem;
    transition: background-color 0.3s ease;
}

.progress-indicator .progress-bar.active {
    background-color: var(--md-deep-orange-400);
}

/* Layout helper classes */
.flashcard-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.flashcard-footer {
    margin-top: auto;
    padding-bottom: 1rem;
}

.card-progress {
    font-size: 1.2rem;
    margin: 0 1rem;
}

/* Animation */
.animate__animated {
    --animate-duration: 0.3s;
}

.animate__fadeOutLeft {
    transform: translateX(-1.25rem);
    opacity: 0;
}

.animate__fadeOutRight {
    transform: translateX(1.25rem);
    opacity: 0;
}

.animate__fadeInLeft,
.animate__fadeInRight {
    transform: translateX(0);
    opacity: 1;
}

/* Row inside flashcard-content */
.row.justify-content-center {
    width: 100%;
    margin: 0;
}

/* Responsive adjustments */
@media (max-height: 768px) {
    .study-card-image-container {
        height: 150px;
    }

    .card-container .card-top,
    .card-container .card-bottom {
        padding: 1rem;
    }
}

@media (max-height: 576px) {
    .study-card-image-container {
        height: 120px;
    }

    .card-heading {
        font-size: 1.25rem;
    }
}
