/* ============================================
   MEDOCS AI Voice Entry Styles
   ============================================ */

/* Voice bar container */
.medocs-voice-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border: 1px solid #c3d4f7;
    border-radius: 8px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.medocs-voice-bar.medocs-recording {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border-color: #f5c6cb;
}

.medocs-voice-bar.medocs-paused {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border-color: #ffc107;
}

.medocs-voice-bar.medocs-voice-unsupported {
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Brand */
.medocs-voice-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #1a56db;
    white-space: nowrap;
    font-size: 14px;
}

.medocs-voice-brand i {
    font-size: 16px;
}

.medocs-recording .medocs-voice-brand {
    color: #dc3545;
}

.medocs-paused .medocs-voice-brand {
    color: #856404;
}

/* Controls */
.medocs-voice-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Record button */
.btn-medocs-record {
    background: #1a56db;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-medocs-record:hover {
    background: #1444b0;
    color: white;
    transform: scale(1.02);
}

.btn-medocs-record:active {
    transform: scale(0.98);
}

/* Pause button */
.btn-medocs-pause {
    background: #ffc107;
    color: #212529;
    border: none;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-medocs-pause:hover {
    background: #e0a800;
    color: #212529;
}

/* Resume button */
.btn-medocs-resume {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-medocs-resume:hover {
    background: #218838;
    color: white;
}

/* Stop button */
.btn-medocs-stop {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-medocs-stop:hover {
    background: #c82333;
    color: white;
}

/* Status area */
.medocs-voice-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.medocs-voice-timer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: 600;
    color: #dc3545;
    min-width: 45px;
}

.medocs-voice-chunks {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
}

.medocs-voice-processing {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #1a56db;
}

/* Audio level visualizer */
.medocs-voice-level {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 18px;
}

.medocs-level-bar {
    width: 3px;
    height: 4px;
    background: #ced4da;
    border-radius: 1px;
    transition: height 0.1s ease, background 0.1s ease;
}

.medocs-level-bar:nth-child(1) { height: 4px; }
.medocs-level-bar:nth-child(2) { height: 6px; }
.medocs-level-bar:nth-child(3) { height: 8px; }
.medocs-level-bar:nth-child(4) { height: 6px; }
.medocs-level-bar:nth-child(5) { height: 4px; }

.medocs-level-bar.active {
    background: #28a745;
}

.medocs-level-bar.active:nth-child(1) { height: 6px; }
.medocs-level-bar.active:nth-child(2) { height: 10px; }
.medocs-level-bar.active:nth-child(3) { height: 16px; }
.medocs-level-bar.active:nth-child(4) { height: 10px; }
.medocs-level-bar.active:nth-child(5) { height: 6px; }

/* Helper text */
.medocs-voice-helper {
    margin-left: auto;
}

.medocs-voice-helper small {
    font-size: 12px;
}

/* Error display */
.medocs-voice-error small {
    font-size: 12px;
}

/* Field update flash animation */
.medocs-field-updated {
    animation: medocsFieldFlash 0.8s ease;
}

@keyframes medocsFieldFlash {
    0% { background-color: #d4edda; box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3); }
    100% { background-color: transparent; box-shadow: none; }
}

/* Recording pulse on the bar border */
.medocs-recording {
    animation: medocsBarPulse 2s infinite;
}

@keyframes medocsBarPulse {
    0%, 100% { border-color: #f5c6cb; }
    50% { border-color: #dc3545; }
}

/* Responsive */
@media (max-width: 768px) {
    .medocs-voice-bar {
        padding: 8px 12px;
        gap: 8px;
    }

    .medocs-voice-helper {
        margin-left: 0;
        width: 100%;
        order: 10;
    }

    .medocs-voice-brand span {
        font-size: 13px;
    }
}

/* AI Disclaimer */
.medocs-voice-disclaimer {
    padding: 4px 16px 0;
    margin-top: -12px;
    margin-bottom: 12px;
}

.medocs-voice-disclaimer small {
    font-size: 11px;
    line-height: 1.4;
    color: #6c757d;
}

/* User-edited field indicator */
[data-user-edited="true"] {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.15);
}
