/* Custom styles for Hermeneutix */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Cards */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

/* Profile Cards */
.profile-card {
    transition: all 0.3s ease;
}

.profile-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Conversation Timeline */
.conversation-timeline {
    position: relative;
    padding-left: 2rem;
}

.conversation-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.message-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
}

.message-item::before {
    content: '';
    position: absolute;
    left: -1.45rem;
    top: 1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
}

.message-item.agent-message {
    background: #f8f9fa;
}

.message-item.agent-message::before {
    background: var(--info-color);
}

/* Badge styles */
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
}

/* Status badges */
.status-active {
    background-color: var(--success-color);
}

.status-pending {
    background-color: var(--warning-color);
}

.status-processing {
    background-color: var(--info-color);
}

.status-completed {
    background-color: var(--success-color);
}

.status-failed {
    background-color: var(--danger-color);
}

/* Tables */
.table-hover tbody tr {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

/* Speaker identification */
.speaker-card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.speaker-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.2);
}

.audio-player {
    width: 100%;
    margin: 0.5rem 0;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background-color: #f8f9fa;
}

.upload-zone.dragover {
    border-color: var(--success-color);
    background-color: #d1e7dd;
}

.upload-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Progress bars */
.progress {
    height: 1.5rem;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Filters */
.filter-sidebar {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Audio Conversation Timeline Styles */
.conversation-timeline-audio {
    position: relative;
    padding-left: 2.5rem;
}

.conversation-timeline-audio::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #dee2e6 0%, #dee2e6 100%);
}

.timeline-speaker-change {
    position: relative;
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
}

.timeline-speaker-change:first-child {
    margin-top: 0;
}

.timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.speaker-info {
    padding: 0.5rem 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0.75rem;
}

.speaker-info .speaker-name {
    font-size: 1.1rem;
    color: #212529;
}

.speaker-paragraph {
    margin-left: 0.5rem;
    margin-bottom: 1.5rem;
}

.timeline-message {
    position: relative;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0;
    transition: all 0.2s ease;
}

.timeline-message:last-child {
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 1rem;
}

.timeline-message:hover {
    background-color: #f8f9fa;
    border-bottom-color: var(--primary-color);
}

.timeline-message.playing {
    background-color: #d1e7dd;
    border-bottom-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.1);
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.message-content-wrapper {
    flex: 1;
    min-width: 0;
}

.message-content {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: #212529;
}

.message-meta {
    font-size: 0.85rem;
}

.message-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.timeline-message:hover .message-actions {
    opacity: 1;
}

.message-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1;
}

.message-actions .btn i {
    font-size: 1rem;
}

/* Profile selection in modal */
.profile-option {
    transition: background-color 0.2s ease;
}

.profile-option:hover {
    background-color: #f8f9fa;
}

.profile-option.selected {
    background-color: #e7f3ff;
    border-left: 3px solid var(--primary-color);
}

.profile-option .d-flex {
    transition: all 0.2s ease;
}

.profile-option:hover .d-flex {
    transform: translateX(5px);
}

/* Audio player - keep it hidden */
#audioPlayer {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stat-card .stat-icon {
        font-size: 2rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .conversation-timeline {
        padding-left: 1rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .speaker-group-header {
        padding: 0.75rem 1rem;
    }
    
    .grouped-message {
        padding: 0.5rem 0.75rem;
    }
    
    .message-hover-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .message-hover-actions .btn {
        font-size: 0.85rem;
    }
}

/* Voice Sample Creation Styles */
.message-select-wrapper {
    display: flex;
    align-items: center;
    padding-right: 0.5rem;
}

.message-select-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.message-select-checkbox:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#voiceSampleToolbar {
    position: sticky;
    top: 60px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.voice-sample-profile-option {
    transition: all 0.2s ease;
    cursor: pointer;
}

.voice-sample-profile-option:hover {
    background-color: #f8f9fa;
}

.voice-sample-profile-option.selected {
    background-color: #e7f3ff;
    border-left: 3px solid var(--primary-color);
}

.voice-sample-profile-option .d-flex {
    transition: transform 0.2s ease;
}

.voice-sample-profile-option:hover .d-flex {
    transform: translateX(5px);
}

/* Speaker Management Panel Styles */
.speaker-management-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.speaker-card {
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.speaker-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* State-based border colors */
.speaker-card.border-pending {
    border-left-color: #ffc107 !important;
}

.speaker-card.border-confirmed {
    border-left-color: #198754 !important;
}

.speaker-card.border-undefined {
    border-left-color: #6c757d !important;
}

/* State badge emoji sizing */
.state-badge {
    line-height: 1;
}

/* Speaker actions button group */
.speaker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.speaker-actions .btn {
    white-space: nowrap;
}

/* Speaker stats styling */
.speaker-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Responsive adjustments for speaker panel */
@media (max-width: 768px) {
    .speaker-card .row {
        flex-direction: column;
    }
    
    .speaker-actions {
        justify-content: flex-start;
        margin-top: 1rem;
    }
    
    .speaker-card .text-md-end {
        text-align: left !important;
    }
}

/* Alert sizing */
.alert-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}
