/* ============================================================
   LANGUAGES MODULE — STANDALONE TUTOR CONVERSACIONAL IA
   ============================================================ */

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 80px - 300px); /* header + footer approximation */
}

.dashboard-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ctx-title-compact {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #60a5fa 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
}



/* CCI Container */
.cci-container {
    display: flex;
    flex-direction: column;
    height: 650px;
    background: #0a0a0a; /* Matte Black Surface */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    position: relative;
}

.cci-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 13, 18, 0.3);
    flex-wrap: wrap;
    gap: 1rem;
    z-index: 10;
}

.cci-tutor-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-glow {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(96, 165, 250, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.2);
    position: relative;
    color: #60a5fa;
}

.avatar-glow.active-pulse::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 50%;
    animation: avatarPulse 2s infinite ease-in-out;
}

@keyframes avatarPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

.cci-tutor-info h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
}

.status-text {
    font-size: 0.75rem;
    color: #94a3b8;
}

.cci-selectors {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cci-select {
    background: #121212 !important; /* Dark Slate */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    color: white !important;
    font-size: 0.85rem !important;
    padding: 0.5rem 2.5rem 0.5rem 1rem !important;
    font-weight: 500;
    appearance: none !important;
    -webkit-appearance: none !important;
    /* White Chevron Icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 0.9rem !important;
    cursor: pointer;
    height: 40px !important;
    transition: all 0.2s ease;
}

.cci-select:focus {
    border-color: rgba(96, 165, 250, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1) !important;
    outline: none !important;
}

.cci-auto-send-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0.75rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    height: 40px;
}

.cci-auto-send-container:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.35);
    color: #f8fafc;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

.cci-auto-send-container input[type="checkbox"] {
    cursor: pointer;
    accent-color: #8b5cf6;
    margin: 0;
    width: 0.9rem;
    height: 0.9rem;
}

.cci-messages-box {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: rgba(5, 7, 10, 0.15);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.cci-message {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: cciFadeIn 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes cciFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.cci-message.bot-msg {
    align-self: flex-start;
    background: #121212; /* Dark Slate */
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    border-top-left-radius: 4px;
}

.cci-message.user-msg {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #e2e8f0;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.05);
}

/* Correction Alert Card */
.cci-correction-card {
    background: rgba(239, 68, 68, 0.04);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.cci-correction-card h5 {
    color: #f87171;
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.correction-item {
    margin-bottom: 0.75rem;
}

.correction-item:last-child {
    margin-bottom: 0;
}

.tag-wrong {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-right: 0.5rem;
}

.tag-right {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-right: 0.5rem;
}

.txt-wrong {
    text-decoration: line-through;
    color: #ef4444;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: rgba(239, 68, 68, 0.05);
    padding: 1px 4px;
    border-radius: 4px;
}

.txt-right {
    color: #10b981;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    background: rgba(16, 185, 129, 0.05);
    padding: 1px 4px;
    border-radius: 4px;
}

.correction-explanation {
    color: #94a3b8;
    margin: 0.5rem 0 0 0;
    line-height: 1.45;
    border-top: 1px dashed rgba(255, 255, 255, 0.06);
    padding-top: 0.5rem;
}

/* Chat Input Bar */
.cci-input-bar {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 10, 10, 0.95);
    align-items: center;
}

.cci-input-bar input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    height: 48px;
}

.cci-input-bar input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.cci-input-bar button {
    height: 48px;
    width: 48px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cci-input-bar .btn-send {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.cci-input-bar .btn-send:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
}

/* Audio speaker helper */
.btn-message-tts {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    gap: 0.35rem;
    margin-top: 0.5rem;
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-message-tts:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.cci-message-text {
    word-break: break-word;
}

/* Speaking Mic Button CSS */
.cci-input-bar .btn-mic {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cci-input-bar .btn-mic:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateY(-2px);
}

.cci-input-bar .btn-mic.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5) !important;
    animation: active-mic-pulse 1.5s infinite;
}

@keyframes active-mic-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Loading / Spinner */
.cci-typing-indicator {
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }
    
    .cci-container {
        height: 550px;
    }
    
    .cci-header {
        padding: 1rem;
    }
    
    .cci-selectors {
        width: 100%;
        justify-content: space-between;
    }
    
    .cci-select {
        flex: 1;
        min-width: 0;
    }
    
    .cci-message {
        max-width: 90%;
    }
}
