/* Results display styles for Fast Scribe */

/* Table container */
.table-container {
    height: 70vh;
    overflow-y: auto;
    margin-bottom: 10px;
    border-radius: 8px;
    background-color: rgb(253, 253, 253);
}

/* Results table styling */
.results-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgb(253, 253, 253);
    border-radius: 8px;
    overflow: hidden;
}

.results-table th {
    color: #333333;
    padding: 12px;
    text-align: left;
}

.results-table td {
    padding: 12px;
    border-top: 1px solid #eee;
    text-align: left;
    font-size: 13px;
    line-height: 1.2;
}

/* Column widths for the results table */
.results-table th:nth-child(1), .results-table td:nth-child(1),
.results-table th:nth-child(2), .results-table td:nth-child(2) {
    width: 80px;
    white-space: nowrap;
}

.results-table th:nth-child(3), .results-table td:nth-child(3) {
    width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: none; /* Hide the feature column */
}

.results-table th:nth-child(4) {
    width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    font-weight: bold;
}

.results-table td:nth-child(4) {
    width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    font-weight: bold;
}

.results-table th:nth-child(5), .results-table td:nth-child(5) {
    min-width: 200px;
}

.results-table tr:hover {
    background-color: #f5f5f5;
}

.results-table tr {
    cursor: pointer;
}

/* Playing state highlight */
.playing {
    background-color: #e0e0e0 !important;
}

/* Preserve speaker column styling even when row is highlighted */
.playing td:nth-child(4) {
    font-weight: bold;
}

/* Navigation and action buttons */
.back-btn {
    display: none; /* Hide the "Return to transcription" button */
}

/* Header actions and button layout */
.header-actions {
    margin: 10px 0;
    width: 100%;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.right-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Audio player */
.audio-player-container {
    margin: 10px 0;
    width: 100%;
    flex-shrink: 0;
}

#audio-player {
    display: none; /* Hide the native audio player */
}

/* Custom audio player */
.custom-audio-player {
    display: flex;
    align-items: center;
    padding: 10px;
}

/* Play/Pause button */
.play-pause-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    background-color: #ddd;
    margin-right: 10px;
}

.play-pause-btn svg {
    width: 24px;
    height: 24px;
}

.play-icon {
    display: block;
}

.pause-icon {
    display: none;
}

.play-pause-btn.playing .play-icon {
    display: none;
}

.play-pause-btn.playing .pause-icon {
    display: block;
}

/* Time display */
.time-display {
    font-size: 12px;
    color: #555;
    min-width: 40px;
    text-align: center;
}

.current-time {
    margin-right: 10px;
}

.duration {
    margin-left: 10px;
    margin-right: 15px;
}

/* Audio player progress bar */
.player-progress-container {
    flex: 1;
    height: 36px;
    display: flex;
    align-items: center;
}

.player-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #ddd;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.player-progress-fill {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 3px;
    width: 0%;
    position: absolute;
    top: 0;
    left: 0;
}

.player-progress-handle {
    width: 12px;
    height: 12px;
    background-color: #4CAF50;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0%;
    margin-left: -6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: none;
}

.player-progress-bar:hover .player-progress-handle {
    display: block;
}

/* Volume control */
.volume-container {
    display: flex;
    align-items: center;
    position: relative;
}

.volume-btn {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    margin-right: 5px;
}

.volume-btn svg {
    width: 20px;
    height: 20px;
}

.volume-icon {
    display: block;
}

.mute-icon {
    display: none;
}

.muted .volume-icon {
    display: none;
}

.muted .mute-icon {
    display: block;
}

.volume-slider {
    width: 60px;
    height: 6px;
    background-color: #ddd;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.volume-fill {
    height: 100%;
    background-color: #4CAF50;
    border-radius: 3px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.volume-handle {
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0;
    margin-right: -5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: none;
}

.volume-slider:hover .volume-handle {
    display: block;
}

/* Responsive styles for the audio player */
@media (max-width: 768px) {
    .custom-audio-player {
        flex-wrap: wrap;
    }
    
    .player-progress-container {
        order: 2;
        width: 100%;
        margin: 10px 0;
    }
    
    .time-display.duration {
        margin-right: 0;
    }
    
    .volume-container {
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .volume-slider {
        width: 40px;
    }
    
    .time-display {
        min-width: 35px;
        font-size: 11px;
    }
}

/* Speaker estimation spinner */
.speaker-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #333;
    animation: speaker-spin 1s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

@keyframes speaker-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive layout */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .right-buttons {
        margin-top: 10px;
        justify-content: flex-start;
    }
}
