/**
 * DrCloud Dictate - Global Dictation Styles with Voice Commands
 * 
 * Styles for the floating microphone button, status indicators, and voice command feedback
 */

/* Floating Microphone Button */
.drcloud-mic-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../assets/new_Microphone.png');
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
}

.drcloud-mic-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.drcloud-mic-button.recording {
    border-color: #28a745;
    animation: drcloud-pulse-green 1.5s infinite;
}

.drcloud-mic-button.processing {
    border-color: #ffc107;
    animation: drcloud-pulse-amber 1.5s infinite;
}

@keyframes drcloud-pulse-green {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        border-color: #28a745;
    }

    50% {
        box-shadow: 0 0 20px rgba(40, 167, 69, 0.6);
        border-color: #34ce57;
    }
}

@keyframes drcloud-pulse-amber {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        border-color: #ffc107;
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.6);
        border-color: #ffdb6e;
    }
}

/* Waveform Visualization (REMOVED) */
/* 
#drcloud-waveform {
    position: fixed;
    bottom: 35px;
    right: 110px;
    width: 200px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 30px;
    z-index: 9998;
    display: none;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#drcloud-waveform.show {
    display: block;
}
*/

/* Status indicator */
.drcloud-status {
    position: fixed;
    bottom: 110px;
    right: 30px;
    background: white;
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-size: 12px;
    color: #666;
    display: none;
    z-index: 9998;
    min-width: 150px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.drcloud-status.show {
    display: block;
}

.drcloud-status.recording .drcloud-status-text {
    color: #28a745;
    font-weight: 600;
}

.drcloud-status.processing .drcloud-status-text {
    color: #ffc107;
    font-weight: 600;
}

.drcloud-status.error .drcloud-status-text {
    color: #dc3545;
    font-weight: 600;
}

.drcloud-status.success .drcloud-status-text {
    color: #28a745;
    font-weight: 600;
}

.drcloud-status.warning .drcloud-status-text {
    color: #ff9800;
    font-weight: 600;
}

.drcloud-status-details {
    font-size: 10px;
    color: #999;
    margin-top: 3px;
}

/* Progress indicator */
.drcloud-progress-bar {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 200px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    display: none;
    z-index: 9998;
}

.drcloud-progress-bar.show {
    display: block;
}

.drcloud-progress-fill {
    height: 100%;
    background: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

/* ========== VOICE COMMAND STYLES ========== */

/* Active field highlight */
.drcloud-dictation-active {
    outline: 3px solid #4CAF50 !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2) !important;
    transition: all 0.3s ease;
}

/* Command feedback popup */
.drcloud-command-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.drcloud-command-feedback.show {
    opacity: 1;
    transform: translateX(0);
}

/* Command feedback variations */
.drcloud-command-feedback.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.drcloud-command-feedback.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .drcloud-mic-button {
        width: 60px;
        height: 60px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }

    .drcloud-status {
        bottom: 90px;
        right: 20px;
        font-size: 11px;
        min-width: 130px;
    }

    .drcloud-progress-bar {
        bottom: 85px;
        right: 20px;
        width: 150px;
    }

    .drcloud-command-feedback {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 10px 16px;
    }

    .drcloud-dictation-active {
        outline-width: 2px !important;
        box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2) !important;
    }
}

/* ========== AI SUGGESTIONS CARD ========== */

.drcloud-suggestions-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow: hidden;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.drcloud-suggestions-card.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.drcloud-suggestions-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drcloud-suggestions-title {
    font-weight: 600;
    font-size: 16px;
}

.drcloud-suggestions-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s;
}

.drcloud-suggestions-copy {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drcloud-suggestions-copy:hover {
    background: rgba(255, 255, 255, 0.3);
}

.drcloud-suggestions-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.drcloud-suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: calc(70vh - 60px);
    overflow-y: auto;
}

.drcloud-suggestion-item {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    transition: background 0.2s;
}

.drcloud-suggestion-item:last-child {
    border-bottom: none;
}

.drcloud-suggestion-item:hover {
    background: #f5f5f5;
}

/* Scrollbar styling for suggestions list */
.drcloud-suggestions-list::-webkit-scrollbar {
    width: 8px;
}

.drcloud-suggestions-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.drcloud-suggestions-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.drcloud-suggestions-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========== ERRORS SECTION ========== */

.drcloud-suggestions-content {
    max-height: calc(70vh - 60px);
    overflow-y: auto;
}

.drcloud-errors-section {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border-bottom: 2px solid #ffc107;
    padding: 16px 20px;
}

.drcloud-errors-header {
    font-weight: 600;
    font-size: 14px;
    color: #856404;
    margin-bottom: 12px;
}

.drcloud-errors-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.drcloud-error-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
}

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

.drcloud-error-original {
    color: #dc3545;
    text-decoration: line-through;
    font-weight: 500;
}

.drcloud-error-arrow {
    color: #856404;
    font-weight: bold;
}

.drcloud-error-corrected {
    color: #28a745;
    font-weight: 600;
}

.drcloud-fix-errors-button {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    margin-top: 12px;
}

.drcloud-fix-errors-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.drcloud-fix-errors-button:active {
    transform: translateY(0);
}

.drcloud-fix-errors-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Suggestions sub-section when errors also present */
.drcloud-suggestions-section {
    padding: 16px 20px;
}

.drcloud-suggestions-subheader {
    font-weight: 600;
    font-size: 14px;
    color: #667eea;
    margin-bottom: 12px;
}

/* ========== TRANSLATE BUTTON ========== */

.drcloud-translate-button {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #2196F3;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drcloud-translate-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.drcloud-translate-button.processing {
    background: #FFC107;
    animation: drcloud-pulse 1.5s infinite;
}

/* ========== CORRECTIONS BUTTON ========== */



.drcloud-language-selector {
    position: fixed;
    bottom: 170px;
    right: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    display: none;
    min-width: 150px;
    overflow: hidden;
}

.drcloud-language-selector.show {
    display: block;
}

.drcloud-language-option {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.drcloud-language-option:last-child {
    border-bottom: none;
}

.drcloud-language-option:hover {
    background: #f5f5f5;
}

/* Print styles - hide dictation UI when printing */
@media print {

    .drcloud-mic-button,
    .drcloud-status,
    .drcloud-progress-bar,
    .drcloud-command-feedback,
    .drcloud-suggestions-card,
    .drcloud-translate-button,
    .drcloud-corrections-button,
    .drcloud-language-selector {
        display: none !important;
    }

    .drcloud-dictation-active {
        outline: none !important;
        box-shadow: none !important;
    }
}

/* ========== CLINICAL ANALYSIS SECTIONS ========== */

.drcloud-analysis-section {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
}

.drcloud-analysis-header {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.drcloud-analysis-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drcloud-analysis-item {
    font-size: 14px;
    padding: 4px 0;
    line-height: 1.4;
}

/* Risk & Safety (Red) */
.drcloud-risk-section {
    background: #fff5f5;
    border-left: 4px solid #dc3545;
}

.drcloud-risk-section .drcloud-analysis-header {
    color: #dc3545;
}

/* Trauma Coach (Orange) */
.drcloud-trauma-section {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
}

.drcloud-trauma-section .drcloud-analysis-header {
    color: #d39e00;
}

/* SDOH (Blue) */
.drcloud-sdoh-section {
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
}

.drcloud-sdoh-section .drcloud-analysis-header {
    color: #1976D2;
}

/* Medication (Green) */
.drcloud-medication-section {
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
}

.drcloud-medication-section .drcloud-analysis-header {
    color: #388E3C;
}

/* DSM-5 (Purple) */
.drcloud-dsm-section {
    background: #f3e5f5;
    border-left: 4px solid #9C27B0;
}

.drcloud-dsm-section .drcloud-analysis-header {
    color: #7B1FA2;
}

/* MSE (Teal) */
.drcloud-mse-section {
    background: #e0f2f1;
    border-left: 4px solid #009688;
}

.drcloud-mse-section .drcloud-analysis-header {
    color: #00796B;
}

.drcloud-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    background: #666;
    margin-right: 6px;
}

/* Specific style for Analysis Card to prevent overlap with Fix Errors card */
#drcloud-analysis-card {
    z-index: 10000;
    /* Lower than suggestions card (10001) */
    transform: translate(-48%, -52%) scale(0.95);
    /* Slight offset */
}

#drcloud-analysis-card.show {
    transform: translate(-48%, -52%) scale(1);
    opacity: 1;
}