:root {
    --bg-color: #0f172a;
    --paper-bg: rgba(30, 41, 59, 0.7);
    --accent-color: #38bdf8;
    --text-color: #e2e8f0;
    --danger: #ef4444;
}

body {
    background-color: #1e293b;
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    height: 100dvh;
    margin: 0;
    display: flex;
    justify-content: center;
    overflow: hidden;
    
    /* Aplicamos un linear-gradient antes de la URL de la imagen */
    background-image: linear-gradient(
        rgba(30, 41, 59, 0.8), /* El último valor (0.8) controla la opacidad */
        rgba(30, 41, 59, 0.8)
    ), 
    url('../../Includes/img/BackIcon.png');
    
	background-repeat: repeat; */
}

.name {
    background: var(--paper-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 10px 15px;
}

.app-shell {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    position: relative;
    padding: 0 15px;
}

/* Cabecera Estilo EchoWriter */
.header-nav {
    padding: 20px 0;
    z-index: 10;
}

.lang-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 15px;
    background: var(--paper-bg);
    padding: 10px 15px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.form-select-custom {
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    outline: none;
    width: 100%;
    appearance: none; /* Quitar flecha default */
    cursor: pointer;
}

.form-select-custom option {
    background: #1e293b;
    color: white;
}

/* Contenedor de Historia - El "Documento" */
#historyContainer {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: var(--paper-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    margin-bottom: 0;
}

/* Estilo de burbujas tipo documento */
.bubble {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
    max-width: 100%;
}

.original {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--accent-color);
    opacity: 0.8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.translated {
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    color: var(--text-color);
    line-height: 1.6;
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
}

/* Barra de dictado (Preview y Micrófono) */
.dictation-bar-container {
    background: var(--paper-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    padding-bottom: calc(25px + env(safe-area-inset-bottom));
    border-radius: 0 0 24px 24px;
    margin-bottom: 20px;
    
    
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-box {
    min-height: 50px;
    margin-bottom: 15px;
}

#currentTextDisplay {
    color: var(--accent-color);
    font-style: italic;
    font-size: 0.95rem;
    opacity: 0.9;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* Botón de Micrófono Pro */
.mic-btn {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: #0f172a;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mic-btn.active {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
    animation: pulse 1.5s infinite;
}

.voice-action-btn {
    width: 45px; height: 45px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

#voiceToggle {
    position: absolute;
    opacity: 0;
    width: 100%; height: 100%;
    cursor: pointer;
    z-index: 2;
}

#voiceToggle:checked + i::before { content: "\F650"; color: var(--accent-color); }
#voiceToggle:not(:checked) + i::before { content: "\F64E"; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0px rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0px rgba(239, 68, 68, 0); }
}

/* Ocultar scrollbar */
#historyContainer::-webkit-scrollbar { width: 4px; }
#historyContainer::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }