/*
 * 전기학습실 플립 암기카드 체험 팝업
 * 실제 study_flipcard.php 팝업의 구조와 시각 언어를 유지하고 iframe 크기만 보정합니다.
 */
.efc-dialog {
    width: min(1000px, calc(100vw - 32px));
    max-width: none;
    height: min(705px, calc(100vh - 32px));
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.efc-dialog::backdrop {
    background: rgba(25, 31, 40, .42);
}

.efc-dialog__panel,
.efc-dialog__frame {
    width: 100%;
    height: 100%;
}

.efc-dialog__frame {
    display: block;
    border: 0;
    background: transparent;
}

.efc-dialog-open {
    overflow: hidden;
}

html:has(.trial-flipcard-frame),
.trial-flipcard-frame {
    min-width: 0;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    color: #212529;
    background: transparent;
    font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}

.trial-flipcard-frame *,
.trial-flipcard-frame *::before,
.trial-flipcard-frame *::after {
    box-sizing: border-box;
}

.trial-flipcard-frame .efc-frame {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 0;
    padding: 24px 26px 15px;
    overflow: hidden;
    border: 4px solid #212529;
    background: #fff;
}

.trial-flipcard-frame .efc-frame__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    min-height: 46px;
    margin: 0;
    padding: 0;
    border: 0;
}

.trial-flipcard-frame .efc-frame__top {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.trial-flipcard-frame .efc-frame__title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.trial-flipcard-frame .efc-frame__title h1 {
    margin: 0;
    color: #212529;
    font-size: 22px;
    font-weight: 800;
    line-height: 36px;
    letter-spacing: -.04em;
}

.trial-flipcard-frame .efc-frame__title span {
    padding: 4px 7px;
    border-radius: 3px;
    color: #8b5b00;
    background: #ffefc4;
    font-size: 11px;
    font-weight: 700;
}

.trial-flipcard-frame .efc-subjects {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    border: 0;
    scrollbar-width: none;
}

.trial-flipcard-frame .efc-subjects::-webkit-scrollbar {
    display: none;
}

.trial-flipcard-frame .efc-subjects button {
    flex: 0 0 auto;
    min-width: 76px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #d5d8dd;
    border-radius: 3px;
    color: #555;
    background: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.trial-flipcard-frame .efc-subjects button.is-active {
    border-color: #0877e8;
    color: #fff;
    background: #0877e8;
}

.trial-flipcard-frame .efc-frame__close {
    display: block;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    color: #888;
    background: transparent;
    font-size: 34px;
    font-weight: 200;
    line-height: 30px;
    cursor: pointer;
}

.trial-flipcard-frame .efc-progress {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 26px;
    height: 51px;
    margin: 0 0 23px;
    padding: 0 31px;
    border: 1px solid #ddd;
    background: #fff;
}

.trial-flipcard-frame .efc-progress__track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8e8e8;
}

.trial-flipcard-frame .efc-progress__track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #0877e8;
    transition: width .2s ease;
}

.trial-flipcard-frame .efc-progress__total {
    color: #222;
    font-size: 14px;
    white-space: nowrap;
}

.trial-flipcard-frame .efc-progress__total strong {
    font-weight: 800;
}

.trial-flipcard-frame .efc-progress__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.trial-flipcard-frame .efc-stage,
.trial-flipcard-frame .efc-stage__wrap {
    margin: 0;
    padding: 0;
}

.trial-flipcard-frame .efc-stage__wrap {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    align-items: center;
    gap: 22px;
}

.trial-flipcard-frame .efc-arrow {
    position: static;
    width: 52px;
    height: 52px;
    padding: 0 0 4px;
    border: 0;
    border-radius: 50%;
    color: #8a8a8a;
    background: #fff;
    font: inherit;
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 13px rgba(0, 0, 0, .13);
}

.trial-flipcard-frame .efc-arrow:disabled {
    opacity: .45;
    cursor: wait;
}

.trial-flipcard-frame .efc-card {
    width: 100%;
    height: 458px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 15px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 0, 0, .27);
    outline: none;
}

.trial-flipcard-frame .efc-card:focus-visible {
    outline: 3px solid rgba(8, 119, 232, .25);
    outline-offset: 3px;
}

.trial-flipcard-frame .efc-card .card__inner,
.trial-flipcard-frame .efc-card .card__front {
    width: 100%;
    height: 100%;
}

.trial-flipcard-frame .efc-card .card__front {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 21px 22px 18px;
}

.trial-flipcard-frame .efc-card .card__status {
    position: absolute;
    z-index: 2;
    top: 18px;
    right: 22px;
}

.trial-flipcard-frame .efc-important {
    min-width: 70px;
    height: 31px;
    padding: 0 10px;
    border: 1px solid #999;
    border-radius: 5px;
    color: #777;
    background: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.trial-flipcard-frame .efc-important span {
    display: none;
}

.trial-flipcard-frame .efc-important.is-active {
    border-color: #0877e8;
    color: #0877e8;
}

.trial-flipcard-frame .efc-important.is-active span {
    display: inline;
}

.trial-flipcard-frame .efc-card .card__category {
    display: block;
    padding-right: 90px;
    color: #333;
    font-size: 12px;
    font-weight: 700;
}

.trial-flipcard-frame .efc-card__body {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: auto;
    text-align: center;
}

.trial-flipcard-frame .efc-card__body > h3,
.trial-flipcard-frame .efc-card__body .card__answer {
    width: 100%;
    margin: 0;
    color: #111;
    font: inherit;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: -.035em;
    word-break: keep-all;
}

.trial-flipcard-frame .efc-card__body .card__answer {
    display: none;
    font-size: clamp(18px, 2.2vw, 27px);
}

.trial-flipcard-frame .efc-card__body.is-answer > h3 {
    display: none;
}

.trial-flipcard-frame .efc-card__body.is-answer .card__answer {
    display: block;
}

.trial-flipcard-frame .efc-card__body img {
    max-width: 100%;
    max-height: 330px;
    object-fit: contain;
}

.trial-flipcard-frame .efc-card__body table {
    max-width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 15px;
}

.trial-flipcard-frame .efc-card__body th,
.trial-flipcard-frame .efc-card__body td {
    padding: 7px;
    border: 1px solid #bbb;
}

.trial-flipcard-frame .efc-loading {
    color: #888;
    font-size: 15px;
    font-weight: 500;
}

.trial-flipcard-frame .efc-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 61px;
    margin: 0 30px;
    padding: 12px 0 0;
    border: 0;
}

.trial-flipcard-frame .efc-rating {
    display: flex;
    align-items: center;
    gap: 13px;
    color: #666;
    font-size: 13px;
}

.trial-flipcard-frame .efc-rating > span {
    white-space: nowrap;
}

.trial-flipcard-frame .efc-rating .re__list {
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 0;
    border: 0;
}

.trial-flipcard-frame .efc-rating button {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #555;
    background: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.trial-flipcard-frame .efc-rating button.is-active {
    border-color: #333;
    color: #fff;
    background: #333;
}

.trial-flipcard-frame .efc-key-guide {
    color: #555;
    font-size: 13px;
    white-space: nowrap;
}

.trial-flipcard-frame .efc-key-guide kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 31px;
    height: 31px;
    padding: 0 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #555;
    background: #fff;
    box-shadow: none;
    font: inherit;
    font-size: 12px;
}

.trial-flipcard-frame .efc-frame__footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 0 30px;
    color: #999;
    font-size: 10px;
}

.trial-flipcard-frame .efc-frame__footer strong {
    color: #666;
}

.trial-flipcard-frame .efc-toast {
    position: fixed;
    z-index: 10;
    left: 50%;
    bottom: 18px;
    padding: 9px 16px;
    border-radius: 999px;
    color: #fff;
    background: rgba(33, 37, 41, .92);
    font-size: 12px;
    opacity: 0;
    transform: translate(-50%, 10px);
    transition: .2s ease;
    pointer-events: none;
}

.trial-flipcard-frame .efc-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 767px) {
    .efc-dialog {
        width: 100vw;
        height: 100dvh;
    }

    .trial-flipcard-frame {
        background: #fff;
    }

    .trial-flipcard-frame .efc-frame {
        height: 100dvh;
        padding: 15px 13px calc(12px + env(safe-area-inset-bottom));
        overflow-y: auto;
        border: 0;
    }

    .trial-flipcard-frame .efc-frame__header {
        min-height: 86px;
    }

    .trial-flipcard-frame .efc-frame__top {
        display: block;
        width: calc(100% - 38px);
    }

    .trial-flipcard-frame .efc-frame__title {
        margin-bottom: 10px;
    }

    .trial-flipcard-frame .efc-frame__title h1 {
        font-size: 20px;
    }

    .trial-flipcard-frame .efc-subjects {
        gap: 5px;
    }

    .trial-flipcard-frame .efc-subjects button {
        min-width: 67px;
        height: 31px;
        padding: 0 10px;
        font-size: 12px;
    }

    .trial-flipcard-frame .efc-progress {
        height: 43px;
        margin-bottom: 13px;
        padding: 0 14px;
        gap: 12px;
    }

    .trial-flipcard-frame .efc-stage__wrap {
        grid-template-columns: 32px minmax(0, 1fr) 32px;
        gap: 4px;
    }

    .trial-flipcard-frame .efc-arrow {
        width: 32px;
        height: 42px;
        background: transparent;
        font-size: 35px;
        box-shadow: none;
    }

    .trial-flipcard-frame .efc-card {
        height: min(455px, 55vh);
        border-radius: 10px;
    }

    .trial-flipcard-frame .efc-card .card__front {
        padding: 16px 14px;
    }

    .trial-flipcard-frame .efc-card .card__status {
        top: 13px;
        right: 13px;
    }

    .trial-flipcard-frame .efc-card .card__category {
        padding-right: 73px;
        font-size: 10px;
    }

    .trial-flipcard-frame .efc-card__body > h3,
    .trial-flipcard-frame .efc-card__body .card__answer {
        font-size: clamp(19px, 5.6vw, 25px);
        word-break: normal;
    }

    .trial-flipcard-frame .efc-card__body .card__answer {
        font-size: clamp(16px, 4.6vw, 21px);
    }

    .trial-flipcard-frame .efc-controls {
        display: block;
        min-height: 90px;
        margin: 0 36px;
        padding-top: 11px;
    }

    .trial-flipcard-frame .efc-rating {
        display: block;
    }

    .trial-flipcard-frame .efc-rating > span {
        display: block;
        margin-bottom: 7px;
        font-size: 11px;
    }

    .trial-flipcard-frame .efc-rating .re__list {
        justify-content: space-between;
    }

    .trial-flipcard-frame .efc-key-guide {
        margin-top: 9px;
        font-size: 10px;
        text-align: center;
    }

    .trial-flipcard-frame .efc-key-guide kbd {
        min-width: 25px;
        height: 25px;
        padding: 0 5px;
        font-size: 10px;
    }

    .trial-flipcard-frame .efc-frame__footer {
        margin: 0 36px;
        font-size: 9px;
    }
}
