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

}
/* PRISM - หน้าตาของระบบ
 *
 * ส่วนขยายนี้เปลี่ยนเฉพาะการแสดงผล ไม่แตะกลไกการยืนยันตัวตนของ Guacamole
 * หน้าล็อกอินยังเป็นตัวจริงที่ตรวจรหัสกับฐานข้อมูลทุกครั้ง
 *
 * สีและตัวอักษรอ้างอิงจากแบบที่ออกแบบไว้ในไฟล์ prism-portal.html
 * ไม่ได้เรียกฟอนต์จากภายนอก เพื่อไม่ให้ระบบต้องพึ่งบริการของบุคคลที่สาม
 * และเพื่อให้ยังแสดงผลได้แม้เครื่องผู้ใช้จะออกอินเทอร์เน็ตไม่ได้
 */

.login-ui,
.home-view {
    --prism-page:     #0C0E11;
    --prism-page-2:   #15181D;
    --prism-card:     #FFFFFF;
    --prism-ink:      #111318;
    --prism-ink-2:    #3D4350;
    --prism-muted:    #767C88;
    --prism-line:     #E4E6EA;
    --prism-field:    #FAFBFC;
    --prism-btn:      #111318;
    --prism-btn-ink:  #FFFFFF;
    --prism-radius:   18px;
    --prism-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
                  "Noto Sans Thai", "Sarabun", Helvetica, Arial, sans-serif;
    --prism-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ── หน้าล็อกอิน ────────────────────────────────────────────────────────── */

div.login-ui {
    background: radial-gradient(120% 120% at 50% 0%,
                var(--prism-page-2) 0%, var(--prism-page) 65%);
    font-family: var(--prism-sans);
}

/* โลโก้ของ Guacamole ถูกซ่อน แล้วใส่ชื่อระบบของเราแทนผ่าน HTML patch */
.login-ui .login-form .logo {
    display: none;
}

.login-ui .login-dialog {
    background: var(--prism-card);
    color: var(--prism-ink);
    border: none;
    border-radius: var(--prism-radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    padding: 2.25em 2em 1.75em;
    max-width: 24em;
}

.login-ui .prism-brand {
    text-align: center;
    margin-bottom: 1.5em;
}

.login-ui .prism-word {
    font-size: 2em;
    font-weight: 700;
    letter-spacing: 0.22em;
    /* ชดเชยระยะห่างตัวอักษรตัวสุดท้าย ไม่งั้นข้อความจะดูเยื้องไปทางซ้าย */
    text-indent: 0.22em;
    color: var(--prism-ink);
    line-height: 1.2;
}

.login-ui .prism-sub {
    margin-top: 0.7em;
    font-size: 0.82em;
    line-height: 1.6;
    color: var(--prism-ink-2);
}

.login-ui .prism-org {
    margin-top: 0.35em;
    font-size: 0.75em;
    line-height: 1.6;
    color: var(--prism-muted);
}

.login-ui .login-fields .labeled-field input {
    background: var(--prism-field);
    border: 1px solid var(--prism-line);
    border-radius: 10px;
    padding: 0.85em 0.9em;
    font-size: 0.95em;
    color: var(--prism-ink);
}

.login-ui .login-fields .labeled-field input:focus {
    border-color: var(--prism-ink);
    outline: none;
}

.login-ui .buttons input[type="submit"] {
    background: var(--prism-btn);
    color: var(--prism-btn-ink);
    border: none;
    border-radius: 10px;
    padding: 0.85em 1em;
    width: 100%;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
}

.login-ui .buttons input[type="submit"]:hover {
    opacity: 0.88;
}

.login-ui .prism-foot {
    margin-top: 1.4em;
    padding-top: 1.1em;
    border-top: 1px solid var(--prism-line);
    text-align: center;
}

.login-ui .prism-foot-line {
    font-size: 0.72em;
    line-height: 1.7;
    color: var(--prism-muted);
}

.login-ui .prism-foot-ref {
    font-family: var(--prism-mono);
    letter-spacing: 0.04em;
    margin-top: 0.2em;
}

/* ── หน้าแรกหลังล็อกอิน ─────────────────────────────────────────────────── */

/* แถบนี้ถูกแทรกไว้ในหน้าที่ผ่านการยืนยันตัวตนแล้วเท่านั้น
 * เปิด URL ตรง ๆ โดยไม่ล็อกอินจะไม่เห็นเนื้อหาส่วนนี้ */
.home-view .prism-home {
    font-family: var(--prism-sans);
    background: var(--prism-page);
    color: #F4F6F8;
    padding: 2em 1.5em 1.75em;
}

.home-view .prism-home-word {
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-indent: 0.2em;
}

.home-view .prism-home-sub {
    margin-top: 0.4em;
    font-size: 0.85em;
    color: #A8B0BC;
    line-height: 1.6;
}

.home-view .prism-home-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
    margin-top: 1.5em;
}

.home-view .prism-card {
    flex: 1 1 14em;
    background: #15181D;
    border: 1px solid #242830;
    border-radius: 12px;
    padding: 0.9em 1em;
}

.home-view .prism-card-label {
    font-size: 0.7em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #878E9A;
}

.home-view .prism-card-value {
    margin-top: 0.35em;
    font-size: 0.85em;
    line-height: 1.55;
    color: #F2F3F5;
}

.home-view .prism-mono {
    font-family: var(--prism-mono);
    letter-spacing: 0.03em;
}

.home-view .prism-home-note {
    margin-top: 1.4em;
    font-size: 0.8em;
    line-height: 1.7;
    color: #A8B0BC;
    max-width: 52em;
}

/* จอเล็กให้การ์ดเรียงลงมาทีละใบ ไม่บีบจนอ่านไม่ออก */
@media (max-width: 40em) {
    .home-view .prism-card { flex: 1 1 100%; }
    .home-view .prism-home { padding: 1.5em 1.1em; }
}
