/**
 * Infinity Classes - Exact Exam Ready? Section Stylesheet
 * 100% Visual Recreation + Dynamic 3D Right-to-Left Sliding Deck
 * Brand Identity: Vibrant Orange (#FF4B0B)
 */

/* ==========================================================================
   1. SECTION CONTAINER
   ========================================================================== */
.er-section {
    position: relative;
    width: 100%;
    min-height: 540px;
    background-color: #FF4B0B;
    /* Subtle Micro-Dot Repeating Pattern */
    background-image: radial-gradient(rgba(255, 255, 255, 0.24) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    background-position: 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 50px 0;
}

/* Subtle Ambient Glow behind Cards */
.er-ambient-glow {
    position: absolute;
    top: 50%;
    right: 15%;
    transform: translateY(-50%);
    width: 680px;
    height: 440px;
    background: radial-gradient(ellipse at center, rgba(255, 120, 30, 0.45) 0%, rgba(255, 75, 11, 0.12) 60%, transparent 80%);
    filter: blur(70px);
    pointer-events: none;
    z-index: 1;
}

.er-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1536px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .er-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-left: clamp(30px, 4.5vw, 75px);
        padding-right: clamp(20px, 3vw, 40px);
    }
}

/* ==========================================================================
   2. LEFT SIDE – HERO CONTENT (42%)
   ========================================================================== */
.er-left-col {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 530px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

@media (min-width: 1024px) {
    .er-left-col {
        width: 42%;
        flex-shrink: 0;
    }
}

/* White Sticker Heading */
.er-sticker-wrapper {
    display: inline-block;
    margin-bottom: 22px;
}

.er-sticker-badge {
    display: inline-block;
    background-color: #FFFFFF;
    color: #FF4B0B;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(42px, 4.6vw, 70px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -3px;
    padding: 8px 26px 12px 26px;
    border-radius: 20px;
    transform: rotate(-2.5deg);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.er-sticker-badge:hover {
    transform: rotate(-1deg) scale(1.02);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

/* Description */
.er-description {
    font-family: 'Poppins', 'Plus Jakarta Sans', sans-serif;
    color: #FFFFFF;
    font-size: clamp(17px, 1.55vw, 24px);
    font-weight: 500;
    line-height: 1.35;
    max-width: 500px;
    margin: 0;
}

/* Primary CTA Button */
.er-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(260px, 22vw, 318px);
    height: 62px;
    margin-top: 32px;
    background-color: #FFFFFF;
    color: #FF4B0B;
    font-family: 'Poppins', 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(17px, 1.4vw, 21px);
    font-weight: 800;
    border-radius: 16px;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background-color 0.2s ease;
    cursor: pointer;
}

.er-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.22);
    background-color: #FFFDFB;
}

/* ==========================================================================
   3. RIGHT SIDE – 3D ROTATING TEST CARDS DECK (58%)
   ========================================================================== */
.er-right-col {
    position: relative;
    z-index: 3;
    width: 100%;
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

@media (min-width: 1024px) {
    .er-right-col {
        width: 58%;
        margin-top: 0;
        justify-content: flex-end;
    }
}

.er-deck-wrapper {
    position: relative;
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Stage Canvas for 3D Layered Cards */
.er-deck-stage {
    position: relative;
    width: 100%;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
}

@media (min-width: 1280px) {
    .er-deck-stage {
        height: 380px;
    }
}

/* ==========================================================================
   4. CARD BASE STYLING & POSITION TRANSITIONS
   ========================================================================== */
.er-card {
    position: absolute;
    top: 50%;
    width: 370px;
    height: 295px;
    border-radius: 26px;
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    user-select: none;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), 
                opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), 
                box-shadow 0.65s ease,
                background-color 0.5s ease,
                width 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

/* SLOT 1: LEFT BACKGROUND CARD (Peach, Peeking on left) */
.er-card.pos-left {
    left: 10px;
    transform: translateY(-47%) scale(0.88);
    background-color: #FFE2D6;
    z-index: 2;
    opacity: 0.94;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    cursor: pointer;
}

.er-card.pos-left:hover {
    transform: translateY(-49%) scale(0.9);
}

/* SLOT 2: CENTER FOREGROUND CARD (LARGER, WHITE, TOP Z-INDEX) */
.er-card.pos-active {
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: clamp(380px, 36vw, 540px);
    height: clamp(290px, 24vw, 335px);
    background-color: #FFFFFF;
    border-radius: 30px;
    padding: 32px 38px;
    z-index: 5;
    opacity: 1;
    box-shadow: 0 28px 70px -10px rgba(0, 0, 0, 0.34), 0 6px 20px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
}

.er-card.pos-active:hover {
    transform: translate(-50%, -53%) scale(1.015);
    box-shadow: 0 34px 80px -10px rgba(0, 0, 0, 0.4);
}

/* SLOT 3: RIGHT BACKGROUND CARD (Peach, Peeking on right) */
.er-card.pos-right {
    right: 10px;
    left: auto;
    transform: translateY(-47%) scale(0.88);
    background-color: #FFE2D6;
    z-index: 2;
    opacity: 0.94;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    cursor: pointer;
}

.er-card.pos-right:hover {
    transform: translateY(-49%) scale(0.9);
}

/* HIDDEN CARDS (Offscreen during carousel transitions) */
.er-card.pos-hidden-left {
    left: -220px;
    transform: translateY(-47%) scale(0.72);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
}

.er-card.pos-hidden-right {
    right: -220px;
    left: auto;
    transform: translateY(-47%) scale(0.72);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
}

/* ==========================================================================
   5. CARD INTERNAL TYPOGRAPHY & ELEMENTS
   ========================================================================== */
.er-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.er-card-tag {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.er-card.pos-active .er-card-tag {
    color: #64748B;
}

.er-card.pos-left .er-card-tag,
.er-card.pos-right .er-card-tag {
    color: #8C6A5D;
}

/* Badges */
.er-badge {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 8px;
    text-transform: uppercase;
}

.badge-hot {
    background-color: #FFF2EB;
    color: #FF4B0B;
}

.badge-imp {
    background-color: rgba(255, 255, 255, 0.7);
    color: #8C6A5D;
}

.badge-new {
    background-color: #ECFDF5;
    color: #059669;
}

.badge-popular {
    background-color: #EFF6FF;
    color: #2563EB;
}

/* Title & Subtitle */
.er-card-body {
    margin: 8px 0;
}

.er-card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.5px;
    margin: 0 0 6px 0;
    transition: font-size 0.3s ease, color 0.3s ease;
}

.er-card.pos-active .er-card-title {
    font-size: clamp(28px, 2.5vw, 36px);
    color: #111827;
}

.er-card.pos-left .er-card-title,
.er-card.pos-right .er-card-title {
    font-size: 26px;
    color: #2D1A12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.er-card-subtitle {
    font-family: 'Poppins', 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    margin: 0;
    transition: font-size 0.3s ease, color 0.3s ease;
}

.er-card.pos-active .er-card-subtitle {
    font-size: 18px;
    color: #64748B;
}

.er-card.pos-left .er-card-subtitle,
.er-card.pos-right .er-card-subtitle {
    font-size: 15px;
    color: #7A5C50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer / Meta Items & Button */
.er-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
}

.er-card-info-col {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.er-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.er-card.pos-active .er-meta-item {
    color: #556272;
}

.er-card.pos-left .er-meta-item,
.er-card.pos-right .er-meta-item {
    color: #7A5C50;
}

.er-meta-item i {
    font-size: 14px;
    opacity: 0.85;
}

/* Attempt Now Button */
.er-attempt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #111827;
    color: #FFFFFF;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.2s ease, 
                box-shadow 0.2s ease, 
                width 0.3s ease, 
                height 0.3s ease;
}

.er-card.pos-active .er-attempt-btn {
    width: clamp(170px, 15vw, 220px);
    height: 60px;
    font-size: 16px;
    pointer-events: auto;
}

.er-card.pos-left .er-attempt-btn,
.er-card.pos-right .er-attempt-btn {
    width: 140px;
    height: 48px;
    font-size: 14px;
    background-color: #2D1A12;
    pointer-events: none;
}

.er-attempt-btn:hover {
    transform: translateY(-2px);
    background-color: #000000;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

/* ==========================================================================
   6. CAROUSEL CONTROLS & INDICATOR DOTS
   ========================================================================== */
.er-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 18px;
    z-index: 6;
}

.er-ctrl-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(6px);
}

.er-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #FF4B0B;
    transform: scale(1.08);
}

.er-dots-track {
    display: flex;
    align-items: center;
    gap: 8px;
}

.er-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.er-dot.active {
    width: 28px;
    background-color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   7. ENTRANCE & RESPONSIVE ADJUSTMENTS
   ========================================================================== */
.er-fade-init {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.er-fade-visible {
    opacity: 1;
    transform: translateY(0) !important;
}

/* Laptop Screens (1024px to 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
    .er-deck-stage {
        transform: scale(0.9);
        transform-origin: center center;
    }
}

/* Tablet Screens (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .er-section {
        min-height: auto;
        padding: 55px 0;
    }

    .er-deck-stage {
        height: 350px;
        transform: scale(0.85);
    }
}

/* Mobile Screens (Under 768px - Exact Science Sangrah / Reference Recreation) */
@media (max-width: 767px) {
    .er-section {
        min-height: auto;
        padding: 40px 0 46px 0;
        background-color: #FF4B0B;
        background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1.5px, transparent 1.5px);
        background-size: 20px 20px;
        overflow: hidden;
    }

    .er-left-col {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .er-sticker-wrapper {
        margin-bottom: 12px;
        display: flex;
        justify-content: center;
    }

    /* Slanted White Sticker Badge matching Screenshot 2 */
    .er-sticker-badge {
        background-color: #FFFFFF !important;
        color: #FF4B0B !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15) !important;
        transform: rotate(-2.5deg) !important;
        padding: 7px 22px 9px 22px !important;
        font-size: 32px !important;
        font-weight: 900 !important;
        letter-spacing: -1.5px !important;
        border-radius: 16px !important;
        display: inline-block !important;
        user-select: none;
    }

    .er-description {
        font-size: 14.5px !important;
        font-weight: 500 !important;
        line-height: 1.42 !important;
        color: #FFFFFF !important;
        text-align: center !important;
        max-width: 325px !important;
        margin: 0 auto !important;
    }

    .er-right-col {
        margin-top: 22px;
        width: 100%;
        overflow: visible;
    }

    .er-deck-stage {
        height: 235px;
        position: relative;
    }

    /* Center Active Card - Pure White, Layered, Soft Shadow */
    .er-card.pos-active {
        width: 90%;
        max-width: 325px;
        height: auto;
        min-height: 175px;
        padding: 16px 18px;
        border-radius: 20px;
        background: #FFFFFF;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
        transform: translate(-50%, -50%) scale(1) !important;
        left: 50% !important;
        top: 50% !important;
        opacity: 1 !important;
        z-index: 5 !important;
        cursor: pointer;
    }

    /* Side Cards Peeking Out Behind */
    .er-card.pos-left {
        opacity: 0.38 !important;
        transform: translate(-96%, -50%) scale(0.82) !important;
        left: 50% !important;
        top: 50% !important;
        background: #FED7AA !important;
        border-radius: 20px !important;
        z-index: 2 !important;
        pointer-events: auto;
    }

    .er-card.pos-right {
        opacity: 0.38 !important;
        transform: translate(-4%, -50%) scale(0.82) !important;
        left: 50% !important;
        top: 50% !important;
        background: #FED7AA !important;
        border-radius: 20px !important;
        z-index: 2 !important;
        pointer-events: auto;
    }

    .er-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 6px;
    }

    .er-card-tag {
        font-size: 10.5px;
        font-weight: 800;
        color: #64748B;
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }

    .er-badge {
        font-size: 10.5px;
        font-weight: 800;
        padding: 2.5px 9px;
        border-radius: 9999px;
        letter-spacing: 0.5px;
    }

    .badge-imp {
        background-color: #E0F2FE;
        color: #0284C7;
    }

    .badge-hot {
        background-color: #FEE2E2;
        color: #DC2626;
    }

    .badge-new {
        background-color: #DCFCE7;
        color: #16A34A;
    }

    .badge-popular {
        background-color: #FEF3C7;
        color: #D97706;
    }

    .badge-free {
        background-color: #E0E7FF;
        color: #4F46E5;
    }

    .er-card-title {
        font-size: 18px !important;
        font-weight: 900 !important;
        color: #0F172A !important;
        line-height: 1.25 !important;
        margin: 0 !important;
    }

    .er-card-subtitle {
        font-size: 12px !important;
        font-weight: 500 !important;
        color: #64748B !important;
        margin-top: 2px !important;
        line-height: 1.3 !important;
    }

    /* Horizontal Footer Row: Left Meta Items, Right Dark Attempt Button */
    .er-card-footer {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-top: 14px !important;
        padding-top: 0 !important;
        border-top: none !important;
    }

    .er-card-info-col {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .er-meta-item {
        font-size: 11.5px;
        font-weight: 600;
        color: #64748B;
        display: flex;
        align-items: center;
        gap: 5px;
        line-height: 1.2;
    }

    .er-meta-item i {
        font-size: 12px;
        color: #94A3B8;
    }

    /* Attempt Now button matches Screenshot 2 (compact dark pill button) */
    .er-card.pos-active .er-attempt-btn {
        width: auto !important;
        height: auto !important;
        padding: 9px 18px !important;
        border-radius: 12px !important;
        background: #111827 !important;
        color: #FFFFFF !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        box-shadow: 0 4px 14px rgba(17, 24, 39, 0.3) !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
    }

    .er-card.pos-active .er-attempt-btn:hover {
        background: #000000 !important;
        transform: translateY(-1px) !important;
    }

    .er-carousel-controls {
        display: none !important; /* Cleaner mobile look like reference screenshot */
    }

    /* Bottom White Full-Width Pill Button matching Screenshot 2 */
    .er-cta-button {
        background: #FFFFFF !important;
        color: #FF4B0B !important;
        border-radius: 16px !important;
        font-size: 15.5px !important;
        font-weight: 800 !important;
        padding: 14px 20px !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16) !important;
        max-width: 325px !important;
        width: 90% !important;
        margin: 18px auto 0 auto !important;
        display: block !important;
        text-align: center !important;
        text-decoration: none !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    }

    .er-cta-button:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
        background: #FFFBF9 !important;
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .er-fade-init {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .er-card {
        transition: none !important;
    }
}
