/* ============================================================
   Step Ahead IELTS — Daily Speaking Topic (dashboard card +
   timed practice session page)
   ============================================================ */

/* ---------- Dashboard card ---------- */
#speaking-panel {
    margin-bottom: 18px;
}

.speaking-card {
    background: linear-gradient(135deg, #6a3de8 0%, #8e5cf7 100%);
    border-radius: 14px;
    color: #fff;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(106, 61, 232, 0.25);
}

.speaking-card .speaking-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
}

.speaking-card .speaking-head .mic {
    font-size: 18px;
}

.speaking-card .speaking-topic-title {
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.speaking-card details {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 0;
    overflow: hidden;
}

.speaking-card details[open] {
    background: rgba(255, 255, 255, 0.18);
}

.speaking-card details summary {
    cursor: pointer;
    padding: 9px 12px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.speaking-card details summary::-webkit-details-marker {
    display: none;
}

.speaking-card details summary::after {
    content: '▾';
    font-size: 11px;
    opacity: 0.85;
    transition: transform 0.15s ease;
}

.speaking-card details[open] summary::after {
    transform: rotate(180deg);
}

.speaking-card details ul {
    margin: 0;
    padding: 0 12px 10px 26px;
    font-size: 12px;
    line-height: 1.5;
    color: #f2edff;
}

.speaking-card details ul li {
    margin-bottom: 4px;
}

/* The cue-card prompt itself — styled like a real white cue card so the
   topic reads ON the card, exactly like the IELTS Part 2 card. */
.speaking-card .cue-card-topic {
    background: #fff;
    color: #241f33;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.45;
    margin: 4px 12px 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.speaking-card .cue-bullets {
    padding: 0 12px 10px 26px;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #f2edff;
}

.speaking-card .cue-bullets li {
    margin-bottom: 4px;
}

.speaking-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.speaking-actions .btn {
    flex: 1 1 auto;
    min-width: 140px;
    background: #fff;
    color: #6a3de8;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 12px;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.speaking-actions .btn:hover {
    background: #f1ebff;
}

.speaking-progress-note {
    margin-top: 8px;
    font-size: 11px;
    color: #e6dcff;
    opacity: 0.9;
}

/* Empty / completed / error states */
.speaking-empty,
.speaking-completed,
.speaking-error {
    background: #fff;
    border: 1px solid #e5e0f5;
    border-radius: 14px;
    padding: 16px;
    color: #4a4358;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
}

.speaking-empty h4,
.speaking-completed h4,
.speaking-error h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: #6a3de8;
}

.speaking-loading {
    background: #fff;
    border: 1px dashed #d8d2ee;
    border-radius: 14px;
    padding: 14px;
    color: #8a84a0;
    font-size: 13px;
    margin-bottom: 18px;
}

/* ============================================================
   Timed practice session (speaking.html)
   ============================================================ */
.speaking-session {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

.speaking-session .session-card {
    background: #fff;
    border: 1px solid #e5e0f5;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(80, 50, 160, 0.06);
}

.speaking-session .session-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.speaking-session .stage-badge {
    background: #6a3de8;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    padding: 4px 12px;
}

.speaking-session .timer-box {
    font-size: 15px;
    font-weight: 700;
    color: #6a3de8;
    background: #f4f0ff;
    border-radius: 8px;
    padding: 6px 12px;
    font-variant-numeric: tabular-nums;
}

.speaking-session .timer-box.timer-warn {
    color: #d9534f;
    background: #fdeeee;
}

.speaking-session .session-topic {
    font-size: 16px;
    font-weight: 700;
    color: #241f33;
    margin: 6px 0 14px;
    line-height: 1.45;
}

.speaking-session .session-sub {
    font-size: 13px;
    color: #8a84a0;
    margin-bottom: 14px;
}

.speaking-session ul.session-list {
    margin: 0 0 16px;
    padding-left: 22px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.speaking-session ul.session-list li {
    margin-bottom: 8px;
}

.speaking-session .session-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.speaking-session .session-btns .btn {
    flex: 1 1 auto;
    min-width: 150px;
    background: #6a3de8;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 16px;
    border: none;
    border-radius: 9px;
    cursor: pointer;
}

.speaking-session .session-btns .btn.secondary {
    background: #f0ecfb;
    color: #6a3de8;
}

.speaking-session .session-btns .btn:hover {
    filter: brightness(0.95);
}

.speaking-session .prep-tip {
    background: #fff8e6;
    border: 1px solid #f2e3b0;
    color: #7a5c12;
    font-size: 12.5px;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0 0 14px;
    line-height: 1.5;
}

/* Real band-scored sample answer (collapsed until student taps) */
.speaking-session .model-answer {
    margin: 0 0 14px;
    border: 1px solid #e5ddf8;
    border-radius: 12px;
    background: #faf7ff;
    overflow: hidden;
}

.speaking-session .model-answer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    background: transparent;
    font-size: 14.5px;
    font-weight: 800;
    color: #43305e;
    cursor: pointer;
    text-align: left;
}

.speaking-session .model-answer-toggle:hover {
    background: #f3edfd;
}

.speaking-session .model-band {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 800;
    color: #6a3de8;
    background: #e9e0fd;
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
}

.speaking-session .model-source {
    font-size: 11.5px;
    font-weight: 600;
    color: #9a8fb5;
    white-space: nowrap;
}

.speaking-session .model-chev {
    font-size: 12px;
    color: #9a8fb5;
    transition: transform 0.15s ease;
}

.speaking-session .model-answer-toggle.open .model-chev {
    transform: rotate(180deg);
}

.speaking-session .model-answer-body {
    border-top: 1px dashed #e5ddf8;
    padding: 12px 14px 14px;
}

.speaking-session .model-question {
    font-size: 12.5px;
    color: #7d6fa0;
    margin: 0 0 8px;
}

.speaking-session .model-answer-text {
    font-size: 14px;
    line-height: 1.65;
    color: #3a3150;
    margin: 0;
    white-space: pre-line;
}

/* Session stages (only the active one is visible) */
.speaking-session .stage {
    display: none;
}

.speaking-session .stage.active {
    display: block;
}

.speaking-session .question-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    gap: 8px;
}

.speaking-session .question-nav .btn {
    min-width: 110px;
}

/* Finished screen */
.speaking-session .done-title {
    font-size: 18px;
    font-weight: 800;
    color: #6a3de8;
    margin: 0 0 10px;
}

/* ============================================================
   Speaking Topic Library (dashboard "Speaking" tab)
   ============================================================ */
.speaking-lib {
    background: #fff;
    border: 1px solid #e5e0f5;
    border-radius: 14px;
    padding: 16px;
}

.speaking-lib-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.speaking-lib-head h3 {
    margin: 0;
    font-size: 16px;
    color: #241f33;
}

.speaking-lib-progress {
    font-size: 12.5px;
    font-weight: 700;
    color: #6a3de8;
    background: #f4f0ff;
    border-radius: 20px;
    padding: 4px 12px;
}

.speaking-lib-search {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d8d2ee;
    border-radius: 9px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
    background: #faf9ff;
}

.speaking-lib-search:focus {
    border-color: #6a3de8;
    background: #fff;
}

.speaking-lib-list {
    max-height: 520px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.speaking-lib-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    text-decoration: none;
    color: #333;
    transition: background 0.12s ease;
}

.speaking-lib-row:hover {
    background: #f4f0ff;
}

.speaking-lib-row + .speaking-lib-row {
    border-top: 1px solid #f0ecfb;
}

.speaking-lib-play {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #6a3de8;
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.speaking-lib-title {
    flex: 1;
    font-size: 13.5px;
    line-height: 1.4;
}

.speaking-lib-badge {
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 700;
    color: #2f9e44;
    background: #ebfbee;
    border-radius: 20px;
    padding: 3px 10px;
}

.speaking-lib-badge.sample {
    color: #7c3aed;
    background: #ede9fe;
}

.speaking-lib-empty {
    padding: 22px 12px;
    text-align: center;
    color: #8a84a0;
    font-size: 13px;
}

.speaking-lib-login {
    background: #fff;
    border: 1px solid #e5e0f5;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    color: #8a84a0;
    font-size: 13.5px;
}

.speaking-lib-login strong {
    color: #6a3de8;
}

/* Mobile */
@media (max-width: 480px) {
    .speaking-actions .btn {
        min-width: 100%;
    }

    .speaking-session .session-btns .btn {
        min-width: 100%;
    }

    .speaking-lib-list {
        max-height: 440px;
    }
}
