/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/* Label/tag denoting the user that shared a connection */
.jdbc-share-tag {

    background: #0095ff;
    padding: 0.25em;

    -moz-border-radius:    0.25em;
    -webkit-border-radius: 0.25em;
    -khtml-border-radius:  0.25em;
    border-radius:         0.25em;

    color: white;
    font-size: 0.75em;
    font-weight: bold;

}
/*
 * WB Cloud Computing - Branding customizado para Apache Guacamole
 * Estas regras sao ANEXADAS ao CSS padrao do Guacamole (nao substituem
 * o arquivo original), entao sao seguras: se algum seletor nao
 * existir mais em versoes futuras, ele simplesmente nao tem efeito.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* cores extraidas do proprio logo */
    --wb-brand-color: #0D3B8C;       /* azul escuro do texto "WB CLOUD" */
    --wb-brand-color-dark: #082A66;  /* hover / estados ativos */
    --wb-brand-accent: #14A0DB;      /* azul claro do gradiente da nuvem */
    --wb-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.login-ui,
.login-ui .login-dialog,
.login-ui .login-dialog input,
.login-ui .login-dialog button {
    font-family: var(--wb-font);
}

/* Fundo da tela de login */
.login-ui {
    background: linear-gradient(160deg, #f4f8fc 0%, #eaf1fa 100%);
}

/* Logo (proporcao larga: ~3.5:1) */
.login-ui .login-dialog .logo {
    background-image: url('app/ext/wbcloudit-branding/images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 220px;
    height: 63px;
    margin: 0 auto 12px;
}

/* Texto abaixo da logo (nome do app) - deixa menor e discreto */
.login-ui .login-dialog .version .app-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--wb-brand-color);
    text-align: center;
    line-height: 1.3;
}

.login-ui .login-dialog .version .version-number {
    font-size: 11px;
    text-align: center;
    color: #8a97a8;
}

/* Caixa de login */
.login-ui .login-dialog {
    border-top: 4px solid var(--wb-brand-color);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(13, 59, 140, 0.12);
    padding: 40px 36px;
    background-color: #ffffff;
}

/* Campos de usuario/senha */
.login-ui .login-dialog input[type="text"],
.login-ui .login-dialog input[type="password"] {
    border: 1px solid #d6dee8;
    border-radius: 6px;
    padding: 10px 12px;
    transition: border-color 0.15s ease;
}

.login-ui .login-dialog input[type="text"]:focus,
.login-ui .login-dialog input[type="password"]:focus {
    border-color: var(--wb-brand-accent);
    outline: none;
}

/* Botao de entrar */
.login-ui .login-dialog input[type="submit"],
.login-ui .login-dialog button {
    background-color: var(--wb-brand-color);
    border-color: var(--wb-brand-color);
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background-color 0.15s ease;
}

.login-ui .login-dialog input[type="submit"]:hover,
.login-ui .login-dialog button:hover {
    background-color: var(--wb-brand-color-dark);
}

/* Barra/menu superior apos login */
.page-header,
#page-header,
.guac-menu {
    background-color: var(--wb-brand-color);
    font-family: var(--wb-font);
}

/*
 * Esconde o aviso "Conectando ao Guacamole..." exibido ao abrir uma conexao
 * (RDP/VNC). So esconde esse estado especifico ("connecting"/"waiting");
 * mensagens de ERRO e DESCONEXAO continuam aparecendo normalmente, pois usam
 * outras classes (".error", etc.) - importante manter para diagnostico.
 */
.client-status-modal:has(.notification.connecting) {
    display: none !important;
}

/* Fallback sem :has(), para cobrir navegadores mais antigos */
.client-status-modal .notification.connecting {
    display: none !important;
}

/*
 * Tela inicial (Recent connections / All connections)
 */
.home-view {
    font-family: var(--wb-font);
    background: linear-gradient(160deg, #f4f8fc 0%, #eaf1fa 100%);
}

/* Barra com a logo, no topo da tela de conexoes */
.home-view::before {
    content: "";
    display: block;
    height: 52px;
    background-color: #ffffff;
    border-bottom: 3px solid var(--wb-brand-color);
    background-image: url('app/ext/wbcloudit-branding/images/logo.png');
    background-repeat: no-repeat;
    background-position: 20px center;
    background-size: auto 32px;
}

.home-view .header h2 {
    color: var(--wb-brand-color);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Cartao de conexao recente: troca a miniatura (print real, as vezes preto)
   por um icone neutro, para nunca aparecer um quadrado preto "quebrado" */
.recent-connections .connection .thumbnail {
    border: 1px solid #d6dee8;
    border-radius: 10px;
    overflow: hidden;
    background-color: #eef2f7;
    position: relative;
}

.recent-connections .connection .thumbnail img {
    visibility: hidden;
}

.recent-connections .connection .thumbnail::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 24px;
    border: 2px solid #8a97a8;
    border-radius: 3px;
    box-sizing: border-box;
}

.recent-connections .connection .thumbnail::after {
    content: "";
    position: absolute;
    left: 50%;
    top: calc(42% + 16px);
    transform: translateX(-50%);
    width: 14px;
    height: 3px;
    background-color: #8a97a8;
    border-radius: 2px;
}

.recent-connections .connection .caption .name {
    color: var(--wb-brand-color);
    font-weight: 600;
}

/* Arvore "All connections" */
.all-connections .home-connection,
.all-connections .home-connection-group {
    font-family: var(--wb-font);
    font-size: 13px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.all-connections .home-connection:hover,
.all-connections .home-connection-group:hover {
    background-color: #E6F1FB;
}

/* Icone de pasta para grupos de conexao "normais" (nao balanceadores),
   que por padrao nao mostram nenhum icone */
.all-connections .connection-group > .caption .home-connection-group .name::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 11px;
    margin-right: 6px;
    background-color: var(--wb-brand-accent);
    border-radius: 0 3px 3px 3px;
    vertical-align: middle;
}
