/* Learn new words container */
.learn-new-words-container {
    max-width: 90%;
    margin: 30px auto;
    text-align: center;
    padding: 20px;
    font-family: Arial, sans-serif;
    position: relative;
    z-index: 10 !important;
}

/* Learn actions top (Power button) */
.learn-actions-top {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.power-button {
    background: none;
    border: none;
    cursor: pointer;
}

.power-button i {
    font-size: 40px;
    color: #f44336;
}

/* Learn control section (Stats and Progress) */
.learn-control-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

/* Learn stats */
.learn-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.learned-count,
.not-learned-count {
    font-size: clamp(20px, 3vw, 22px);
    color: #333;
    font-weight: bold;
}

/* Progress bar */
.flashcard-progress {
    width: 100%;
    max-width: 600px;
    height: 14px;
    background-color: #e0e0e0;
    border-radius: 7px;
    margin-bottom: 20px;
    overflow: hidden;
}

.flashcard-progress .progress-bar {
    height: 100%;
    background-color: #41c5c8;
    width: 0;
    transition: width 0.3s ease-in-out;
}

/* Counter */
.flashcard-counter {
    font-size: 30px;
    color: #333;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Learn flashcard section */
.learn-flashcard-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 11 !important;
}

/* Learn flashcard wrapper */
.learn-flashcard-wrapper {
    perspective: 1000px !important;
    -webkit-perspective: 1000px !important;
    background-color: transparent;
    overflow: visible !important;
    min-height: 400px !important;
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto;
    position: relative;
    display: block !important;
}

/* Learn flashcard inner */
.learn-flashcard-inner {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    transform-style: preserve-3d !important;
    -webkit-transform-style: preserve-3d !important;
    transition: transform 0.6s ease-in-out !important;
    -webkit-transition: transform 0.6s ease-in-out !important;
    min-height: 400px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
}

/* Flipped state */
.learn-flashcard-wrapper.flipped .learn-flashcard-inner {
    transform: rotateY(180deg) !important;
    -webkit-transform: rotateY(180deg) !important;
}

/* Front and back content */
.learn-flashcard-front,
.learn-flashcard-back {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-direction: column !important;
    padding: 40px !important;
    text-align: center !important;
    color: #333 !important;
    border-radius: 12px !important;
    border: 4px solid #41c5c8 !important;
    background-color: #fff !important;
    box-sizing: border-box !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1) !important;
    visibility: visible !important;
}

.learn-flashcard-back {
    transform: rotateY(180deg) !important;
    -webkit-transform: rotateY(180deg) !important;
}

.learn-term,
.learn-definition {
    margin: 0 !important;
    word-wrap: break-word !important;
    font-family: Arial, sans-serif !important;
    font-size: clamp(3.5rem, 8vw, 4.5rem) !important;
    color: #333 !important;
    display: block !important;
    visibility: visible !important;
}

/* Learn button (V) and Not Learned button (X) */
.learn-button,
.not-learned-button {
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 12 !important;
}

.learn-button {
    right: -80px; /* Nút V bên phải */
}

.not-learned-button {
    left: -80px; /* Nút X bên trái */
}

.learn-button img,
.not-learned-button img {
    width: 60px;
    height: 60px;
}

/* Popup styles */
.learn-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    border: 4px solid #41c5c8;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.learn-popup h3 {
    margin: 0 0 15px;
    font-size: clamp(22px, 3.5vw, 26px);
    color: #333;
}

.learn-popup p {
    margin: 0 0 25px;
    font-size: clamp(18px, 2.5vw, 20px);
}

.learn-popup button {
    padding: 12px 30px;
    margin: 0 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: clamp(16px, 2.5vw, 18px);
    background-color: #41c5c8;
    color: #fff;
}

.learn-popup button:hover {
    background-color: #369ea1;
}

/* Responsive */
@media (max-width: 768px) {
    .learn-new-words-container {
        padding: 15px;
    }

    .learn-flashcard-wrapper {
        min-height: 350px !important;
        max-width: 900px !important;
        width: 100% !important;
    }

    .learn-flashcard-inner {
        min-height: 350px !important;
    }

    .learn-term,
    .learn-definition {
        font-size: clamp(3rem, 7vw, 4rem) !important;
    }

    .learn-button,
    .not-learned-button {
        top: 50%;
        transform: translateY(-50%);
    }

    .learn-button {
        right: -60px;
    }

    .not-learned-button {
        left: -60px;
    }

    .learn-button img,
    .not-learned-button img {
        width: 50px;
        height: 50px;
    }

    .learn-stats {
        gap: 30px;
    }

    .learned-count,
    .not-learned-count {
        font-size: clamp(18px, 2.5vw, 20px);
    }

    .flashcard-progress {
        max-width: 500px;
        height: 12px;
    }

    .flashcard-counter {
        font-size: 26px;
    }

    .learn-popup {
        max-width: 400px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .learn-flashcard-wrapper {
        min-height: 300px !important;
        max-width: 350px !important;
        width: 100% !important;
    }

    .learn-flashcard-inner {
        min-height: 300px !important;
    }

    .learn-term,
    .learn-definition {
        font-size: clamp(2.5rem, 6vw, 3.5rem) !important;
    }

    .learn-button,
    .not-learned-button {
        top: auto;
        bottom: -60px;
        transform: none;
    }

    .learn-button {
        right: 20px;
    }

    .not-learned-button {
        left: 20px;
    }

    .learn-button img,
    .not-learned-button img {
        width: 40px;
        height: 40px;
    }

    .learn-stats {
        flex-direction: column;
        gap: 20px;
    }

    .flashcard-progress {
        max-width: 300px;
        height: 10px;
    }

    .flashcard-counter {
        font-size: 22px;
    }

    .learn-popup {
        max-width: 300px;
        padding: 15px;
    }
}

/* Đảm bảo hiển thị trong LearnDash và BuddyBoss */
.learndash-wrapper .learn-new-words-container,
.bb-content-wrap .learn-new-words-container,
.entry-content .learn-new-words-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 30px auto !important;
    padding: 15px !important;
}
