/* Frame Animation Plus  */
.frame-animation {
    position: relative;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
}

.frame-animation img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: contain; /* Maintains proportions, fits into container */
    transition: opacity 0.1s ease-in-out;
}

/* If you need to fill the entire container (may crop the image) */
.frame-animation.fill-container img {
    object-fit: cover;
}

/* If you need a fixed height with adaptive width */
.frame-animation.fixed-height {
    height: auto;
}

.frame-animation.fixed-height img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Controls */
.frame-animation .play-pause-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
    transition: background-color 0.2s ease;
}

.frame-animation .play-pause-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.frame-animation .play-pause-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading indicator */
.frame-animation .loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile-friendly */
@media (max-width: 768px) {
    .frame-animation .play-pause-btn {
        bottom: 5px;
        left: 5px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .frame-animation .loading-indicator {
        padding: 8px 15px;
        font-size: 12px;
    }
}

/* Special classes for different zoom modes */
.frame-animation.responsive {
    width: 100%;
    max-width: 100%;
}

.frame-animation.responsive img {
    width: 100%;
    height: auto;
}

/* For square containers */
.frame-animation.square {
    aspect-ratio: 1 / 1;
}

.frame-animation.square img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* For large-format containers */
.frame-animation.wide {
    aspect-ratio: 16 / 9;
}

.frame-animation.wide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}