/* Base page styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Split-screen layout */
.content-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    gap: 20px;
    padding: 15px;
}

/* Left panel - transcript section */
.transcript-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Right panel - results section */
.results-section {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    padding: 15px;
}

/* Control buttons styling */
.top-controls {
    display: flex;
    align-items: left;
    justify-content: left;
    /* Changed from space-between to center */
    padding: 15px;
    background-color: #f9f9f9;
}

.token-input {
    display: flex;
    align-items: left;
    justify-content: left;
    padding: 5px;
    background-color: #f7f7f7;
}

.token-input label {
    margin-right: 10px;
    font-weight: bold;
}

.token-input input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 250px;
}

#showApiToken {
    margin-left: 10px;
    font-size: 12px;
    color: #007BFF;
    cursor: pointer;
    text-decoration: underline;
}

.button-group {
    display: flex;
    gap: 10px;
}

.button-group button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.button-group button:disabled {
    background-color: #cccccc !important;
    color: #fff !important;
    cursor: not-allowed !important;
}

#stopButton {
    background-color: #f44336;
}

#getSessionIdButton {
    background-color: #e1f436;
    color: #727272;
}

/* Contactmoment styling */
.contactmoment-indicator {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: #e6f3ff;
    border: 1px solid #cce6ff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.contactmoment-indicator:hover {
    background-color: #d1e7ff;
    border-color: #99d6ff;
}

.contactmoment-type {
    color: #0066cc;
    font-weight: 600;
    font-size: 14px;
}

.dropdown-arrow {
    color: #0066cc;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.contactmoment-indicator.open .dropdown-arrow {
    transform: rotate(180deg);
}

.contactmoment-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.contactmoment-option {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.contactmoment-option:last-child {
    border-bottom: none;
}

.contactmoment-option:hover {
    background-color: #f5f5f5;
}

.contactmoment-option.selected {
    background-color: #e6f3ff;
    color: #0066cc;
    font-weight: 600;
}

/* Transcription area */
.transcription {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
}

#transcriptionOutput {
    min-height: 100px;
}

/* Speaker bubbles */
.message-row {
    margin-bottom: 12px;
}

.bubble {
    display: inline-block;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
}

.speaker-0 {
    background-color: #e3f2fd;
    border-top-left-radius: 4px;
    margin-right: auto;
}

/* Status message */
.status {
    text-align: center;
    padding: 10px;
    font-size: 14px;
    color: #555;
}

/* Send button container */
.send-button-container {
    padding: 15px;
    text-align: center;
    border-top: 1px solid #eaeaea;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

#sendTranscriptButton,
#sendTranscriptPollingButton {
    padding: 10px 20px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    max-width: 250px;
    flex: 1;
    min-width: 200px;
}

#sendTranscriptButton:hover,
#sendTranscriptPollingButton:hover {
    background-color: #0b7dda;
}

/* Demo checkbox styling */
.demo-control {
    display: flex;
    align-items: center;
    padding: 0px 0px;
    border-radius: 4px;
}

.demo-control input {
    margin-right: 5px;
}

.demo-control label {
    cursor: pointer;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-select {
    padding-right: 25px;
    appearance: none;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 30px 5px 10px;
    cursor: pointer;
}

.dropdown-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
}

.loader {
    display: none;
}

.modal-content p {
    font-size: 18px;
    margin-bottom: 25px;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.modal-buttons button {
    padding: 8px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* Speaker bubbles alignment */
.message-row {
    margin-bottom: 12px;
    display: flex;
    width: 100%;
}

.bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
}

.speaker-0 {
    background-color: #e3f2fd;
    border-top-left-radius: 4px;
    margin-right: auto;
    /* Push to the left */
    align-self: flex-start;
}

.speaker-other {
    background-color: #e8f5e9;
    border-top-right-radius: 4px;
    margin-left: auto;
    /* Push to the right */
    align-self: flex-end;
}

#confirmYesButton {
    background-color: #4CAF50;
    color: white;
}

#confirmNoButton {
    background-color: #f44336;
    color: white;
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* LLM Results styling */
.llm-results {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.results-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.results-table tr:last-child {
    border-bottom: none;
}

.results-table td {
    padding: 12px 8px;
}

.result-key {
    font-weight: bold;
    width: 30%;
}

.result-value {
    width: 70%;
}

/* Dossier button styling */
.dossier-button-container {
    margin-top: 25px;
    margin-bottom: 30px;
    text-align: center;
}

#sendToDossierButton {
    padding: 10px 25px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

#sendToDossierButton:hover {
    background-color: #0b7dda;
}

/* Editable fields styling */
.editable-field {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.editable-field:focus {
    border-color: #2196F3;
    outline: none;
    box-shadow: 0 0 4px rgba(33, 150, 243, 0.3);
}

textarea.editable-field {
    resize: vertical;
    min-height: 60px;
}

/* Radio button styling */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 5px 0;
}

.radio-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.radio-option:hover {
    background-color: #e8e8e8;
}

.radio-option input[type="radio"] {
    margin-right: 6px;
}

.radio-option input[type="radio"]:checked+label {
    font-weight: bold;
    color: #2196F3;
}

.radio-option input[type="radio"]:checked {
    accent-color: #2196F3;
}

.radio-option.selected {
    background-color: #e3f2fd;
    border-color: #2196F3;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }

    .transcript-section,
    .results-section {
        height: 50vh;
    }
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-option {
    display: flex;
    align-items: center;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 8px;
}

.ai-warning {
    margin: 10px 0;
    padding: 10px;
    color: #664d03;
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    width: 100%;
}

.dossier-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    width: 100%;
}

.contactmoment-display {
    text-align: left;
    margin: 0;
    padding: 0px;
    border-radius: 4px;
}

.demo-control {
    margin-top: 20px;
    /* Add space above demo controls */
}

.contactmoment-display .label {
    font-weight: bold;
    margin-right: 10px;
}

.display-controls {
    margin: 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.display-controls>* {
    margin-bottom: 15px;
}

.display-controls>*:last-child {
    margin-bottom: 0;
}

/* Results fields styling */
.results-container {
    display: none;

    margin-top: 10px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.results-container h2 {
    margin-top: 7px;
    margin-bottom: 15px;
    font-size: 20px;
}

.results-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.results-field label {
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 6px;
    font-size: 15px;
}

.results-field textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #cfd8dc;
    border-radius: 5px;
    background: #fff;
    font-size: 15px;
    resize: vertical;
    transition: border-color 0.2s;
}

.results-field textarea:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 4px rgba(25, 118, 210, 0.15);
}

.results-field:last-child {
    margin-bottom: 0;
}

.results-field input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #cfd8dc;
    border-radius: 5px;
    background: #fff;
    font-size: 15px;
    box-sizing: border-box;
}

.htt-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.htt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #cfd8dc;
    border-radius: 5px;
    font-size: 14px;
}

.htt-row > span:first-child {
    color: #37474f;
}

.htt-row > span:last-child {
    font-weight: 600;
    color: #1976d2;
}

.htt-row.htt-overall {
    background: #eef6ff;
    border-color: #1976d2;
}
