/* 🎨 ENHANCED TRANSCRIPT DESIGN - Clear Speaker & Translation Differentiation */

/* 📝 SIMPLE TEXT TRANSLATOR STYLING */
.simple-text-translator {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.translator-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.translator-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.translator-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    font-style: italic;
}

.speaker-display {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    transition: all 0.3s ease;
    min-height: 60px;
}

.speaker-display.active {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.speaker-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.doctor-label {
    color: #1f2937;
}

.patient-label {
    color: #059669;
}

.speaker-text {
    font-size: 16px;
    line-height: 1.5;
    color: #374151;
    font-weight: 500;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom scrollbar for speaker text */
.speaker-text::-webkit-scrollbar {
    width: 6px;
}

.speaker-text::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.speaker-text::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.speaker-text::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.translation-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
}

.translate-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.translate-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-to-spanish {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-to-english {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.transcript-container {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.transcript-entry {
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

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

/* 👨‍⚕️ DOCTOR SPEECH STYLING */
.doctor-speech {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    padding: 16px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.doctor-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e40af;
    font-size: 14px;
}

.doctor-header::before {
    content: "🇺🇸";
    font-size: 18px;
    margin-right: 8px;
}

.doctor-text {
    color: #1e40af;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 500;
}

/* 👤 PATIENT SPEECH STYLING */
.patient-speech {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.patient-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #92400e;
    font-size: 14px;
}

.patient-header::before {
    content: "👤";
    font-size: 18px;
    margin-right: 8px;
}

.patient-text {
    color: #92400e;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 500;
}

/* 🔄 TRANSLATION STYLING */
.translation-block {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border: 2px dashed #8b5cf6;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0 16px 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.translation-block::before {
    content: "↳";
    position: absolute;
    left: -18px;
    top: 12px;
    color: #8b5cf6;
    font-size: 20px;
    font-weight: bold;
}

.translation-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 600;
    color: #7c3aed;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.translation-to-spanish::before { content: "🔄 🇪🇸"; margin-right: 8px; }
.translation-to-english::before { content: "🔄 🇺🇸"; margin-right: 8px; }

.translation-text {
    color: #6b46c1;
    font-size: 15px;
    line-height: 1.4;
    font-style: italic;
    padding: 4px 0;
    border-left: 3px solid #8b5cf6;
    padding-left: 12px;
}

/* ⏰ TIMESTAMP STYLING */
.timestamp {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 8px;
    border-radius: 12px;
}

/* 📝 ENHANCED SIMPLE TEXT TRANSLATOR */
.simple-text-translator {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.translator-header {
    text-align: center;
    margin-bottom: 20px;
}

.translator-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.translator-subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* 🎯 SPEAKER DISPLAY BOXES */
.speaker-display {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.speaker-display.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.speaker-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doctor-label {
    color: #1e40af;
}

.patient-label {
    color: #92400e;
}

.speaker-text {
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    flex-grow: 1;
}

/* 🎨 TRANSLATION BUTTONS */
.translation-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 20px 0;
}

.translate-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.translate-btn:active {
    transform: translateY(0);
}

.btn-to-spanish {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-to-english {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

/* 📱 RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .translation-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .translate-btn {
        width: 100%;
        justify-content: center;
    }
    
    .simple-text-translator {
        padding: 16px;
        margin: 16px 0;
    }
}

/* ✨ LOADING & ANIMATION STATES */
.translate-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.translate-btn.loading::after {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 🎯 FOCUS STATES FOR ACCESSIBILITY */
.translate-btn:focus {
    outline: none;
    ring: 2px solid #3b82f6;
    ring-offset: 2px;
}

.speaker-display:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 🎤 SPEAKER MODE CONTROL BUTTONS */
.speaker-mode-btn {
    transition: all 0.3s ease;
    transform-origin: center;
    min-width: 120px;
    text-align: center;
}

.speaker-mode-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

.speaker-mode-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Active state for speaker mode buttons */
.speaker-mode-btn[style*="opacity: 1"] {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.speaker-mode-btn[style*="opacity: 0.6"] {
    transform: scale(0.95);
    filter: grayscale(0.3);
}

/* Current mode display animations */
#current-mode-display {
    transition: all 0.4s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Speaker mode controls container */
.speaker-mode-controls {
    gap: 16px !important;
}

@media (max-width: 768px) {
    .speaker-mode-controls {
        flex-direction: column;
        gap: 12px !important;
    }
    
    .speaker-mode-btn {
        min-width: 100%;
    }
}