/**
 * Voice Task Styles
 */

/* Voice button */
#voiceTaskBtn {
    transition: all 0.3s ease;
}

#voiceTaskBtn:hover {
    transform: scale(1.05);
}

/* Pulse animation for listening state */
.voice-pulse {
    animation: voice-pulse 1.5s ease-in-out infinite;
}

@keyframes voice-pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Voice overlay */
#voiceOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 1050;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#voiceOverlay.show {
    display: flex;
}

.voice-overlay-content {
    text-align: center;
    color: white;
    padding: 30px;
    max-width: 400px;
}

#voiceOverlayIcon {
    margin-bottom: 20px;
}

#voiceState {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 15px;
}

#voiceTranscriptLive {
    font-size: 1.1rem;
    color: #ccc;
    min-height: 50px;
    font-style: italic;
}

/* Cancel button in overlay */
.voice-cancel-btn {
    margin-top: 20px;
    padding: 8px 25px;
}

/* Confirmation modal styles */
#voiceConfirmModal .modal-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

#voiceConfirmModal .modal-header .close {
    color: white;
    opacity: 0.8;
}

#voiceConfirmModal .modal-header .close:hover {
    opacity: 1;
}

#voiceTranscript {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
    border-left: 3px solid #28a745;
}

/* Priority colors in select */
#voiceTaskPriority option[value="1"] {
    color: #6c757d;
}

#voiceTaskPriority option[value="2"] {
    color: #ffc107;
}

#voiceTaskPriority option[value="3"] {
    color: #dc3545;
}

/* Match indicator badges */
.voice-match-indicator {
    font-size: 11px;
    vertical-align: middle;
}

/* ============================================
   Disambiguation Modal Styles
   ============================================ */

#voiceDisambiguateModal .modal-header {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
}

#voiceDisambiguateModal .modal-header .close {
    color: #000;
    opacity: 0.7;
}

#voiceDisambiguateModal .modal-header .close:hover {
    opacity: 1;
}

#voiceDisambiguateList {
    max-height: 300px;
    overflow-y: auto;
}

/* Client option row */
.voice-client-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.voice-client-option:hover {
    border-color: #28a745;
    background: #f8fff9;
}

.voice-client-option.selected {
    border-color: #28a745;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

/* Radio icon styling */
.voice-client-radio {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-client-radio .fa-circle {
    color: #adb5bd;
    font-size: 18px;
}

.voice-client-radio .fa-check-circle {
    color: #28a745;
    font-size: 20px;
    display: none;
}

.voice-client-option.selected .voice-client-radio .fa-circle {
    display: none;
}

.voice-client-option.selected .voice-client-radio .fa-check-circle {
    display: block;
}

/* Client info styling */
.voice-client-info {
    flex: 1;
    min-width: 0;
}

.voice-client-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-client-score {
    font-size: 12px;
    margin-top: 2px;
}

.voice-client-score.text-success {
    color: #28a745 !important;
}

.voice-client-score.text-warning {
    color: #ffc107 !important;
}

.voice-client-score.text-muted {
    color: #6c757d !important;
}

/* Recent badge */
.voice-client-recent {
    background: #e3f2fd;
    color: #1976d2;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* Disambiguation modal footer */
#voiceDisambiguateModal .modal-footer {
    border-top: 1px solid #e9ecef;
}

/* Select2 in voice modal - mobile fixes */
#voiceConfirmModal .select2-container {
    width: 100% !important;
}

#voiceConfirmModal .select2-container--bootstrap4 .select2-selection {
    min-height: 44px;
    padding: 8px 12px;
}

#voiceConfirmModal .select2-container--bootstrap4 .select2-selection__rendered {
    line-height: 26px;
}

#voiceConfirmModal .select2-container--bootstrap4 .select2-selection__arrow {
    height: 42px;
}

/* Make dropdown appear above keyboard on mobile */
#voiceConfirmModal .select2-dropdown {
    z-index: 1060;
}

#voiceConfirmModal .select2-search__field {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 16px; /* Prevents iOS zoom */
}

#voiceConfirmModal .select2-results__option {
    padding: 12px 15px;
    font-size: 15px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .voice-overlay-content {
        padding: 20px;
    }

    #voiceState {
        font-size: 1.2rem;
    }

    #voiceTranscriptLive {
        font-size: 1rem;
    }

    .voice-client-option {
        padding: 10px 12px;
    }

    .voice-client-name {
        font-size: 14px;
    }

    .voice-client-score {
        font-size: 11px;
    }

    #voiceDisambiguateList {
        max-height: 250px;
    }

    /* Better touch targets for Select2 on mobile */
    #voiceConfirmModal .select2-results__option {
        padding: 14px 15px;
    }

    #voiceConfirmModal .select2-container--bootstrap4 .select2-selection {
        min-height: 48px;
    }
}

/* Custom scrollbar for disambiguation list */
#voiceDisambiguateList::-webkit-scrollbar {
    width: 6px;
}

#voiceDisambiguateList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#voiceDisambiguateList::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#voiceDisambiguateList::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
