/* --- VARIABLES --- */
:root {
    --efp-primary: #4f46e5;
    --efp-primary-dark: #4338ca;
    --efp-secondary: #10b981;
    --efp-danger: #ef4444;
    --efp-gold: #f59e0b;
    --efp-bg: #f9fafb;
    --efp-text: #111827;
    --efp-radius: 24px;

    /* New Palette from Design */
    --efp-lavender-bg: #e0e7ff;
    --efp-lavender-text: #4338ca;
    --efp-premium-bg: #fff7ed;
    --efp-premium-text: #c2410c;
    /* warmer orange */
    --efp-card-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
}

/* --- WRAPPER --- */
.efp-frontend-wrapper {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--efp-bg);
    min-height: 600px;
    position: relative;
    overflow: hidden;
    padding-bottom: 60px;
}

/* --- HEADER --- */
.efp-header-bg {
    background: #3b82f6;
    /* Modern solid blue from reference */
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    padding: 3.5rem 1rem 5rem;
    color: white;
    text-align: center;
    border-radius: 0 0 40px 40px;
    margin-bottom: -45px;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.efp-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.efp-logo-icon {
    font-size: 2.5rem;
    color: white;
    display: flex;
    align-items: center;
}

.efp-header-title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.efp-header-subtitle {
    opacity: 0.95;
    margin-top: 5px;
    font-weight: 500;
    font-size: 1.15rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Bar */
.efp-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin-top: 25px;
}

.efp-search-input {
    width: 100%;
    padding: 14px 20px 14px 45px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: 0.2s;
    backdrop-filter: blur(5px);
}

.efp-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.efp-search-input:focus {
    background: white;
    color: #1e3a8a;
    border-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.efp-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    pointer-events: none;
    transition: 0.2s;
}

.efp-search-input:focus~.efp-search-icon,
.efp-search-wrapper:focus-within .efp-search-icon {
    color: #3b82f6;
}


/* --- CONTAINER & FILTERS --- */
.efp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

.efp-filters {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 15px 5px 25px;
    scrollbar-width: none;
    justify-content: center;
}

.efp-filters::-webkit-scrollbar {
    display: none;
}

.efp-filter-btn {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 10px 22px;
    border-radius: 100px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.efp-filter-btn.active,
.efp-filter-btn:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    border-color: transparent;
}

/* --- GRID --- */
.efp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding-bottom: 40px;
}

.efp-deck-card {
    background: white;
    border-radius: var(--efp-radius);
    padding: 1.75rem;
    position: relative;
    cursor: pointer;
    box-shadow: var(--efp-card-shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(0, 0, 0, 0.02);
    overflow: hidden;
    /* For lock icon containment */
}

.efp-deck-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
}

/* Premium Lock Styling - Watermark */
.efp-deck-card.locked {
    background: white;
    /* Keep white as per design */
}

/* Ensure locked cards don't look disabled, just styled differently if needed, 
   but user image showed white card with lock overlay */
.efp-lock-icon {
    position: absolute;
    right: -15px;
    bottom: -20px;
    font-size: 8rem;
    color: #e5e7eb;
    opacity: 0.4;
    pointer-events: none;
    transform: rotate(-10deg);
}

.efp-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.efp-icon-box {
    width: 60px;
    height: 60px;
    background: var(--efp-lavender-bg);
    color: var(--efp-lavender-text);
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.75rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    /* inner depth */
}

/* Badges */
.efp-badge-premium {
    color: var(--efp-premium-text);
    background: var(--efp-premium-bg);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.efp-badge-free {
    color: #059669;
    background: #ecfdf5;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

.efp-deck-title {
    font-size: 1.35rem;
    margin: 0 0 0.5rem 0;
    font-weight: 800;
    color: var(--efp-text);
    line-height: 1.3;
}

.efp-deck-info {
    color: #6b7280;
    font-size: 0.95rem;
    display: flex;
    gap: 15px;
    font-weight: 500;
}

/* --- PLAYER MODAL --- */
.efp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    /* Modern Glass Effect */
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.efp-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.efp-player-wrapper {
    width: 100%;
    max-width: 600px;
    perspective: 1000px;
    position: relative;
}

/* --- AUTH MODAL --- */
.efp-auth-wrapper {
    background: white;
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.efp-auth-wrapper h2 {
    margin: 0 0 5px;
    color: var(--efp-text);
    font-size: 1.8rem;
    font-weight: 800;
}

.efp-auth-wrapper p {
    color: #6b7280;
    margin-bottom: 25px;
}

.efp-input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 15px;
    border: 2px solid #f3f4f6;
    border-radius: 14px;
    font-size: 1rem;
    transition: 0.2s;
    background: #f9fafb;
}

.efp-input:focus {
    border-color: var(--efp-primary);
    background: white;
    outline: none;
}

.efp-auth-btn {
    width: 100%;
    background: var(--efp-primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.efp-auth-btn:hover {
    background: var(--efp-primary-dark);
    transform: translateY(-2px);
}

.efp-auth-switch {
    margin-top: 20px !important;
    font-size: 0.95rem;
}

.efp-auth-switch a {
    color: var(--efp-primary);
    text-decoration: none;
    font-weight: 700;
}

.efp-close-auth {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    transition: 0.2s;
}

.efp-close-auth:hover {
    background: #e5e7eb;
    color: #111827;
}

/* --- SUBSCRIPTION PLANS UI --- */
.efp-plans-container {
    text-align: center;
    max-width: 900px;
    width: 100%;
}

.efp-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    width: 100%;
}

.efp-plan-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s;
}

.efp-plan-card:hover {
    transform: translateY(-5px);
}

.efp-plan-card h3 {
    margin: 0 0 10px;
    color: var(--efp-text);
    font-size: 1.25rem;
    font-weight: 800;
}

.efp-plan-card .price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--efp-primary);
    margin-bottom: 5px;
}

.efp-plan-card .validity {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
    background: #f3f4f6;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.efp-plan-card .desc {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 25px;
    flex-grow: 1;
    line-height: 1.5;
}

.efp-buy-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.efp-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.5);
}

/* --- PLAYER CONTROLS --- */
.efp-player-controls {
    display: flex;
    justify-content: center;
    color: white;
    margin-bottom: 1.5rem;
    align-items: center;
    gap: 20px;
}

.efp-player-controls span {
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 50px;
}

.efp-btn-icon {
    background: white;
    border: none;
    color: var(--efp-text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-size: 1.1rem;
}

.efp-btn-icon:hover {
    transform: scale(1.1);
    background: white;
    color: var(--efp-primary);
}

/* --- FLASHCARD 3D --- */
.efp-flashcard {
    position: relative;
    height: 420px;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
}

.efp-flashcard.flipped {
    transform: rotateY(180deg);
}

.efp-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 30px;
    background: white;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.efp-front {
    background: linear-gradient(145deg, #ffffff 0%, #f9fafb 100%);
}

.efp-back {
    transform: rotateY(180deg);
    background: #fffbeb;
    border: 4px solid var(--efp-gold);
}

.efp-q-text {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--efp-text);
    margin: 0;
}

.efp-hint {
    color: #9ca3af;
    font-size: 0.95rem;
    margin-top: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.efp-card-icon {
    font-size: 3.5rem;
    color: var(--efp-primary);
    margin-bottom: 25px;
    filter: drop-shadow(0 4px 6px rgba(79, 70, 229, 0.2));
}

/* --- GRADING BUTTONS --- */
.efp-grading-area {
    margin-top: 2.5rem;
    width: 100%;
    display: flex;
    gap: 15px;
}

.efp-grade-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-weight: 800;
    cursor: pointer;
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.efp-grade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.efp-grade-btn:active {
    transform: scale(0.96);
}

.efp-missed {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.efp-mastered {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* --- RESULTS & SUCCESS --- */
.efp-results,
.efp-success-msg {
    background: white;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.efp-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 25px;
    display: grid;
    place-items: center;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.efp-score-circle::after {
    content: "";
    position: absolute;
    width: 96px;
    height: 96px;
    background: white;
    border-radius: 50%;
}

.efp-score-circle span {
    position: relative;
    z-index: 2;
    font-weight: 800;
    font-size: 2rem;
    color: var(--efp-text);
}

.efp-close-control:hover {
    background: #fee2e2;
    color: #dc2626;
}

.efp-restart-btn {
    background: var(--efp-text);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.efp-restart-btn:hover {
    transform: scale(1.05);
}

.efp-exit-btn {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    margin-left: 0;
    margin-top: 25px;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.efp-exit-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

/* --- LOADING SPINNER --- */
.efp-loader {
    color: white;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 600px) {
    .efp-header-bg {
        padding: 3rem 1rem 4rem;
    }

    .efp-header-title {
        font-size: 1.8rem;
    }

    .efp-flashcard {
        height: 380px;
    }

    .efp-grid {
        grid-template-columns: 1fr;
    }

    .efp-plans-grid {
        grid-template-columns: 1fr;
    }

    .efp-filters {
        justify-content: flex-start;
        padding-left: 1rem;
    }
}