/* ===== WRAPPER ===== */
.bf-speaking-wrapper {
    max-width: 1400px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* ===== HEADER ===== */
.bf-speaking-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: #1e2c36;
    color: white;
    flex-wrap: wrap;
}

.bf-speaking-header h1 {
    font-size: 1.3rem;
    margin: 0;
    color: white;
}

.bf-speaking-badge {
    background: #2EC487;
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: #1e2c36;
    font-weight: 700;
}

.bf-speaking-export {
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.2s;
}

.bf-speaking-export:hover {
    background: #2EC487;
    color: #1e2c36;
}

/* ===== CONTROLS ===== */
.bf-speaking-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    background: #f8f9fa;
    border-bottom: 2px solid #2EC487;
    flex-wrap: wrap;
    gap: 10px;
}

.bf-speaking-focus {
    background: #1e2c36;
    color: white;
    border: none;
    padding: 6px 18px;
    border-radius: 30px;
    cursor: pointer;
}

.bf-speaking-timer {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e2a3e;
}

.bf-speaking-timer i {
    color: #2EC487;
}

.bf-speaking-user a {
    color: #1e2c36;
    text-decoration: none;
    font-weight: 600;
}

/* ===== PARTS ===== */
.bf-speaking-parts {
    display: flex;
    gap: 10px;
    padding: 15px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2edf2;
    flex-wrap: wrap;
}

.bf-part-btn {
    padding: 8px 20px;
    border-radius: 30px;
    background: #e9ecef;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}

.bf-part-btn span {
    font-size: 0.65rem;
    font-weight: normal;
    opacity: 0.7;
}

.bf-part-btn.active {
    background: #2EC487;
    color: #1e2c36;
    font-weight: 700;
}

/* ===== CONTENT ===== */
.bf-speaking-content {
    display: flex;
    gap: 20px;
    padding: 25px;
    min-height: 500px;
}

.bf-questions {
    flex: 1;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 10px;
}

/* ===== QUESTION ===== */
.bf-question {
    display: none;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e2edf2;
    border-radius: 12px;
    margin-bottom: 20px;
}

.bf-question:first-of-type {
    display: block;
}

.bf-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #2EC487;
    margin-bottom: 15px;
}

.bf-q-number {
    font-weight: 700;
    color: #2EC487;
    font-size: 1.1rem;
}

.bf-q-part {
    background: #1e2c36;
    color: white;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
}

.bf-question-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ===== RECORDER ===== */
.bf-recorder {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.bf-recorder button {
    padding: 8px 18px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.bf-record-btn {
    background: #e74c3c;
    color: white;
}

.bf-record-btn:hover {
    background: #c0392b;
}

.bf-record-btn.recording {
    animation: bf-pulse 1s infinite;
}

@keyframes bf-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

.bf-stop-btn {
    background: #95a5a6;
    color: white;
}

.bf-stop-btn:hover {
    background: #7f8c8d;
}

.bf-play-btn {
    background: #2EC487;
    color: #1e2c36;
}

.bf-play-btn:hover {
    background: #26a874;
}

.bf-record-time {
    margin-left: auto;
    font-weight: 600;
    color: #1e2a3e;
}

/* ===== ANSWER TEXTAREA ===== */
.bf-answer-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2edf2;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.bf-answer-input:focus {
    outline: none;
    border-color: #2EC487;
    box-shadow: 0 0 0 3px rgba(46, 196, 135, 0.1);
}

.bf-answer-meta {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
}

/* ===== ACTIONS ===== */
.bf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.bf-actions button {
    padding: 8px 20px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.bf-submit-btn {
    background: #2EC487;
    color: #1e2c36;
}

.bf-submit-btn:hover {
    background: #26a874;
}

.bf-improve-btn {
    background: #f39c12;
    color: white;
}

.bf-improve-btn:hover {
    background: #d68910;
}

/* ===== RESULTS ===== */
.bf-results {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e2edf2;
}

.bf-band-score {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 20px;
}

.bf-band-score h4 {
    margin: 0 0 10px 0;
    color: #1e2a3e;
}

.bf-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #2EC487;
    color: #1e2c36;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 10px auto;
}

.bf-score-details {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.bf-score-details span {
    padding: 4px 12px;
    background: #e9ecef;
    border-radius: 20px;
    font-size: 0.8rem;
}

.bf-improved-text {
    padding: 15px;
    background: white;
    border-radius: 10px;
}

.bf-improved-text h4 {
    margin: 0 0 10px 0;
    color: #1e2a3e;
}

.bf-improved-content {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 50px;
    line-height: 1.6;
}

.bf-tts-btn {
    margin-top: 10px;
    padding: 6px 16px;
    background: #1e2c36;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.bf-tts-btn:hover {
    background: #2EC487;
    color: #1e2c36;
}

/* ===== PALETTE ===== */
.bf-palette {
    width: 150px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e2edf2;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.bf-palette h4 {
    text-align: center;
    margin: 0 0 12px 0;
    color: #1e2a3e;
}

.bf-palette-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.bf-palette-item {
    text-align: center;
    padding: 6px 0;
    background: white;
    border: 1px solid #e2edf2;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: 0.2s;
}

.bf-palette-item:hover {
    background: #2EC487;
    color: white;
}

.bf-palette-item.current {
    border: 2px solid #2EC487;
    background: #e8f5e9;
}

.bf-palette-item.answered {
    background: #2EC487;
    color: white;
}

/* ===== NAVIGATION ===== */
.bf-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-top: 1px solid #e2edf2;
}

.bf-navigation button {
    padding: 8px 20px;
    background: #1e2c36;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.bf-navigation button:hover {
    background: #2EC487;
    color: #1e2c36;
}

.bf-indicator {
    font-weight: 600;
    color: #1e2a3e;
}

/* ===== TIPS ===== */
.bf-tips {
    padding: 12px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e2edf2;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .bf-speaking-content {
        flex-direction: column;
    }
    
    .bf-palette {
        width: 100%;
        position: relative;
        top: 0;
    }
    
    .bf-palette-grid {
        grid-template-columns: repeat(11, 1fr);
    }
    
    .bf-speaking-header {
        flex-direction: column;
        text-align: center;
    }
    
    .bf-speaking-export {
        margin-left: 0;
    }
    
    .bf-speaking-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 600px) {
    .bf-speaking-parts {
        flex-direction: column;
    }
    
    .bf-part-btn {
        text-align: center;
    }
    
    .bf-recorder {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bf-record-time {
        margin-left: 0;
        text-align: center;
    }
    
    .bf-actions {
        flex-direction: column;
    }
    
    .bf-actions button {
        width: 100%;
    }
    
    .bf-palette-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}