: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/BackIconCoach.png');
    
    background-repeat: repeat;
}

.app-shell {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    position: relative;
    padding: 0 15px;
}

/* Cabecera */
.header-nav {
    padding: 20px 0;
    z-index: 10;
}

.brand-header {
    background: var(--paper-bg);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Contenedor de Chat */
#chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    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;
    gap: 20px;
    scroll-behavior: smooth;
}

/* Burbujas de Mensaje */
.msg-user {
    align-self: flex-end;
    max-width: 85%;
    animation: fadeIn 0.4s ease;
}

.msg-user .text-content {
    background: var(--accent-color);
    color: #0f172a;
    padding: 12px 18px;
    border-radius: 20px 20px 0 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

.msg-ai {
    align-self: flex-start;
    max-width: 90%;
    animation: fadeIn 0.4s ease;
    cursor: pointer;
}

.msg-ai .label {
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.msg-ai .text-content {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    line-height: 1.6;
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
    color: var(--text-color);
}

/* Caja de Traducción interna */
.translation-box {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #94a3b8;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    font-style: italic;
}

/* Footer y Controles */
.footer-controls {
    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);
}

.input-group-custom {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-field {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 25px;
    padding: 12px 20px;
    color: white;
    outline: none;
}

.mic-btn {
    width: 55px; height: 55px;
    border-radius: 50%;
    border: none;
    background: var(--accent-color);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.mic-btn.recording {
    background: var(--danger);
    color: white;
    animation: pulse 1.5s infinite;
}

.action-btn {
    width: 45px; height: 45px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: var(--text-color);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

@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 15px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0px rgba(239, 68, 68, 0); }
}

#chat-box::-webkit-scrollbar { width: 4px; }
#chat-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }