/* Base Recording Entry Styles */
.recording-entry {
    background-color: #ffffff;
    border: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.recording-entry:hover {
    background-color: #e9ecef;
}

.recording-entry audio {
    height: 32px !important;
    min-width: 200px;
}

.recording-entry .timestamp {
    min-width: 180px;
    font-size: 0.875rem;
    color: #495057;
}

.recording-entry .btn-group {
    display: flex;
    gap: 0.25rem;
}

.recording-entry .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    height: 31px; /* Fixed height to match all buttons */
}

.recording-entry .btn i {
    font-size: 0.875rem;
}
.recording-header {
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Recording Name Styles */
.recording-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.875rem;
    margin-right: 1rem;
    display: inline-block;
}

/* Recording Controls */
.recording-status {
    color: #dc3545;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.recording-time {
    font-family: monospace;
    font-size: 0.875rem;
}

#recordButton {
    min-width: 100px;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#recordButton.recording {
    background-color: #dc3545;
    border-color: #dc3545;
    animation: pulse 2s infinite;
}
.controls {
    display: flex;
    align-items: center;
    gap: 0.35rem; /* Reduced from 0.75rem */
    flex-wrap: nowrap;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.audio-section {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}
/* Enforce consistent styling for "View Transcript" button */
button[data-action="show-transcript"] {
    background-color: #007bff !important; /* Replace with the current desired color */
    color: #fff !important; /* Text color */
    border: 1px solid #007bff !important;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Hover effect for "View Transcript" button */
button[data-action="show-transcript"]:hover {
    background-color: #0056b3 !important; /* Replace with desired hover color */
    border-color: #0056b3 !important;
}

.loading-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 0.5rem;
    color: #4a5568;
    font-size: 0.875rem;
}

#recordingStatus .spinner-grow {
    width: 0.7rem;
    height: 0.7rem;
}

/* Loading Animation Styles */
.loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
}

.loading-dots::before,
.loading-dots::after,
.loading-dots span::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    animation: dots-fade 0.8s ease-in-out infinite;
}

.loading-dots::after {
    animation-delay: 0.2s;
}

.loading-dots span::before {
    animation-delay: 0.4s;
}

@keyframes dots-fade {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Transcript and Classifications Styles */
.transcript-section {
    display: none;
    background-color: #ffffff;
    margin: 0;
    border-top: 1px solid #dee2e6;
    font-size: 0.875rem;
}

.transcript-wrapper {
    padding: 1rem;
}
.transcript-loading {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.transcript-text {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: normal;
}

.transcript-text::before {
    content: "Transcript:";
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #212529;
    font-size: 0.875rem;
}

.classifications-section {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.classification-category {
    margin-bottom: 0.5rem;
}

.classification-category:last-child {
    margin-bottom: 0;
}

.classification-content {
    padding: 0.5rem;
    margin-top: 0.25rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.875rem;
}

.classification-title {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* Button Styles */
.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-outline-secondary {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}
.rename-button,
.delete-button {
    width: 31px; /* Make square buttons */
    padding: 0;
}

.rename-button:hover,
.delete-button:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

.rename-button:active,
.delete-button:active {
    transform: translateY(0);
}

.transcript-toggle {
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

/* Audio Player Styles */
.audio-container {
    background-color: transparent !important;
    border-radius: 4px;
    padding: 4px;
    margin: 0;
    width: 100% !important;
    height: 32px !important;
    display: flex;
    align-items: center;
}
.audio-container audio {
    width: 100% !important;
    height: 32px !important;
    min-width: 200px !important;
}

.audio-container.loading {
    background-color: rgba(247, 250, 252, 0.8);
}

audio {
    width: 400px !important;
    height: 32px !important;
    min-width: 400px !important;
}

audio::-webkit-media-controls-panel {
    background-color: transparent !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 8px !important;
}

audio::-webkit-media-controls-panel:hover {
    background-color: transparent !important;
}

audio::-webkit-media-controls-timeline {
    background-color: #e9ecef;
    border-radius: 2px;
    height: 4px;
    margin: 0 8px;
    flex-grow: 1;
}

audio::-webkit-media-controls-volume-slider {
    order: 3;
    width: 50px !important;
    margin-left: auto !important;
}

audio::-webkit-media-controls-volume-control-container {
    order: 3;
    justify-self: flex-end;
    margin-left: auto !important;
}

audio::-webkit-media-controls-mute-button {
    order: 2;
    margin-left: auto !important;
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: #495057;
    font-family: monospace;
    font-size: 0.875rem;
    min-width: 45px !important;
    text-align: center;
}

/* Loading States */
.transcript-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.transcript-loading .spinner-border {
    display: none;
}

/* Error States */
.transcript-error {
    padding: 1rem;
    background-color: #fee2e2;
    border-radius: 4px;
    margin: 0.5rem 0;
    color: #dc2626;
}

.transcript-error .btn-link {
    color: #dc2626;
    text-decoration: underline;
    padding: 0;
    font-size: 0.875rem;
}

/* Client Communication Text */
.client-comm-text {
    font-size: 11px;
    line-height: 1.4;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #212529;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.client-comm-label {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.25rem;
}
.classification-content ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.classification-content li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.25rem;
}

.classification-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
}
/* Responsive Styles */
@media (max-width: 768px) {
    .recording-entry .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .recording-entry .timestamp {
        margin-bottom: 0.5rem;
    }

    .recording-entry audio {
        width: 100%;
        max-width: none;
        margin: 0.5rem 0;
    }

    .recording-entry .controls {
        display: flex;
        flex: 0 0 auto;
        gap: 0.5rem;
        margin-left: auto; /* Push to right */
    }

    .recording-entry .controls button {
        flex: 0 0 auto; /* Prevents button shrinking */
    }

    /* Make transcript button not stretch */
    button[data-action="show-transcript"] {
        background-color: #007bff !important;
        color: #fff !important;
        border: 1px solid #007bff !important;
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        transition: all 0.3s ease;
        height: 31px;
        display: flex;
        align-items: center;
    }

    .btn-group {
        width: 100%;
        justify-content: flex-end;
    }

    .transcript-toggle {
        flex: 1;
    }

    .audio-container {
        width: 100% !important;
        min-width: unset !important;
        margin: 0;
    }

    .audio-container audio {
        width: 100% !important;
        min-width: unset !important;
    }

    .recording-header .d-flex {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem; /* Match the controls gap */
        justify-content: space-between;
        align-items: center;
    }
    .controls {
        gap: 0.35rem; /* Keep consistent spacing on mobile */
    }
    .recording-entry .btn {
        padding: 0.25rem;
        font-size: 0.75rem;
        height: 28px;
    }

    .rename-button,
    .delete-button {
        width: 28px;
        height: 28px;
    }
    
    button[data-action="show-transcript"] {
        height: 28px;
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    /* Adjust icon sizes */
    .recording-entry .btn i {
        font-size: 0.75rem;
    }

    /* Time and name handling */
    .recording-entry .timestamp {
        margin-bottom: 0;
    }

    .recording-name {
        margin-right: 0.5rem;
    }

}

@media (max-width: 480px) {
    .recording-header .d-flex {
        flex-wrap: nowrap;
        align-items: center;
    }

    .controls {
        gap: 0.25rem;
    }

    button[data-action="show-transcript"] {
        padding: 0.25rem;
        min-width: auto;
    }

    .timestamp {
        font-size: 0.75rem;
        min-width: auto !important;
    }

    .recording-name {
        font-size: 0.75rem;
        margin-right: 0.25rem;
    }
}


/* Accessibility Styles */
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.btn:focus:not(:focus-visible) {
    box-shadow: none;
}

/* High Contrast Mode */
@media (forced-colors: active) {
    .recording-entry,
    .btn,
    .transcript-wrapper {
        border: 1px solid CanvasText;
    }
}

/* Print Styles */
@media print {
    .recording-entry {
        break-inside: avoid;
        border: 1px solid #000;
        font-size: 0.875rem;
    }

    .audio-controls,
    .btn,
    audio,
    .modal {
        display: none !important;
    }

    .transcript-section {
        display: block !important;
        border: none;
    }

    .transcript-content {
        font-size: 0.875rem;
    }
}

/* Browser-Specific Styles */
@-moz-document url-prefix() {
    audio {
        width: 400px !important;
    }
}

@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        audio {
            width: 400px !important;
        }
    }
}

/* Form Control Styles within Recordings */
#recordings .transcript-section .form-control,
#recordings .classifications-section .form-control,
#recordings textarea.form-control,
#recordings .form-control {
    font-size: 11px !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
}

#recordings .form-control:focus,
#recordings .form-control:active,
#recordings textarea.form-control:focus,
#recordings textarea.form-control:active {
    font-size: 11px !important;
}

#recordings .classification-content,
#recordings .classification-category textarea {
    font-size: 11px !important;
}