/* https://jsonformatter.org/scss-to-css#google_vignette */
#app {
  height: 100dvh;

  display: flex;
  flex-direction: column;

  background-color: white; /* lightgray;*/

  padding: 0px;
  margin: auto;

  #titulo {
    height: 64px;
    text-align: center;
    font-size: xx-large;
    background-color: var(--color-azul-marino);
    display: flex;
    flex-direction: row;
    justify-content: center;
    column-gap: 3rem;

    span {
      margin-top: auto;
      margin-bottom: auto;
      color: white;
      font-size: 15px;
    }
  }
  #pantallas {
    flex: 1;
    display: flex;
    flex-direction: column;

    .pantalla {
      flex: 1;
      display: flex;
      flex-direction: row;

      .zonalistado {
        flex: 1;
        margin-left: 0px;
        min-width: var(--app-ancho-listado);
        background-color: white;

        .cabecera h4 {
          text-align: center;
        }
        .listado {
          flex: 1;
          max-width: 100%;

          display: flex;
          flex-direction: column;

          QQQQQQ.cabecera {
            height: 32px;
          }
          .cuerpo {
            flex: 1;
            max-height: calc(100dvh - 246px);
            overflow-y: auto;
            overflow-x: hidden;

            .listado1 {
              color: #039be5;
            }
            .listado1.active {
              background-color: #039be5;
              color: white; /*var(--color-azul-marino);*/
            }
            .listado1.chatlistado {
              height: 64px;

              span.contenido {
                font-size: small;
                color: black;
                display: block;
                overflow-wrap: break-word;
                display: inline-block;
                white-space: nowrap;
                overflow: hidden !important;
                text-overflow: ellipsis;

                max-width: 75%; /* 2025-09-03 */
                position: absolute; /* 2025-09-03 */
                .material-symbols-outlined {
                  font-size: small;
                  vertical-align: middle;
                  margin-right: 2px;
                }
              }
              /*
              span.contenido.Fichero::before {
                content: "\1F4CE\0020";
              }
              span.contenido.todoleido::before {
                q-content: "\2713\0020";
              }
*/
              span.contenido.todoleido {
                color: #888;
              }

              span.paciente {
                display: block;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
              }
              span.paciente.noleido {
                font-weight: bold;
              }

              span.hora {
                font-size: 12px;
                color: #888;
                float: right;
              }
              span.hora.noleido {
                color: #4caf50;
                font-weight: bold;
              }
              span.count {
                font-size: 12px;
                float: right;
              }
              span.count.todoleido {
                display: none;
              }
              span.count.noleido {
                background-color: #4caf50;
                color: white;
                padding: 1px 7px 1px 6px;
                border-radius: 20px;
                min-width: 23px;
                min-height: 20px;
                text-align: center;
              }
            }
            .listado1.chatlistado.active {
              span.hora,
              span.count,
              span.contenido {
                color: white;
              }
            }
          }
        }
      }
      .subpantalla {
        max-height: calc(100dvh - 128px);
        overflow-y: auto;
        .formPACIENTE {
          background-color: white;
          h4 {
            font-size: 18px;
            font-weight: 600;
          }
        }
        .formCHAT {
          [estado="creado"] {
            display: flex;
            flex-direction: column;
            margin-left: 0px;

            .chat-cabecera {
              text-align: center;
              height: 80px;
              background-color: white;
              box-shadow: 1px 1px 1px #e0e0e0;
              border-bottom: 1px solid #e0e0e0;
              border-left: 1px solid #e0e0e0;
              a.btncabecera {
                width: 100%;
                height: 78px;
              }
              h4 {
                overflow-wrap: break-word;
                display: inline-block;
                white-space: nowrap;
                overflow: hidden !important;
                text-overflow: ellipsis;
                width: 95%;
                q-color: #039be5;

                /*margin:auto; */
              }
            }

            .chat-listado {
              flex: 1;
              max-width: 100%;

              display: flex;
              flex-direction: column;

              aquino-background-image: linear-gradient(rgba(237, 231, 220, 0.9), rgba(237, 231, 220, 0.9)), url("../../../images/whatsapp/fondo-chat.png");
              aquino-background-repeat: repeat;
              q-filter: hue-rotate(311deg); /* aqui debe ir para no afectar a todo */
              filter: hue-rotate(0deg); /* aqui debe ir para no afectar a todo */

              .chat-cuerpo {
                flex: 1;
                max-height: calc(100dvh - 200px);
                overflow-y: auto;
                overflow-x: hidden;

                scrollbar-width: thin;
                scrollbar-color: rgba(0, 0, 0, 0.2) transparent;

                list-style: none;
                padding: 1rem 4rem 1rem 4rem;
                width: 100%;
                margin-block-end: 0;
                margin-block-start: 0;
                @media only screen and (max-width: 600px) {
                  padding: 1rem 1rem 1rem 1rem;
                }

                li {
                  max-width: 60%;
                  position: relative;
                  margin-bottom: 2px;
                  padding: 10px 15px;
                  border-radius: 8px;

                  word-wrap: break-word;
                  display: table;
                  @media only screen and (max-width: 600px) {
                    max-width: 90%;
                  }
                  box-shadow: 1px 1px 0.5px rgba(0, 0, 0, 0.13);
                }

                li.pregunta {
                  background-color: #ffffff;
                  align-self: flex-start;
                  margin-right: auto;
                }
                li.respuesta {
                  background-color: var(--whatsapp-amarillo); /* #dcf8c6; /* Verde de WhatsApp */
                  align-self: flex-end;
                  margin-left: auto;
                }
                li.respuesta + li.pregunta {
                  border-top-left-radius: 0;
                }
                li.pregunta + li.respuesta {
                  border-top-right-radius: 0;
                }
                li.mensaje.fichero span.material-symbols-outlined {
                  vertical-align: bottom;
                }

                li.pregunta + li.respuesta,
                li.respuesta + li.pregunta {
                  margin-top: 15px;
                }

                li.mensaje.fichero a {
                  text-decoration: underline;
                  color: #039be5;
                }

                .hora {
                  bottom: 5px;
                  right: 10px;
                  font-size: 0.7em;
                  color: #888;
                  float: right;
                  padding-top: 1rem;
                  padding-left: 1rem;
                }

                /* Estilos para el efecto de bocadillo */
                li.respuesta + li.pregunta::before {
                  content: "";
                  position: absolute;
                  left: -9px;
                  width: 0;
                  height: 0;
                  border-top: 10px solid #ffffff;
                  border-left: 10px solid transparent;
                  transform: translateY(-100%);
                  border-bottom-left-radius: 5px; /* Para que la punta sea más suave */
                }

                li.pregunta + li.respuesta::before {
                  content: "";
                  position: absolute;
                  right: -9px;
                  width: 0;
                  height: 0;
                  border-top: 10px solid var(--whatsapp-amarillo); /* Verde de WhatsApp */
                  border-right: 10px solid transparent;
                  transform: translateY(-100%);
                  border-bottom-right-radius: 5px; /* Para que la punta sea más suave */
                }
              }
              .chat-acciones {
                display: flex;
                flex-direction: row;
                width: calc(100% - 2rem);
                position: absolute;
                bottom: 0;
                background-color: white;
                align-items: center;
                left: 1rem;
                padding: 8px;
                border-radius: 27px;
                margin-bottom: 1rem;
                box-shadow: 2px 2px 5px rgb(109, 135, 135);

                [name="msg"] {
                  flex: 1;
                  margin-left: 0.5rem;
                  margin-right: 0.5rem;
                  padding-top: 4px;
                  padding-left: 8px;
                  overflow: hidden;
                  border: 0;
                  height: 30px;
                  outline: 0;
                }
                [name="msg"]::placeholder {
                  color: grey;
                }
                .material-symbols-outlined {
                  font-size: 24px;
                  padding-top: 8px;
                }
                .btn-large {
                  padding-left: 8px;
                  padding-right: 8px;
                }
                #formChatAnexo {
                  border: 0;
                  box-shadow: none;
                }
              }
              @media only screen and (max-width: 600px) {
                .chat-acciones {
                  width: 99%;
                  left: 0;
                  margin-bottom: 8px;
                }
              }
            }
          }
        }
      }
      .contenido {
        flex: 4;
      }
    }
  }

  #pantalla-Chats {
    background-color: var(--beige);
    background-image: linear-gradient(rgba(237, 231, 220, 0.9), rgba(237, 231, 220, 0.9)), url("../../../images/whatsapp/fondo-chat.png");

    .formCHAT [estado="nuevo"] {
      background-color: white;
    }
    .subpantalla {
      flex: 1;
      display: flex;
      flex-direction: column;

      max-height: calc(100dvh - 64px) !important;
      .form {
        flex: 1;
        display: flex;
        flex-direction: column;
        [estado="creado"] {
          flex: 1;
        }
      }
    }
  }

  background-color: white;
  #navigatorwrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    .navigatormargin {
      flex: 1;
    }

    #navigator {
      flex: 3;
      height: 64px;
      display: flex;
      flex-direction: row;
      justify-content: space-around;
      padding: 4px;
      margin: 0;

      .material-symbols-outlined {
        font-size: 32px;
        padding-top: 12px;
        margin-left: 12px;
        margin-right: 12px;
      }
      .btn-large {
        padding-left: 8px;
        padding-right: 8px;
      }
      .btn.active {
        background-color: var(--color-azul-intenso) !important;
        span {
          color: white;
        }
      }
      #add-Element {
        padding-left: 0;
        padding-right: 0;
        position: fixed;
        right: 40px;
        bottom: 100px;
      }
      li.msgError {
        height: 50%;
        position: absolute;
        top: 25%;
        left: 5%;
        width: 90%;
        a#formError {
          width: 100%;
          height: 100%;
          padding-top: 15%;
          font-size: 2.28rem;
        }
      }
    }
  }

  qqq#navigatorwrapper[nomPantalla="Chats"] {
    display: none;
  }

  QUITADODEMOMENTO#navigatorwrapper[nomPantalla="Chats"] {
    .navigatormargin.izquierda {
      display: none;
    }
    #navigator {
      justify-content: space-between;
      flex: 1;
    }
    .navigatormargin.derecha {
      flex: 4;
    }
  }

  #espaciomenurutas,
  #espaciomenunuevaruta,
  #espaciodiseno {
    .menuruta {
      box-shadow: 10px 10px 10px rgb(109, 135, 135); /*4px 4px 2px rgb(109,135,135);*/
      padding: 5px;
      background-color: cadetblue;
      border-radius: 8px;
      margin-top: 16px;

      padding: 8px;
      color: white;
      width: 78px;
      a {
        padding: 8px;
        color: white;
        display: inline-block;
        width: 100%;
      }
    }
    .menuruta.active {
      box-shadow: 1px 1px 1px rgb(109, 135, 135);
      margin-left: 15px;
      a {
        color: yellow;
      }
    }
  }
}
