/* coincidental - dark theme for Apache Guacamole 1.6
   Palette taken from the MeshCentral night-mode look:
   black page, #333 panels, black cards inside, 10px corners, #9CF accent. */

:root {
  --cz-bg:      #000;
  --cz-panel:   #333;
  --cz-card:    #000;
  --cz-line:    #555;
  --cz-text:    #ccc;
  --cz-bright:  #eee;
  --cz-muted:   #888;
  --cz-accent:  #9cf;
  --cz-danger:  #f88;
  --cz-radius:  10px;
  --cz-font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
html, body, .view, .client-view, .client-main {
  background: var(--cz-bg) !important;
  color: var(--cz-text);
  font-family: var(--cz-font);
}
a, a:visited { color: var(--cz-accent); }
h1, h2, h3 { color: var(--cz-bright); font-weight: 400; }

/* Guacamole's icons are dark grey on light; flip them for a dark page */
.icon { filter: invert(1) brightness(0.85); }

/* ---------- Form controls ---------- */
input[type="text"], input[type="password"], input[type="number"],
input[type="email"], input[type="search"], select, textarea {
  background: var(--cz-card) !important;
  color: var(--cz-bright) !important;
  border: 1px solid var(--cz-line) !important;
  border-radius: 6px;
  font-family: var(--cz-font);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cz-accent) !important;
  outline: none;
}

input[type="submit"], button, a.button, .button {
  background: var(--cz-card) !important;
  background-image: none !important;
  color: var(--cz-accent) !important;
  border: 1px solid var(--cz-accent) !important;
  border-radius: 8px;
  box-shadow: none !important;
  text-shadow: none !important;
  font-family: var(--cz-font);
}
input[type="submit"]:hover, button:hover, a.button:hover, .button:hover {
  background: var(--cz-accent) !important;
  color: #000 !important;
}
button.danger, a.button.danger {
  color: var(--cz-danger) !important;
  border-color: var(--cz-danger) !important;
}
button.danger:hover, a.button.danger:hover {
  background: var(--cz-danger) !important;
  color: #000 !important;
}
:focus-visible { outline: 2px solid var(--cz-accent); outline-offset: 2px; }

/* ---------- Login page ---------- */
.login-ui { background: var(--cz-bg) !important; }

.login-ui .login-dialog {
  background: var(--cz-panel);
  border: none;
  border-radius: var(--cz-radius);
  box-shadow: none;
  color: var(--cz-text);
  padding: 2em 1.75em 1.5em;
  max-width: 22em;
}
.login-ui .login-dialog .logo {
  background-image: url("app/ext/coincidental-branding/images/logo.svg");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 5.5em;
  margin: 0 auto 1.25em;
}
/* The logo already carries the name; hide the text name and version number */
.login-ui .login-dialog .version { display: none; }

.login-ui .login-fields .labeled-field input {
  background: var(--cz-card) !important;
  padding: 0.7em 0.8em;
  margin-bottom: 0.6em;
}
.login-ui .login-fields .labeled-field .field-header { color: var(--cz-muted); }
.login-ui .login-dialog .buttons input[type="submit"] { width: 100%; padding: 0.7em; }
.login-ui p.login-error { color: var(--cz-danger); }

/* ---------- Header and user menu ---------- */
.header {
  background: transparent;
  border-bottom: 1px solid var(--cz-panel);
}
.header h2 { color: var(--cz-bright); }

.menu-dropdown .menu-title { color: var(--cz-text); }
.menu-dropdown .menu-contents {
  background: #222;
  border: 1px solid var(--cz-panel);
  border-radius: var(--cz-radius);
  box-shadow: none;
}
.menu-dropdown .menu-contents li a { color: var(--cz-text); }
.menu-dropdown .menu-contents li a:hover { background: var(--cz-panel); }

/* ---------- Home: recent connections ---------- */
.recent-connections .connection {
  background: var(--cz-panel);
  border: 1px solid transparent;
  border-radius: var(--cz-radius);
  color: var(--cz-text);
}
.recent-connections .connection:hover { border-color: var(--cz-accent); }
.recent-connections .connection .thumbnail { background: var(--cz-card); border-radius: 6px; }

/* ---------- Home: all connections (the machine list) ---------- */
.all-connections,
.connection-group-list {
  background: var(--cz-panel);
  border-radius: var(--cz-radius);
  padding: 0.75em;
}
.connection-group-list .connection-group-list { padding: 0 0 0 1em; } /* nested groups */

.list-item .caption {
  background: var(--cz-card);
  border: 1px solid transparent;
  border-radius: 8px;
  margin: 0.3em 0;
  padding: 0.55em 0.8em;
  color: var(--cz-text);
}
.list-item .caption:hover,
.list-item.selected .caption {
  background: var(--cz-card);
  border-color: var(--cz-accent);
}
.list-item .caption .name { color: var(--cz-bright); }

.filter input { width: 100%; }

/* ---------- Dialogs (incl. the Windows credential prompt) ---------- */
.notification {
  background: #222;
  border: 1px solid var(--cz-panel);
  border-radius: var(--cz-radius);
  color: var(--cz-text);
  box-shadow: none;
  overflow: hidden;
}
.notification .title-bar {
  background: var(--cz-panel);
  color: var(--cz-bright);
  border: none;
}
.notification .body, .notification .parameters { color: var(--cz-text); }
.notification.error .title-bar { color: var(--cz-danger); }

/* ---------- In-session side menu (Ctrl+Alt+Shift) ---------- */
#guac-menu, .menu {
  background: #111 !important;
  color: var(--cz-text);
  border-right: 1px solid var(--cz-panel);
}
.menu .header { background: #111; }
.menu-section h3 { color: var(--cz-accent); }
.menu-section, .menu-content { color: var(--cz-text); }

/* ---------- Settings (admin pages) ---------- */
.settings-tabs, .page-tabs { background: transparent; }
/* Settings tabs (Sessions, History, Users, Connections, Preferences...).
   Guacamole's own rule is more specific, so these need the extra weight. */
.page-tabs .page-list li a,
.page-tabs .page-list li a[href],
.page-tabs .page-list li a:visited,
.page-list li a {
  color: var(--cz-text) !important;
  background: var(--cz-panel) !important;
  border: 1px solid transparent !important;
  border-radius: 8px;
  padding: 0.5em 0.9em;
  margin: 0.2em;
  text-decoration: none;
}
.page-tabs .page-list li a[href]:hover,
.page-list li a:hover {
  color: var(--cz-bright) !important;
  border-color: var(--cz-accent) !important;
}
.page-tabs .page-list li a.current,
.page-list li a.current {
  color: #000 !important;
  background: var(--cz-accent) !important;
}

/* User menu dropdown items (Home, Settings, Logout) - same fix */
.user-menu .menu-dropdown .menu-contents li a,
.menu-dropdown .menu-contents li a[href] {
  color: var(--cz-text) !important;
  background: transparent !important;
}
.user-menu .menu-dropdown .menu-contents li a:hover,
.menu-dropdown .menu-contents li a[href]:hover {
  color: var(--cz-bright) !important;
  background: var(--cz-panel) !important;
}
table thead th, table thead tr {
  background: var(--cz-panel) !important;
  color: var(--cz-bright);
}
table tbody tr { background: var(--cz-card); }
table tbody tr:nth-child(even) { background: #111; }
.section, .settings .section { background: transparent; color: var(--cz-text); }

/* ---------- Touch: bigger targets on tablets ---------- */
@media (pointer: coarse) {
  .list-item .caption { padding: 0.9em 1em; }
  input[type="submit"], button, a.button { min-height: 44px; }
}

/* Settings tables: the username (and other linked) cells are links that keep
   Guacamole's dark link colour - force them light like the other cells. */
.settings table td a,
.settings table td a[href],
.settings table td a:visited,
.settings table td .name,
table.sorted td a,
table.sorted td a[href] {
  color: var(--cz-bright) !important;
  text-decoration: none;
}
.settings table td a:hover,
table.sorted td a[href]:hover { color: var(--cz-accent) !important; }

/* Row hover so it's clear which row you're about to open */
.settings table tbody tr:hover,
table.sorted tbody tr:hover { background: var(--cz-panel) !important; }

/* Disabled/expired accounts (shown in italics) stay dimmed but readable */
.settings table tr.disabled td,
.settings table tr.disabled td a { color: var(--cz-muted) !important; }
/*
 * 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;

}
.totp-enroll p,.totp-details{font-size:.8em}.totp-qr-code{text-align:center}.totp-qr-code img{margin:1em;border:1px solid rgba(0,0,0,0.25);box-shadow:1px 1px 2px rgba(0,0,0,0.25);cursor:pointer}h3.totp-details-header{font-size:.8em}h3.totp-details-header::before{content:'▸ '}.totp-details-visible h3.totp-details-header::before{content:'▾ '}.totp-details,.totp-hide-details{display:none}.totp-details-visible .totp-details{display:table}.totp-details-visible .totp-hide-details{display:inline}.totp-details-visible .totp-show-details{display:none}.totp-hide-details,.totp-show-details{color:blue;text-decoration:underline;cursor:pointer;margin:0 .25em;font-weight:normal}.totp-details{margin:0 auto}.totp-details th{padding-right:.25em;text-align:left}.totp-details td{font-family:monospace}.totp-detail{display:inline-block;margin:0 .25em}