
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    background: #f4f4f4;
}


.chat-container {
    display: flex;
    flex-direction: column;
    height: 100dvh; 
    background: #fff;
}


.chat-box {
    flex: 1;
    padding: 12px;
    overflow-y: auto; 
    background: #f9f9f9;
}





.avatar-img,
.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-img {
    object-fit: cover;
}

.avatar-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}


.message-content {
    flex: 1;
}

.message-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.message-left {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.message-left strong {
    color: #000;
    font-size: 13px;
}

.message-text {
    font-size: 13px;
    color: #333;
}

.time-ago {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}


.input-container {
    display: flex;
    align-items: center; 
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #fff;
}


input[type="text"] {
    flex: 1;
    padding: 10px;
    background: #F1F1F1;
    border-radius: 50px;
    border: none;
    font-size: 14px;
    outline: none;
}

input[type="text"]:focus {
    outline: none;
    box-shadow: none;
}

input[type="file"] {
    flex: 1;
    font-size: 12px;
}


#sendButton {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #1257cd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0; 
}

#sendButton svg {
    width: 20px;
    height: 20px;
}


#emojiButton {
    display: none;
}


.emoji-container {
    position: fixed;
    bottom: 80px;
    right: 10px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 10px;
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-content input {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.modal-content button {
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: #1257cd;
    color: #fff;
}



html, body {
    height: 100%;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: #f4f4f4;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100dvh; 
    background: #fff;
}

.chat-box {
    flex: 1;
    padding: 12px;
    overflow-y: auto; 
    background: #f9f9f9;
}

.chat-message {
    display: flex;
    align-items: center; 
    gap: 10px;
    margin-bottom: 12px;
}

.avatar-img,
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    margin-top: 2px; 
}

.avatar-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

.message-content {
    flex: 1;
}

.message-top {
    display: flex;
    justify-content: space-between;
align-items: center;
}

.message-left {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center; 
}

.message-text {
    color: #333;
}

.time-ago {
    font-size: 11px;
    color: #888;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid #ddd;
}

#myAvatar img,
#myAvatar .avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

input[type="text"] {
    flex: 1;
    padding: 10px;
    border-radius: 50px;
    border: 1px solid #ddd;
}

#sendButton {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #1257cd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.input-container {
    position: relative;
}


#messageInput {
    padding-right: 40px;
}


.clip-btn {
    position: absolute;
    right: 70px; 
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
}

.clip-btn:hover {
    opacity: 1;
}

.input-container {
    position: relative;
}


.clip-icon {
    width: 20px;
    height: 20px;
    fill: #000; 
    display: block;
}


/* MICROFONO ICONO */

.input-container {
    position: relative;
}

/* BOTÓN */
.mic-btn {
    position: absolute;
    right: 98px;
    top: 50%;
    transform: translateY(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    opacity: 0.7;

    background: transparent;
    border: none;
    outline: none;
    padding: 0;

    transition: transform 0.15s ease, opacity 0.15s ease;
}

.mic-btn:hover {
    opacity: 1;
}

/* evita que salte al hacer click */
.mic-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* estado grabando (SIN romper posición) */
.mic-btn.recording {
    transform: translateY(-50%) scale(1.2);
    opacity: 1;
}

/* ICONO */
.mic-icon {
    width: 20px;
    height: 20px;
    fill: #000;
    display: block;
}


/* INDICADOR GRABANDO (encima del input) */
.recording-indicator {
    position: absolute;
    left: 60px;             
    right: 140px;            
    top: 50%;
    transform: translateY(-50%);

    height: 36px;
    padding: 0 10px;

    display: none;
    align-items: center;
    gap: 8px;

    font-size: 13px;
    color: red;

    background: #f1f1f1;
    border-radius: 20px;


    z-index: 5;
}

/*  puntito animado */
.recording-indicator .dot {
    width: 10px;
    height: 10px;
    background: red;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.2; }
    100% { opacity: 1; }
}

/* FIN MICROFONO ICONO */




.audio-player {
    display: flex;
    align-items: center;
    gap: 8px;

    background: #e0e0e0;
    border-radius: 8px;
    padding: 6px 10px;

    max-width: 220px;
}

/* 🎤 BOTÓN SOLO SVG */
.play-btn {
    width: 24px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;  
    border: none;
    padding: 0;
    cursor: pointer;
}

/* SVG dentro del botón */
.play-btn svg {
    width: 100%;
    height: 100%;
    fill: #000;   
}

/* ONDA (ARREGLADA) */
.wave {
    flex: 1;
    height: 18px;

    background: repeating-linear-gradient(
        to right,
        #888 0px,
        #888 2px,
        transparent 2px,
        transparent 6px
    );

    border-radius: 10px;

    /* CLAVE para que se vea */
    min-width: 40px;
    opacity: 0.8;
}

/* tiempo */
.duration {
    font-size: 12px;
    color: #000;
    min-width: 35px;
    text-align: right;
}






#imagePreview {
    position: absolute;
    bottom: 60px;
    left: 60px;
    z-index: 10;
}

#imagePreview img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}


.chat-image {
    max-width: 200px;
    border-radius: 10px;
    margin-top: 5px;
}


.preview-wrapper {
    position: relative;
    display: inline-block;
}

.preview-wrapper img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 10px;
}

/* botoncito */
.remove-image {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #000;
    color: #fff;
    font-size: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}



/*  audio activo */
.audio-player.playing {
    background: #d9fdd3; 
}

/* animación mientras suena */
.audio-player.playing .wave {
    animation: waveMove 1s linear infinite;
}

@keyframes waveMove {
    from { background-position-x: 0; }
    to { background-position-x: 20px; }
}
