.animal-world-post {
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px;
}

.card-viewport {
    position: relative;
    min-height: 400px;
    margin-bottom: 30px;
    perspective: 1000px;
}

.animal-card {
    width: 100%;
    height: 550px;
    position: absolute;
    top: 0;
    left: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-radius: 15px;
    overflow: hidden;
    color: white;
    display: flex;
    /* flex-direction: column; */
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.animal-card .featured-image {
    /* height: 180px; */
    overflow: hidden;
    position: relative;
    width: 50%;
}

.animal-card .featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.animal-card:hover .featured-image img {
    transform: scale(1.08);
}

.card-content {
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.2) 0%, 
        rgba(0,0,0,0.6) 100%);
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 50%;
}

.animal-card h2 {
    margin: 0 0 15px 0;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    font-size: 1.8em;
}

.animal-card .post-content {
    overflow-y: auto;
    flex-grow: 1;
    max-height: 330px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    line-height: 1.6;
}

.repeater-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 180px;
}

.error {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
}
.repeater-button {
    padding: 12px 25px;
    /* background: linear-gradient(135deg, #6e8efb, #a777e3); */
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.repeater-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.repeater-button:active {
    transform: translateY(0);
}

.loader-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.7);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    border-radius: 15px;
}

.loader-container.active {
    opacity: 1;
    pointer-events: all;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(167, 119, 227, 0.3);
    border-top-color: #a777e3;
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

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

/* Animation Classes */
.card-enter-next {
    animation: slideInFromRight 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card-enter-prev {
    animation: slideInFromLeft 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card-exit-next {
    animation: slideOutToLeft 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card-exit-prev {
    animation: slideOutToRight 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes slideInFromRight {
    from { transform: translateX(100%) rotateY(20deg) scale(0.9); opacity: 0; }
    to { transform: translateX(0) rotateY(0) scale(1); opacity: 1; }
}

@keyframes slideInFromLeft {
    from { transform: translateX(-100%) rotateY(-20deg) scale(0.9); opacity: 0; }
    to { transform: translateX(0) rotateY(0) scale(1); opacity: 1; }
}

@keyframes slideOutToLeft {
    from { transform: translateX(0) rotateY(0) scale(1); opacity: 1; }
    to { transform: translateX(-100%) rotateY(-20deg) scale(0.9); opacity: 0; }
}

@keyframes slideOutToRight {
    from { transform: translateX(0) rotateY(0) scale(1); opacity: 1; }
    to { transform: translateX(100%) rotateY(20deg) scale(0.9); opacity: 0; }
}
@media (max-width: 768px) {
    .animal-card{
        flex-direction: column;
    }
    .animal-card .featured-image{
        width: 100%;
    }
    .animal-card .card-content{
        width: 100%;
    }
    .animal-card .post-content{
        max-height: 330px;
    }
}
