/* =================================================================
   CONVERSATION PRACTICE MODULE STYLES
   Version 1.0 - November 2025
   ================================================================= */

.module-conversation-practice {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.module-conversation-practice h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Controls */
.cp-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cp-mode-toggle,
.cp-form-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.cp-mode-btn,
.cp-form-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cp-mode-btn:hover,
.cp-form-btn:hover {
    color: var(--text-primary);
}

.cp-mode-btn.active,
.cp-form-btn.active {
    background: var(--primary);
    color: white;
}

/* Progress */
.cp-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 20px;
}

#cpProgressText {
    font-weight: 500;
    color: var(--text-primary);
}

.cp-score {
    font-weight: 600;
    color: var(--primary);
}

/* Game Area */
.cp-game-area {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    min-height: 400px;
}

.cp-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

/* Question Section */
.cp-question-section {
    margin-bottom: 24px;
}

.cp-sentence-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    position: relative;
}

.cp-sentence-display.cp-question {
    border-left: 4px solid var(--primary);
}

/* Audio button in sentence display */
.cp-audio-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.cp-audio-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

/* Flip Cards */
.cp-card-wrapper {
    width: 70px;
    height: 105px;
    perspective: 1000px;
    cursor: pointer;
    flex-shrink: 0;
}

.cp-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.cp-card-wrapper.flipped .cp-card-inner {
    transform: rotateY(180deg);
}

.cp-card-front,
.cp-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cp-card-front {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cp-card-speaker {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 12px;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    border-radius: 50%;
}

.cp-card-back {
    background: var(--primary);
    color: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
}

.cp-card-word {
    font-size: 12px;
    font-weight: 600;
    word-break: break-word;
}

.cp-card-english {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Function words (no card) */
.cp-function-word {
    padding: 8px 12px;
    background: var(--gray-100);
    border-radius: 4px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.cp-text-only {
    font-size: 18px;
    color: var(--text-primary);
}

/* Divider */
.cp-divider {
    height: 2px;
    background: var(--border-color);
    margin: 24px 0;
}

/* Answers Grid */
.cp-answers-grid {
    display: grid;
    gap: 16px;
}

.cp-answer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.cp-answer-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.cp-answer-option .cp-sentence-display {
    flex: 1;
    background: transparent;
    padding: 8px;
}

.cp-answer-audio-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-200);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.cp-answer-audio-btn:hover {
    background: var(--primary);
    color: white;
}

/* Answer states */
.cp-answer-option.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.cp-answer-option.incorrect {
    border-color: var(--error);
    background: #FEE2E2;
}

/* Audio Match Form */
.cp-audio-only {
    text-align: center;
    padding: 40px 20px;
}

.cp-audio-player {
    margin-top: 20px;
}

.cp-play-question-btn {
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.cp-play-question-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.cp-play-question-btn i {
    font-size: 24px;
}

.cp-audio-answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.cp-audio-answer-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.cp-audio-answer-option.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.cp-audio-answer-option.incorrect {
    border-color: var(--error);
    background: #FEE2E2;
}

.cp-play-answer-btn {
    padding: 12px 16px;
    background: var(--gray-200);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.cp-play-answer-btn:hover {
    background: var(--primary);
    color: white;
}

.cp-select-answer-btn {
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.cp-select-answer-btn:hover {
    background: var(--primary-dark);
}

/* Feedback */
.cp-feedback {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cp-feedback.correct {
    background: var(--success-light);
    color: #065F46;
}

.cp-feedback.incorrect {
    background: #FEE2E2;
    color: #DC2626;
}

/* Navigation */
.cp-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Empty state */
.module-conversation-practice .empty-state {
    text-align: center;
    padding: 60px 20px;
}

.module-conversation-practice .empty-state i {
    font-size: 48px;
    color: var(--warning);
    margin-bottom: 16px;
}

.module-conversation-practice .empty-state h2 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.module-conversation-practice .empty-state p {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .cp-controls {
        flex-direction: column;
    }

    .cp-card-wrapper {
        width: 55px;
        height: 82px;
    }

    .cp-card-word {
        font-size: 10px;
    }

    .cp-card-english {
        font-size: 8px;
    }

    .cp-audio-answers-grid {
        grid-template-columns: 1fr;
    }
}
