/*
 * 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;

}

/* ==================================================
   J.W.H PRODUCTIONS
   APACHE GUACAMOLE 1.6.0
   MODERN DARK THEME
   ================================================== */

:root {
    color-scheme: dark;

    --jwh-bg: #0b1120;
    --jwh-surface: #111827;
    --jwh-panel: #182235;
    --jwh-hover: #233149;
    --jwh-border: #29364b;

    --jwh-blue: #3b82f6;
    --jwh-blue-hover: #2563eb;

    --jwh-text: #ffffff;
    --jwh-muted: #cbd5e1;
}

/* ==================================================
   MAIN APPLICATION
   ================================================== */

html,
body,
#app {
    background: var(--jwh-bg) !important;
    color: var(--jwh-text) !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
}

body {
    overflow-x: hidden;
}

/* ==================================================
   PAGE BACKGROUNDS
   ================================================== */

.page,
.page-content,
.settings,
.settings-section-content,
.settings-section-body {
    background-color: var(--jwh-bg) !important;
    color: var(--jwh-text) !important;
}

/* ==================================================
   NAVIGATION
   ================================================== */

.menu {
    background: #080e1b !important;
    border-bottom: 1px solid var(--jwh-border) !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.18);
}

.menu-contents,
.menu-body {
    background: transparent !important;
}

.menu-item {
    color: var(--jwh-text) !important;
    transition: background-color .15s ease,
                border-color .15s ease;
}

.menu-item:hover {
    background: var(--jwh-hover) !important;
    color: #ffffff !important;
}

.menu-item.selected,
.menu-item.current {
    background: var(--jwh-panel) !important;
    color: #ffffff !important;
    border-bottom: 2px solid var(--jwh-blue) !important;
}

/* ==================================================
   USER MENU
   ================================================== */

.menu-dropdown,
.menu-dropdown-contents {
    background: var(--jwh-surface) !important;
    color: #ffffff !important;
    border: 1px solid var(--jwh-border) !important;
    border-radius: 9px !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

/* ==================================================
   HEADINGS AND TEXT
   ================================================== */

h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
legend,
span,
li,
td,
th,
small {
    color: #ffffff !important;
}

.description,
.secondary,
.hint,
.settings-section-description {
    color: var(--jwh-muted) !important;
}

/* ==================================================
   SETTINGS PANELS
   ================================================== */

.settings-section {
    background: var(--jwh-surface) !important;
    border: 1px solid var(--jwh-border) !important;
    border-radius: 10px !important;
    margin: 14px 0 !important;
}

.settings-section-title,
.settings-section-header {
    background: var(--jwh-panel) !important;
    color: #ffffff !important;
    border-bottom: 1px solid var(--jwh-border) !important;
}

/* ==================================================
   TABLES AND CONNECTION LISTS
   ================================================== */

table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    background: var(--jwh-surface) !important;
    border: 1px solid var(--jwh-border) !important;
    border-radius: 9px !important;
}

th {
    background: var(--jwh-panel) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 13px !important;
}

td {
    background: var(--jwh-surface) !important;
    color: #ffffff !important;
    padding: 13px !important;
    border-top: 1px solid var(--jwh-border) !important;
}

tr:hover td {
    background: var(--jwh-hover) !important;
}

.connection-list,
.connection-group,
.connection {
    background: var(--jwh-surface) !important;
    color: #ffffff !important;
    border-color: var(--jwh-border) !important;
}

.connection:hover {
    background: var(--jwh-hover) !important;
}

/* ==================================================
   BUTTONS
   ================================================== */

button,
.button,
input[type="submit"] {
    border-radius: 8px !important;
    transition: background-color .15s ease,
                border-color .15s ease;
}

button.primary,
.button.primary,
input[type="submit"] {
    background: var(--jwh-blue) !important;
    color: #ffffff !important;
    border: 1px solid var(--jwh-blue) !important;
}

button.primary:hover,
.button.primary:hover {
    background: var(--jwh-blue-hover) !important;
    border-color: var(--jwh-blue-hover) !important;
}

/* ==================================================
   INPUTS AND SEARCH
   ================================================== */

input,
select,
textarea {
    background: #0b1220 !important;
    color: #ffffff !important;
    border: 1px solid var(--jwh-border) !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    max-width: 100%;
}

input,
select {
    padding: 9px !important;
}

textarea {
    resize: none !important;
}

input::placeholder,
textarea::placeholder {
    color: #cbd5e1 !important;
    opacity: .75;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--jwh-blue) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15) !important;
    outline: none !important;
}

select option {
    background: var(--jwh-surface) !important;
    color: #ffffff !important;
}

/* ==================================================
   DIALOGS AND POPUPS
   ================================================== */

.dialog,
.dialog-body {
    background: var(--jwh-surface) !important;
    color: #ffffff !important;
    border: 1px solid var(--jwh-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 15px 45px rgba(0,0,0,.4);
}

/* ==================================================
   LOGIN SCREEN
   ================================================== */

.login-ui {
    background:
        radial-gradient(
            ellipse at top,
            #1e3a5f 0%,
            #111827 50%,
            #080d18 100%
        ) !important;
}

.login-dialog,
.login-fields {
    background: var(--jwh-surface) !important;
    color: #ffffff !important;
    border: 1px solid var(--jwh-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

/* ==================================================
   LINKS
   ================================================== */

a,
a:visited,
a:hover {
    color: #ffffff !important;
}

/* ==================================================
   REMOTE DESKTOP
   ================================================== */

.client,
.display {
    background: #000000 !important;
}

/* ==================================================
   SCROLLBARS
   ================================================== */

* {
    scrollbar-color: #34445d var(--jwh-bg);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--jwh-bg);
}

::-webkit-scrollbar-thumb {
    background: #34445d;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--jwh-blue);
}



/* ==========================================
   JWH - SAFE USER DROPDOWN STYLING
   ========================================== */

.menu-dropdown,
.menu-dropdown-contents {
    background: #111827 !important;
    color: #ffffff !important;
    border: 1px solid #29364b !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.4) !important;
}

.menu-dropdown .menu-item,
.menu-dropdown-contents .menu-item {
    color: #ffffff !important;
}

.menu-dropdown .menu-item:hover,
.menu-dropdown-contents .menu-item:hover {
    background-color: #233149 !important;
}






/* ==========================================
   JWH - SOLID OPAQUE USER DROPDOWN
   ========================================== */

.menu-dropdown,
.menu-dropdown-contents {
    background: #111827 !important;
    background-color: #111827 !important;
    background-image: none !important;

    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    border: 1px solid #29364b !important;
    border-radius: 10px !important;

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65) !important;
}

/* Remove transparent pseudo backgrounds */

.menu-dropdown::before,
.menu-dropdown::after,
.menu-dropdown-contents::before,
.menu-dropdown-contents::after {
    background: #111827 !important;
}

/* Dropdown text */

.menu-dropdown .menu-item,
.menu-dropdown-contents .menu-item {
    color: #ffffff !important;
}

/* Hover effect */

.menu-dropdown .menu-item:hover,
.menu-dropdown-contents .menu-item:hover {
    background: #233149 !important;
}





/* J.W.H Productions - Fix transparent user dropdown */
.user-menu .menu-dropdown.open .menu-contents {
    background: #111827 !important;
    background-color: #111827 !important;
    background-image: none !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: #ffffff !important;
}

/* Keep dropdown text and icons visible */
.user-menu .menu-dropdown.open .menu-contents,
.user-menu .menu-dropdown.open .menu-contents * {
    color: #ffffff !important;
}

/* Give the dropdown a solid dark appearance */
.user-menu .menu-dropdown.open .menu-contents {
    border: 1px solid #29364b !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}









/* J.W.H Productions - Fix login input text alignment */
.login-ui input,
.login-dialog input,
input[type="text"],
input[type="password"] {
    box-sizing: border-box !important;
    height: 42px !important;
    line-height: normal !important;
    padding: 10px 12px !important;
    text-align: left !important;
    vertical-align: middle !important;
}

/* Placeholder styling */
.login-ui input::placeholder,
.login-dialog input::placeholder,
input::placeholder {
    opacity: 0.65 !important;
    color: #cbd5e1 !important;
}

/* Prevent labels from overlapping input text */
.login-ui input,
.login-dialog input {
    position: relative;
}








/* J.W.H Productions - Fix Guacamole login label overlap */

.login-ui .login-dialog .labeled-field .field-header {
    position: static !important;
    display: block !important;
    height: auto !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    transform: none !important;
}

.login-ui .login-dialog .labeled-field .field-header label {
    position: static !important;
    display: inline-block !important;
    transform: none !important;
    color: #ffffff !important;
    font-size: 13px !important;
    line-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.login-ui .login-dialog .labeled-field .form-field {
    position: relative !important;
}

.login-ui .login-dialog .labeled-field input {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 42px !important;
    box-sizing: border-box !important;
    padding: 10px 12px !important;
    line-height: normal !important;
}




/* J.W.H Productions - Dark connection group styling */

/* Group list item */
.connection-group-list li {
    background: #111827 !important;
    border: 1px solid #29364b !important;
    border-radius: 8px !important;
    margin: 6px 0 !important;
    overflow: hidden !important;
}

/* Group label */
.connection-group-list li label {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: #111827 !important;
    color: #ffffff !important;
    padding: 10px 12px !important;
    cursor: pointer !important;
}

/* Group name */
.connection-group-list li .identifier {
    color: #ffffff !important;
    background: transparent !important;
    font-size: 14px !important;
}

/* Remove icon */
.connection-group-list li img.remove {
    width: 14px !important;
    height: 14px !important;
    opacity: 0.85 !important;
}

/* Hover */
.connection-group-list li label:hover {
    background: #1e293b !important;
}









/* =========================================
   J.W.H PRODUCTIONS - GUACAMOLE BRANDING
   ========================================= */

.login-ui {
    background: #080f1d !important;
}


/* Login panel */
.login-ui .login-dialog {
    background: #111827 !important;
    border: 1px solid #29364b !important;
    border-radius: 14px !important;
    padding: 30px !important;
}


/* J.W.H Productions - Login branding */

/* Replace the original Guacamole logo */
.login-ui .login-dialog .logo {
    display: block !important;
    width: 220px !important;
    height: 220px !important;
    margin: 0 auto 15px !important;
    background-image: url("/app/ext/modern-dark/resources/images/jwh-logo.png") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
}

/* Replace Apache Guacamole text */
.login-ui .login-dialog .version {
    font-size: 0 !important;
    color: transparent !important;
}

.login-ui .login-dialog .version::after {
    content: "Remote Desktop";
    display: block !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-align: center !important;
}




/* J.W.H Productions - Remove white group label box */

li:has(> label img.remove) {
    background: #0b1120 !important;
    border: none !important;
}

li:has(> label img.remove) > label {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: #111827 !important;
    background-color: #111827 !important;
    color: #ffffff !important;
    border: 1px solid #29364b !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    box-shadow: none !important;
}

li:has(> label img.remove) .identifier {
    color: #ffffff !important;
    background: transparent !important;
}

li:has(> label img.remove) img.remove {
    background: transparent !important;
}
