/* ============ ZODIAC SLIDE CARD STYLES ============ */

/* Zodiac card container */
.zodiac-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Fix for blur: Force hardware acceleration but without sub-pixel rendering issues */
    backface-visibility: hidden;
    transform: translateZ(0);
}

.zodiac-card:hover,
.zodiac-card:active {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.zodiac-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    /* Fix for blur: Ensure no 3D transform is active on inner container */
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}

.zodiac-card-front,
.zodiac-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    /* Removed padding to eliminate border gaps */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* FRONT STATE */
.zodiac-card-front {
    z-index: 2;
    opacity: 1;
    transform: translateY(0);
}

.zodiac-card-front img {
    width: 100%;
    height: 100%;
    /* Fill the entire height */
    object-fit: cover;
    /* Cover the area to avoid white space */
    margin-bottom: 0;
    /* Remove margin */
}

.zodiac-card-front h3 {
    margin: 0;
    padding: 1rem;
    /* Add padding here instead of the container */
    background: rgba(255, 255, 255, 0.8);
    /* Optional: semi-transparent background for readability */
    width: 100%;
    position: absolute;
    bottom: 0;
    color: #1A1A1A;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    /* Clean text rendering */
    text-shadow: none;
}

/* BACK STATE (Hidden initially) */
.zodiac-card-back {
    z-index: 3;
    opacity: 0;
    transform: translateY(100%);
    /* Start from bottom */
    background: linear-gradient(135deg, #FFFBF5 0%, #FFFFFF 100%);
    padding: 1rem;
    /* Base padding on desktop to keep text off edges */
}

/* HOVER EFFECTS */
.zodiac-card:hover .zodiac-card-front,
.zodiac-card:active .zodiac-card-front {
    opacity: 0.5;
    /* Fade out slightly */
    transform: scale(0.95);
    /* Shrink slightly */
}

.zodiac-card:hover .zodiac-card-back,
.zodiac-card:active .zodiac-card-back {
    opacity: 1;
    transform: translateY(0);
    /* Slide up to fill */
}

/* Back Content Styling */
.zodiac-card-back h3 {
    color: #591C21;
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    /* Clean text rendering */
    text-shadow: none;
}

.zodiac-card-back p {
    color: #333;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 1rem;
    /* Clean text rendering */
    text-shadow: none;
}

.btn-zodiac {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: #591C21;
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(89, 28, 33, 0.2);
}

.btn-zodiac:hover {
    background-color: #F0A500;
    color: #591C21;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 165, 0, 0.3);
}

/* ============ TABLET ADJUSTMENTS ============ */
@media (max-width: 900px) {
    .zodiac-card-back {
        padding: 0.8rem;
    }

    .zodiac-card-back h3 {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }

    .zodiac-card-back p {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 5;
        -webkit-box-orient: vertical;
        line-clamp: 5;
        overflow: hidden;
    }

    .btn-zodiac {
        padding: 0.4rem 1.2rem;
        font-size: 0.8rem;
    }
}

/* ============ MOBILE ADJUSTMENTS ============ */
@media (max-width: 480px) {

    /* --- Front Side --- */
    .zodiac-card-front {
        padding: 0;
        justify-content: flex-start;
        align-items: center;
    }

    /* Image fills upper 80% of the card, full-width, no crop */
    .zodiac-card-front img {
        width: 100%;
        height: 100%;
        /* Fill the whole card */
        object-fit: cover;
        /* Cover the area */
        background: transparent;
        /* Remove warm background */
        margin-bottom: 0;
    }

    .zodiac-card-front h3 {
        font-size: 0.85rem;
        font-weight: 700;
        margin: 0;
        padding: 0.5rem 0.4rem;
        text-align: center;
        background: rgba(255, 255, 255, 0.8);
        width: 100%;
        position: absolute;
        bottom: 0;
    }

    .zodiac-card-back {
        padding: 0.5rem;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    .zodiac-card-back h3 {
        font-size: 0.95rem;
        margin-bottom: 0.2rem;
        line-height: 1.2;
    }

    .zodiac-card-back p {
        font-size: 0.70rem;
        line-height: 1.25;
        margin-bottom: 0.6rem;
        /* Show only a few lines to keep it tidy */
        display: -webkit-box;
        -webkit-line-clamp: 5;
        -webkit-box-orient: vertical;
        line-clamp: 5;
        overflow: hidden;
    }

    .btn-zodiac {
        padding: 0.35rem 1rem;
        font-size: 0.75rem;
        border-radius: 20px;
    }
}