/* ============================= */
/* ====== Grade de Apps ====== */
/* ============================= */

/* Global font definition for app titles and intros */
.iot-title,
.iot-intro,
.emg-ped-title,
.emg-ped-intro {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Titles */
.iot-title,
.emg-ped-title {  
  font-size: clamp(1.8rem, 3vw, 2.4rem);  
  letter-spacing: -.5px;  
  margin: 0 0 .75rem;  
  font-weight: 600;
}

/* Intros */
.iot-intro,
.emg-ped-intro {  
  margin-top: 0;  
  margin-bottom: 1.75rem;  
  font-size: .95rem;  
  color: #6b7280;  
  max-width: 62ch;  
}

body.dark-mode .iot-intro,
body.dark-mode .emg-ped-intro {  
  color: #b4b4b4;  
}

/* Container da Grade de Aplicativos */
#app-grid .grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1.5rem;
    width: 90%; /* Igual ao search-container */
    max-width: 50rem; /* Igual ao search-container */
    margin: 0rem auto; /* Removemos a margem superior */
  }
  
  /* Quadrados da Grade de Aplicativos */
  .app-square {
    background-color: var(--app-square);
    border-radius: 0.75rem; /* Igual ao border-radius do search input */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative; /* If needed for positioning */
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    color: var(--app-square-icon);
    text-align: center;
    font-size:0.7rem;
    padding: 0rem 0.7rem 0rem 0.7rem;
    gap: 0.5rem;
    line-height: 1;
  
    /* Manter forma quadrada */
    aspect-ratio: 1 / 1;
    width: 100%;
    
    /* Evitar que o conteúdo ultrapasse */
    overflow: hidden;
    
    /* Sombra inicial */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }
  
  /* Efeitos de Hover e Focus */
  .app-square:hover,
  .app-square:focus {
    background-color: rgba(0, 113, 227, 0.1);
    transform: scale(1.05); /* Aumenta ligeiramente a escala */
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15); /* Aumenta a sombra */
    outline: none;
  }
  
  body.dark-mode .app-square:hover,
  body.dark-mode .app-square:focus {
    background-color: #272727;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
  }
  
  /* Efeitos de Clique (Active) */
  .app-square:active {
    transform: scale(0.98); /* Reduz ligeiramente a escala */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Reduz a sombra */
  }
  
  /* Badge de Novidade */
  .app-new-badge {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: linear-gradient(135deg, #0071e3, #005bb5);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 3px rgba(0, 113, 227, 0.2);
    z-index: 2;
    opacity: 0.85;
    transition: opacity 0.3s ease;
  }

  .app-square:hover .app-new-badge {
    opacity: 1;
  }

  body.dark-mode .app-new-badge {
    background: linear-gradient(135deg, #01e6cd, #00b8a3);
    color: #1e1e1e;
    box-shadow: 0 1px 3px rgba(1, 230, 205, 0.2);
  }
  
  /* Ícone Dentro dos Quadrados */
  .app-square .app-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  
  .material-symbols-outlined {
    font-size:2.5rem;
    font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24
  }
  
  /* Texto Dentro dos Quadrados */
  .app-square .app-label p {
    margin-top: 0.5rem; /* Reduzido para melhor alinhamento */
    font-size: 1rem;
    font-weight: 500;
    word-wrap: break-word;
  }
  
  /* Estilização do Ícone Personalizado */
  .app-square .app-icon {
    width: 60px; /* Ajuste conforme necessário */
    height: 60px; /* Ajuste conforme necessário */
    object-fit: contain;
  }
  
  /* Ajuste Responsivo para Telas Menores */
  @media (max-width: 600px) {
    .app-square .app-icon {
      width: 50px;
      height: 50px;
    }
  }
  
  /* Initial State: Show the icon and hide titles */
  .app-icon {
    transition: opacity 0.3s ease;
    opacity: 1;
  }
  
  /* 1. Ajustes na Classe .app-icon */
  .app-icon {
    position: relative; /* Necessário para posicionar o ícone de sobreposição */
    width: 60px; /* Já existente, pode ajustar conforme necessário */
    height: 60px; /* Já existente, pode ajustar conforme necessário */
  }
  
  /* 2. Estilos para o Ícone Base */
  .base-icon {
    font-size: 2.5rem; /* Já existente */
    color: var(--app-square-icon); /* Utiliza a variável existente */
  }
  
  /* 3. Estilos para o Ícone de Sobreposição */
  .overlay-icon {
    position: absolute;
    top: 5px; /* Ajuste conforme necessário */
    right: 5px; /* Ajuste conforme necessário */
    color: #FFFFFF; /* Cor branca para contraste */
    background-color: #2c2c2cc9;
    border-radius: 50%;
    padding: 2px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5); /* Sombra para destacar o ícone */
    transition: background-color 0.3s ease, transform 0.3s ease;
  }
  
  #overlay-icon {
    font-size: 1.2rem;
  }
  
  
  /* 5. Ajustes Responsivos para Ícones */
  @media (max-width: 600px) {
    .app-icon {
      width: 50px;
      height: 50px;
    }
  
    .base-icon {
      font-size: 2rem;
    }
  
    .overlay-icon {
      width: 20px;
      height: 20px;
      font-size: 1rem;
      top: 4px;
      right: 4px;
    }
  }
  
  
  .app-title,
  .app-sub-title {
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
  }
  
  .app-title {
    font-family: "LEMONMILK", sans-serif;
    font-weight: 500;
    font-style: italic;
    line-height: 1.2;
  }
  
  #infusion-calculator .app-title {
    font-size:0.7rem;
  }
  
  .app-sub-title {
    font-size: 0.9rem;
    color: #4c4c4c;
    font-family: Helvetica, sans-serif;
  
  }
  
  /* Show titles and hide icon on hover, focus, or active */
  .app-square:hover .app-title,
  .app-square:hover .app-sub-title,
  .app-square:hover .app-icon,
  .app-square:focus .app-title,
  .app-square:focus .app-sub-title,
  .app-square:focus .app-icon,
  .app-square.active .app-title,
  .app-square.active .app-sub-title,
  .app-square.active .app-icon {
    display: block; /* Ensures block display for titles */
    opacity: 1;     /* Makes titles visible */
  }
  
  .app-square:hover .app-icon,
  .app-square:focus .app-icon,
  .app-square.active .app-icon,
  .app-square:hover .material-icons,
  .app-square:focus .material-icons,
  .app-square.active .material-icons {
    display: none;     /* Hides the icon */
  }
  


/* ============================= */
/* ====== Modal Calculadora ==== */
/* ============================= */

/* Estilos da Calculadora */
.calculator-container {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Espaçamento entre os grupos de inputs */
  }
  
  /* Grupos de Inputs */
  .input-group {
    display: flex;
    flex-direction: column;
  }
  
  .input-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
  }
  
  /* Campos de Input */
  .input-field {
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: #1d1d1f;
    font-size: 1rem;
    transition: border-color 0.3s ease, background-color 0.3s ease;
  }
  
  body.dark-mode .input-field {
    border: 1px solid #444;
    background-color: #1e1e1e;
    color: #e2e2e2;
  }
  
  .input-field:focus {
    border-color: #0071e3;
    background-color: #f5f5f7;
    outline: none;
  }
  
  body.dark-mode .input-field:focus {
    border-color: #01e6cd;
    background-color: #2c2c2c;
  }
  
  
  
  /* Botão de Calcular */
  .calculate-button {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: #0071e3;
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 1rem;
    font-weight: bold;
    width: 100%;
  }
  
  body.dark-mode .calculate-button {
    background-color: #01e6cd;
    color: #212121;
  }
  
  .calculate-button:hover {
    background-color: #005bb5;
  }
  
  body.dark-mode .calculate-button:hover {
    background-color: #00ffe1;
  }
  
  .calculate-button:active {
    background-color: #004a99;
    transform: scale(0.98);
  }
  
  body.dark-mode .calculate-button:active {
    background-color: #00b8a3;
    transform: scale(0.98);
  }
  
  /* Resultado */
  #resultado {
    font-size: 1.125rem;
    font-weight: bold;
    color: #0071e3;
    text-align: center;
  }
  
  body.dark-mode #resultado {
    color: #01e6cd;
  }
  
  /* Responsividade para o Modal */
  @media (max-width: 600px) {
    .modal-content {
      padding: 1rem;
    }
  
    .input-field {
      font-size: 0.9rem;
      padding: 0.6rem;
    }
  
    .calculate-button {
      font-size: 0.9rem;
      padding: 0.6rem;
    }
  
    #resultado {
      font-size: 1rem;
    }
  }
  
  
  /* IOT APP */
  /* Estilos para o conteúdo expandido */
  .expanded-content {
    display: none; /* Inicialmente oculto */
    width: 90%;
    max-width: 800px;
    margin: 0rem auto 2rem auto;
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
    position: relative;
    z-index: 1000;
  }
  
  body.dark-mode .expanded-content {
    background-color: #2a2a2a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    color: #e2e2e2;
  }
  
  .expanded-content.active {
    display: block;
  }
  
  /* Estilos específicos para a página EMG PED */
  .emg-ped-page h1,
  .emg-ped-page h2 {
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .emg-ped-page .drug-table {
    width: 100%;
    overflow-x: auto; /* Permite rolagem horizontal se necessário */
  }
  
  .emg-ped-page table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .emg-ped-page th,
  .emg-ped-page td {
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
  }
  
  body.dark-mode .emg-ped-page th,
  body.dark-mode .emg-ped-page td {
    border: 1px solid #444;
  }
  
  .emg-ped-page th {
    background-color: #f5f5f7;
  }
  
  body.dark-mode .emg-ped-page th {
    background-color: #1a1a1a;
  }
  
  .emg-ped-page tr:nth-child(even) {
    background-color: #f9f9f9;
  }
  
  body.dark-mode .emg-ped-page tr:nth-child(even) {
    background-color: #2a2a2a;
  }
  
  .emg-ped-page ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0;
  }
  
  .emg-ped-page ul ul {
    list-style-type: circle;
  }
  
  .highlight {
    color: #0071e3;
    font-weight: bold;
  }
  
  body.dark-mode .highlight {
    color: #00ffe1;
  }
  
  /* Efeitos visuais para o aplicativo expandido */
  .app-square.expanded {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  }
  
  /* Animações */
  .fade-in {
    animation: fadeIn 0.5s forwards;
  }
  
  .fade-out {
    animation: fadeOut 0.5s forwards;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  @keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
  }
  
  
  /* Ajustes Específicos para a Página IOT */
  .iot-page h1,
  .iot-page h2 {
    text-align: center;
    margin-bottom: 1rem;
  }
  
  .iot-page .drug-table {
    width: 100%;
    overflow-x: auto; /* Permite rolagem horizontal se necessário */
  }
  
  .iot-page table {
    width: 100%;
    border-collapse: collapse;
  }
  
  .iot-page th,
  .iot-page td {
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
  }
  
  body.dark-mode .iot-page th,
  body.dark-mode .iot-page td {
    border: 1px solid #444;
  }
  
  .iot-page th {
    background-color: #f5f5f7;
  }
  
  body.dark-mode .iot-page th {
    background-color: #1a1a1a;
  }
  
  .iot-page tr:nth-child(even) {
    background-color: #f9f9f9;
  }
  
  body.dark-mode .iot-page tr:nth-child(even) {
    background-color: #2a2a2a;
  }
  
  .iot-page ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0;
  }
  
  .iot-page ul ul {
    list-style-type: circle;
  }
  
  .iot-page .highlight {
    color: #0071e3;
    font-weight: bold;
  }
  
  body.dark-mode .iot-page .highlight {
    color: #00ffe1;
  }
  
  /* Responsividade Adicional */
  @media (max-width: 600px) {
    .iot-page th,
    .iot-page td {
      padding: 0.5rem;
      font-size: 0.9rem;
    }
  
    .iot-page h1 {
      font-size: 1.5rem;
    }
  
    .iot-page h2 {
      font-size: 1.2rem;
    }
  
    .highlight {
      font-size: 0.95rem;
    }
  }



/* Estilos para a barra superior */
#top-bar {
  background-color: #01e6cd;
  color: #1e1e1e;
  padding: 0.5rem 1rem;
  text-align: center;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1003;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: width 0.25s ease, right 0.25s ease;
}

#top-bar span {
  font-size: 1rem;
}

#top-bar #countdown {
  font-weight: bold;
}

#top-bar button#close-top-bar {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #1e1e1e;
  cursor: pointer;
  position: absolute;
  right: 1rem;
}

@media (max-width: 600px) {

#top-bar button#close-top-bar {
    font-size: 1rem;
    position: absolute;
    right: -0.2rem;
    top: 0.1rem;
    }

}

#top-bar a {
  text-decoration: none;
  color: inherit;
}

body.chat-docked-active #top-bar {
  width: calc(100% - var(--chat-docked-width, 420px));
  right: var(--chat-docked-width, 420px);
}

@media (max-width: 768px) {
  body.chat-docked-active #top-bar {
    width: 100%;
    right: 0;
  }
}

#top-bar a:hover {
  text-decoration: underline;
}

#top-bar::before {
    content: '';
    position: absolute;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    background: linear-gradient(45deg, #5df3d3 10%, #3beaff 30%, #6606cc 60%, #5df3d3 100%);    background-size: 300% 300%;
    z-index: -1;
    /* animation: glowing 15s linear infinite; */
  }
  
  @keyframes glowing {
    0% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
    100% {
      background-position: 0% 50%;
    }
  }

/* Estilos para o Modal de Novidades */
#news-modal .modal-content {
  max-width: 700px;
  padding: 2rem;
  position: relative;
}

#news-modal #mark-news-as-read {
  margin-top: 1.5rem;
  display: block; /* Garante que o botão seja tratado como um bloco */
  margin-left: auto; /* Centraliza horizontalmente */
  margin-right: auto; /* Centraliza horizontalmente */
  text-align: center; /* Garante alinhamento interno, caso necessário */
}

#news-modal strong {
  color:#01e6cd;
}

#news-modal a {
  color: #3beaff; /* Cor do link */
  text-decoration: none;
}

#news-modal .discreet-note {
  color: #7f7f7f; /* Tom mais escuro e discreto */
  font-size: 80%; /* Reduz o tamanho para 20% menor */
  line-height: 1.4; /* Melhora a legibilidade com espaçamento ajustado */
}



  /* Estilos para o rótulo NOVO */
  .new-label {
    position: absolute;
    top: 55px; /* Posição vertical */
    left: 6px; /* Posição horizontal */
    background: linear-gradient(45deg, #5df3d3 10%, #3beaff 30%, #e287fe 60%, #6606cc 95%, #2b2a2a 100%);
    background-size: 300% 300%;
    animation: glowing 10s linear infinite;
    color: #1e1e1e; /* Texto branco */
    padding: 2px 6px;
    border-radius: 5px; /* Formato de pílula */
    font-size: 0.7rem; /* Tamanho da fonte */
    font-weight: bold;
    text-transform: uppercase;
    pointer-events: none; /* Evita que o rótulo capture eventos de mouse */
    z-index: 10; /* Garante que o rótulo fique acima dos ícones */
    
    /* Pequena sombra para destaque */
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    
    /* Transição suave */
    transition: background-color 0.3s ease, transform 0.3s ease;
  }
  
  /* Efeitos de Hover e Focus para o rótulo BETA */
  .app-square:hover .new-label,
  .app-square:focus .new-label {
    background-color: #01e6cd; /* Vermelho mais escuro ao passar o mouse */
    transform: scale(1.05); /* Pequeno aumento para efeito de destaque */
  }

  /* Responsividade para o rótulo BETA */
  @media (max-width: 600px) {
    .new-label {
      font-size: 0.6rem;
      border-radius: 5px; /* Formato de pílula */
      top: 50px;
      left: 5px;
    }
  }
  
  .cyber-doc-news.outside {
    position: absolute;
    bottom: 0;
    left: 0;
    transform: translate(-55%, 10%);
    width: 260px;
    max-width: 28vw;
    height: auto;
    z-index: 10;
    pointer-events: none;
    opacity: 0.9;
  }

  /* Centralizar conteúdo sem deslocamento lateral */
  #news-modal .modal-content.news-centered {
    margin: 0 auto;
  }

  .news-modal-translated { /* legado - remover deslocamento */
    margin-left: 0 !important;
  }

  @media (max-width: 600px) {
    .cyber-doc-news.outside {
      bottom: 0;
      left: 0;
      transform: translate(-20%, 20%);
      width: 120px;
      opacity: 0.85;
    }
    #news-modal .modal-content.news-centered { padding: 1.5rem 1.25rem 2rem; }
  }

/* (removido) selo ATUALIZADO do app Encaminhamentos */
