/* Speaker Recognition Styles */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
}

h1 {
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
    margin-top: 0;
    color: #444;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: #007bff;
    background: #f0f7ff;
}

.drop-zone input {
    display: none;
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"], input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

button:hover {
    background: #0056b3;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* File Info */
.file-info {
    margin-top: 10px;
    padding: 10px;
    background: #e8f4e8;
    border-radius: 4px;
    display: none;
}

/* Speakers List */
.speakers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.speaker-tag {
    background: #e9ecef;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.speaker-tag .name {
    font-weight: 500;
}

.speaker-tag .count {
    color: #666;
    font-size: 12px;
}

.speaker-tag .delete {
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
}

/* Transcript */
.transcript {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 500px;
    overflow-y: auto;
}

.utterance {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.utterance:last-child {
    border-bottom: none;
}

.utterance .speaker {
    font-weight: 600;
    color: #007bff;
    margin-bottom: 4px;
}

.utterance .text {
    color: #333;
    line-height: 1.5;
}

.utterance .meta {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Status Messages */
.status {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

.status.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

.status.loading {
    background: #fff3cd;
    color: #856404;
    display: block;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #856404;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

.hidden {
    display: none !important;
}

/* Confidence Badges */
.confidence-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.confidence-badge.high {
    background: #d4edda;
    color: #155724;
}

.confidence-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.confidence-badge.low {
    background: #f8d7da;
    color: #721c24;
}

/* Speaker Summary */
.speaker-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.speaker-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #ccc;
}

.speaker-card.high {
    border-left-color: #28a745;
}

.speaker-card.medium {
    border-left-color: #ffc107;
}

.speaker-card.low {
    border-left-color: #dc3545;
}

.speaker-card h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.speaker-card .assignment {
    font-size: 14px;
    margin-bottom: 8px;
}

.speaker-card .candidates {
    font-size: 12px;
    color: #666;
}

.speaker-card .score {
    font-size: 12px;
    color: #888;
}

/* Utterance Speaker Names */
.utterance .speaker-name {
    font-weight: 600;
}

.utterance .speaker-name.unknown {
    color: #dc3545;
}

.utterance .speaker-name.identified {
    color: #007bff;
}

.utterance .speaker-name.uncertain {
    color: #856404;
    font-style: italic;
}

/* Highlight effect when hovering over candidate buttons */
.utterance.highlight {
    background: #fff3cd;
}

.utterance.highlight .speaker-name {
    color: #856404;
    font-weight: 700;
}

/* Speaker Actions */
.speaker-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.candidate-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.candidate-btn {
    padding: 6px 12px;
    font-size: 12px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.candidate-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: scale(1.05);
}

.name-input-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.name-input-group input {
    flex: 1;
    padding: 6px 10px;
    font-size: 13px;
}

.name-input-group button {
    padding: 6px 12px;
    font-size: 12px;
}

.enroll-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.enroll-checkbox input {
    width: auto;
}

.action-success {
    color: #155724;
    font-size: 12px;
    margin-top: 8px;
}

/* Recording UI */
.record-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.record-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    transition: all 0.3s ease;
    flex-direction: column;
    color: white;
    font-size: 16px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}

.record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.5);
}

.record-btn:active {
    transform: scale(0.98);
}

.record-btn:disabled {
    background: #6c757d;
    box-shadow: none;
    cursor: not-allowed;
}

.record-btn .record-icon {
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.record-btn.recording .record-icon {
    border-radius: 4px;
    width: 24px;
    height: 24px;
}

.record-btn.recording {
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(220, 53, 69, 0.7);
    }
}

.recording-controls {
    margin-top: 20px;
    text-align: center;
}

.recording-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 32px;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    color: #dc3545;
}

.recording-indicator .pulse {
    width: 16px;
    height: 16px;
    background: #dc3545;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.recording-hint {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #999;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.divider span {
    padding: 0 15px;
    font-size: 13px;
}

/* AI Summary Section */
.summary-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.summary-btn {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.summary-btn:hover {
    background: linear-gradient(135deg, #5a32a3, #4a2893);
}

.summary-btn .btn-icon {
    font-size: 18px;
}

.summary-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #6f42c1;
    position: relative;
}

.summary-card h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card p {
    margin: 0;
    line-height: 1.6;
    color: #444;
}

.summary-card ul {
    margin: 0;
    padding-left: 20px;
}

.summary-card li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.summary-card li.empty {
    color: #999;
    font-style: italic;
}

.summary-card li .assignee {
    color: #007bff;
    font-weight: 500;
}

.summary-card li .context {
    color: #666;
    font-size: 13px;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    font-size: 11px;
    background: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
}

.copy-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.copy-btn.copied {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.copy-all-btn {
    width: 100%;
    background: #28a745;
    margin-top: 10px;
}

.copy-all-btn:hover {
    background: #218838;
}

/* Mobile-friendly touch targets */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 24px;
    }

    .section {
        padding: 15px;
    }

    .record-btn {
        width: 120px;
        height: 120px;
        font-size: 14px;
    }

    .record-btn .record-icon {
        width: 24px;
        height: 24px;
    }

    .record-btn.recording .record-icon {
        width: 20px;
        height: 20px;
    }

    .drop-zone {
        padding: 30px 15px;
    }

    button {
        padding: 14px 28px;
        font-size: 16px;
    }

    .speaker-summary {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 12px;
    }

    .copy-btn {
        position: static;
        margin-top: 10px;
        width: 100%;
    }
}
