
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/*body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: start;
    padding: 20px;
}*/

/*.container_video {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 800px;
    width: 100%;
}*/

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

h2 {
    color: #333;
    font-size: 18px;
    margin-bottom: 10px;
}

.instructions {
    color: white;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
}

video {
    width: 100%;
    display: block;
}

.recording-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

.recording-indicator.active {
    display: flex;
}

.recording-dot {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.config-section {
    margin-bottom: 20px;
}

.input-group {
    margin: 15px;
}

label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.status.info {
    background: #dbeafe;
    color: #1e40af;
}

.status.success {
    background: #dcfce7;
    color: #166534;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
}

.help-text {
    color: #6b7280;
    font-size: 13px;
    margin-top: 5px;
}

#transcription, #transcription_fusion {
    margin-top: 20px;
}

#details, #details_fusion {
    display: none;
}

#transcriptionResult_video, #transcriptionResult_fusion {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#nbest, #nbest_fusion {
    background: #f9fafb;
    margin-bottom: 2em;
    border-radius: 8px;
    padding: 5px 30px;
    min-height: 2em;
}

#nbest li, #nbest_fusion li{
    padding: 0.25em 0;
}

.best {
    font-weight: normal;
}

.word {
    display: inline-block;
    margin: 0 3px;
    border-radius: 5px;
}

.verylow { color: #990000; }
.low { color: #cc6600; }
.medium { color: #b3b30a; }
.high { color: #059b05; }
.veryhigh{ color: #025a02; }

.text-wrapper {
    position: relative;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Estado mientras espera la API */
.is-loading {
    filter: blur(5px);
    opacity: 0.7;
    color: transparent !important;
    user-select: none;
}

.is-loading::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0%;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    border-right: 2px solid #007bff; /* Cursor */
    animation:
        writing-move 1.2s infinite ease-in-out,
        cursor-blink 0.6s infinite step-end;
}

@keyframes writing-move {
    0% { width: 0%; left: 0; }
    50% { width: 70%; left: 0; }
    100% { width: 0%; left: 100%; }
}

@keyframes cursor-blink {
    50% { border-color: transparent; }
}

.custom-accordion {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 10px 0;
    transition: all 0.3s ease;
}

/* El botón que despliega */
.custom-accordion summary {
    padding: 12px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: bold;
    list-style: none; /* Quita la flecha por defecto */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Añade una flecha personalizada */
.custom-accordion summary::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.custom-accordion[open] summary::after {
    transform: rotate(180deg);
}

.keyboard-hint {
    text-align: center;
    margin-top: 20px;
    color: #6b7280;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.key {
    background: #374151;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: bold;
    font-size: 12px;
}
    color: #333;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.status.info {
    background: #dbeafe;
    color: #1e40af;
}

.status.success {
    background: #dcfce7;
    color: #166534;
}

.status.error {
    background: #fee2e2;
    color: #991b1b;
}

.help-text {
    color: #6b7280;
    font-size: 13px;
    margin-top: 5px;
}

.keyboard-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    margin-top: 10px;
}

.key {
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 12px;
}

#transcription {
    /*display: none;*/
    margin-top: 20px;
}

#details {
    display: none;
}

#transcriptionResult {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#nbest {
    background: #f9fafb;
    margin-bottom: 2em;
    border-radius: 8px;
    padding: 5px 30px;
    min-height: 2em;
}

#nbest li{
    padding: 0.5em 0;
}
.best {
    font-weight: normal;
}

.word {
    display: inline-block;
    margin: 0 3px;
    border-radius: 5px;
}
.verylow { color: #990000; }
.low { color: #cc6600; }
.medium { color: #b3b30a; }
.high { color: #059b05; }
.veryhigh{ color: #025a02; }

.text-wrapper {
    position: relative;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Estado mientras espera la API */
.is-loading {
    filter: blur(5px);
    opacity: 0.7;
    color: transparent !important;
    user-select: none;
}

.is-loading::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0%;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    border-right: 2px solid #007bff; /* Cursor */
    animation:
        writing-move 1.2s infinite ease-in-out,
        cursor-blink 0.6s infinite step-end;
}

@keyframes writing-move {
    0% { width: 0%; left: 0; }
    50% { width: 70%; left: 0; }
    100% { width: 0%; left: 100%; }
}

@keyframes cursor-blink {
    50% { border-color: transparent; }
}

.custom-accordion {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 10px 0;
    transition: all 0.3s ease;
}

/* El botón que despliega */
.custom-accordion summary {
    padding: 12px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: bold;
    list-style: none; /* Quita la flecha por defecto */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Añade una flecha personalizada */
.custom-accordion summary::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.custom-accordion[open] summary::after {
    transform: rotate(180deg);
}