/* Tux AI assistant overlay — fixed widget shown across all pages. */

#tux-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #567386;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tux-launcher:hover {
    background: #436373;
}

#tux-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 500px;
    max-width: calc(100vw - 40px);
    height: 720px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: Arial, Helvetica, sans-serif;
}

#tux-panel.tux-open {
    display: flex;
}

#tux-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #567386;
    color: #fff;
    padding: 10px 12px;
}

#tux-header .tux-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    object-fit: cover;
}

#tux-header .tux-title {
    display: flex;
    flex-direction: column;
    flex: 1;
    line-height: 1.2;
}

#tux-header .tux-name {
    font-weight: bold;
    font-size: 15px;
}

#tux-header .tux-sub {
    font-size: 11px;
    opacity: 0.85;
}

.tux-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
    background: #bbb;            /* checking / unknown */
}

.tux-status.tux-online {
    background: #36a64f;         /* green */
}

.tux-status.tux-offline {
    background: #cc0000;         /* red */
}

.tux-status.tux-checking {
    background: #e0b000;         /* amber while checking */
}

#tux-close,
#tux-restart {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}

#tux-restart {
    font-size: 18px;
}

#tux-close:hover,
#tux-restart:hover {
    opacity: 0.8;
}

#tux-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f5f6f7;
}

.tux-msg {
    margin-bottom: 10px;
    max-width: 85%;
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: normal;
}

.tux-msg a {
    color: #436373;
    text-decoration: underline;
}

.tux-msg .tux-h {
    font-weight: bold;
    font-size: 14px;
    margin: 6px 0 2px;
}

.tux-msg .tux-list {
    margin: 4px 0;
    padding-left: 20px;
}

.tux-msg .tux-list li {
    margin: 2px 0;
}

.tux-msg code {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    padding: 1px 4px;
    font-family: Consolas, monaco, monospace;
    font-size: 12px;
}

.tux-msg .tux-table {
    border-collapse: collapse;
    width: 100%;
    margin: 6px 0;
    font-size: 12px;
}

.tux-msg .tux-table th,
.tux-msg .tux-table td {
    border: 1px solid #d8dde0;
    padding: 4px 6px;
    text-align: left;
    vertical-align: top;
}

.tux-msg .tux-table th {
    background: #eef1f3;
    font-weight: bold;
}

.tux-msg .tux-table tr:nth-child(even) td {
    background: #f7f9fa;
}

.tux-user {
    background: #567386;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 3px;
}

.tux-bot {
    background: #fff;
    color: #222;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 3px;
}

.tux-bot.tux-pending {
    opacity: 0.6;
    font-style: italic;
}

#tux-disclaimer {
    font-size: 10px;
    color: #888;
    text-align: center;
    padding: 4px 8px;
    background: #f5f6f7;
}

#tux-form {
    display: flex;
    border-top: 1px solid #e0e0e0;
}

#tux-input {
    flex: 1;
    border: none;
    padding: 11px;
    font-size: 14px;
    outline: none;
}

#tux-send {
    border: none;
    background: #567386;
    color: #fff;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
    width: 100px;
}

#tux-send:hover {
    background: #436373;
}

#tux-send:disabled {
    background: #9bb0bb;
    cursor: default;
}

/* --- Full control -------------------------------------------------------
   Applied by js/chat.js when #tux-panel carries data-ai-mode="full", so the
   assistant that can change this system never looks like the one that cannot.
   The public website widget has no such attribute and stays blue. */

#tux-panel.tux-fullcontrol #tux-header {
    background: #8b2b2b;
}

#tux-launcher.tux-fullcontrol {
    background: #8b2b2b;
}

#tux-launcher.tux-fullcontrol:hover {
    background: #6f2222;
}

#tux-notice {
    background: #fdeaea;
    border-bottom: 1px solid #e8c4c4;
    color: #7a2020;
    font-size: 12px;
    line-height: 1.35;
    padding: 7px 12px;
}

#tux-notice[hidden] {
    display: none;
}

/* --- Confirmation card --------------------------------------------------
   Shown when Tux asks to change something. The server has not run anything at
   this point; it is waiting for Confirm or Cancel. */

.tux-msg.tux-confirm {
    max-width: 100%;
    background: #fff;
    border: 1px solid #d9a5a5;
    border-left: 4px solid #8b2b2b;
    border-radius: 8px;
    padding: 10px 12px;
}

.tux-confirm-head {
    font-weight: bold;
    color: #7a2020;
    margin-bottom: 8px;
}

.tux-confirm-item {
    margin-bottom: 8px;
}

.tux-confirm-title {
    font-weight: bold;
}

.tux-confirm-call {
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    color: #555;
    word-break: break-all;
}

.tux-confirm-body {
    margin: 6px 0 0;
    padding: 6px 8px;
    background: #f5f6f7;
    border-radius: 6px;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    max-height: 180px;
    overflow: auto;
    white-space: pre;
}

.tux-confirm-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.tux-confirm-yes,
.tux-confirm-no {
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
}

.tux-confirm-yes {
    background: #8b2b2b;
    color: #fff;
}

.tux-confirm-yes:hover {
    background: #6f2222;
}

.tux-confirm-no {
    background: #e6e9eb;
    color: #333;
}

.tux-confirm-no:hover {
    background: #d6dade;
}

.tux-confirm-done {
    margin-top: 10px;
    font-size: 12px;
    font-style: italic;
    color: #666;
}

/* An answered card, kept in the transcript so the record of what was approved
   survives a page navigation. Muted: it is history, not a pending decision. */

.tux-msg.tux-confirm.tux-confirm-resolved {
    border-color: #d9dcde;
    border-left-color: #9bb0bb;
}

.tux-confirm-resolved .tux-confirm-head {
    color: #555;
    font-weight: normal;
}

/* What the ids in an action point at, resolved server-side. This is the line a
   human can actually check before approving — the path alone is just a number. */

.tux-confirm-subject {
    font-size: 13px;
    color: #333;
    margin-top: 1px;
}

.tux-confirm-title.tux-confirm-destructive {
    color: #8b2b2b;
}
