/* 
   Signal AI Chatbot Custom CSS (Floating Side-Panel Overlay)
   Inherits colors, fonts, and borders from the portal's design system
*/

/* Blurred/Dimmed Backdrop Overlay */
.signal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 99998;
    display: none;
    transition: opacity 0.3s ease;
}

.signal-backdrop.active {
    display: block;
}

/* Floating Slide-out Panel on the Right */
.signal-panel {
    position: fixed;
    top: 0;
    right: -420px; /* Off-screen by default */
    width: 400px;
    height: 100vh;
    background: #FFFFFF;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: "Poppins", sans-serif;
    box-sizing: border-box;
}

/* Slide-in State */
.signal-panel.active {
    right: 0;
}

/* Chat Header */
.signal-header {
    background: #F9F5F1; /* Portal Primary brand color */
    color: ##020202;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.signal-header-icon {
    font-size: 20px;
    color: #000000;
}

.signal-header-title h2 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    color: #000000;
}

.signal-header-title p {
    font-size: 11px;
    opacity: 0.8;
    margin: 0;
    color: #000000;
}

/* New Chat Button in Header */
.signal-new-chat-btn {
    color: #FFFFFF;
    cursor: pointer;
    font-size: 20px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.signal-new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Chat Body (Scrollable Messages Area) */
.signal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #FDFBFA; /* Warm theme background */
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Bubbles */
.signal-msg-row {
    display: flex;
    width: 100%;
}

.signal-msg-row.user {
    justify-content: flex-end;
}

.signal-msg-row.bot {
    justify-content: flex-start;
}

.signal-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.45;
    position: relative;
    word-wrap: break-word;
}

.signal-msg-row.user .signal-bubble {
    background: #08519B; /* Brand Blue */
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
    box-shadow: 0px 3px 10px rgba(8, 81, 155, 0.15);
}

.signal-msg-row.bot .signal-bubble {
    background: #FFFFFF;
    color: #111010;
    border-bottom-left-radius: 4px;
    border: 1px solid #EAEAEA;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.02);
}

.signal-bubble p {
    margin-bottom: 6px;
}

.signal-bubble p:last-child {
    margin-bottom: 0;
}

.signal-bubble ul, .signal-bubble ol {
    margin-left: 18px;
    margin-bottom: 6px;
}

.signal-bubble ul li {
    list-style-type: disc;
    margin-bottom: 3px;
}

/* Suggested / Welcome Box */
.signal-welcome-box {
    text-align: center;
    margin: auto;
    max-width: 100%;
}

.signal-welcome-box h3 {
    font-size: 18px;
    color: #08519B;
    margin-bottom: 8px;
}

.signal-welcome-box p {
    font-size: 13px;
    color: #666666;
    margin-bottom: 20px;
    line-height: 1.4;
}

.signal-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.signal-suggest-btn {
    background: #FFFFFF;
    border: 1px solid #E4E4E4;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: #333333;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-weight: 500;
    font-family: "Poppins", sans-serif;
    line-height: 1.3;
}

.signal-suggest-btn:hover {
    background: #F4F7FB;
    border-color: #08519B;
    color: #08519B;
    transform: translateY(-1px);
}

/* Chat Input Bar */
.signal-footer {
    padding: 15px 20px;
    background: #FFFFFF;
    border-top: 1px solid #EAEAEA;
}

.signal-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.signal-input {
    flex: 1;
    border: 1px solid #D9D9D9;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
    background: #FFFFFF;
    font-family: "Poppins", sans-serif;
}

.signal-input:focus {
    border-color: #08519B;
}

.signal-send-btn {
    background: #08519B;
    color: #FFFFFF;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.signal-send-btn:hover {
    background: #06407B;
    transform: scale(1.05);
}

/* Loading State (Typing Indicator) */
.signal-typing {
    display: flex;
    gap: 5px;
    padding: 6px 10px;
    align-items: center;
}

.signal-dot {
    width: 7px;
    height: 7px;
    background: #909090;
    border-radius: 50%;
    animation: signalBounce 1.4s infinite ease-in-out both;
}

.signal-dot:nth-child(1) { animation-delay: -0.32s; }
.signal-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes signalBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Data Table Formatting inside Bot Response */
.signal-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 12px;
    background: #FFFFFF;
    border: 1px solid #EAEAEA;
    border-radius: 6px;
    overflow: hidden;
}

.signal-data-table th, .signal-data-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #EAEAEA;
}

.clickable-audit-row:hover {
    background-color: #F4F7FB !important;
    color: #08519B;
    cursor: pointer;
}

.clickable-audit-row:hover td {
    color: #08519B;
    font-weight: 500;
}

.signal-data-table th {
    background: #F8F9FA;
    color: #000;
    font-weight: 600;
}

.signal-data-table tr:last-child td {
    border-bottom: none;
}

/* Header transition hover rule */
.signal-btn-header:hover .signal-svg-icon {
    transform: scale(1.1);
    color: #08519B !important;
}

.signal-btn-header{
    border: 1px solid #F8D7A5;
    border-radius: 79px;
    padding: 6px 8px;
}

/* Card Layout for Row Wise Audits */
.signal-audit-card {
    background: #FFFFFF;
    border: 1px solid #EAEAEA;
    border-radius: 8px;
    padding: 12px 15px;
    margin-top: 10px;
    margin-bottom: 10px;
    box-shadow: 0px 2px 5px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
    text-align: left;
}

.signal-audit-card:hover {
    border-color: #08519B;
    background-color: #F4F7FB !important;
    transform: translateY(-1px);
}

.signal-audit-row {
    font-size: 13px;
    line-height: 1.5;
    color: #333333;
    margin-bottom: 4px;
}

.signal-audit-row:last-child {
    margin-bottom: 0;
}

/* Mobile Responsiveness */
@media screen and (max-width: 480px) {
    .signal-panel {
        width: 100%;
        right: -100%; /* Fully off-screen on mobile */
    }
    
    .signal-panel.active {
        right: 0;
    }
}
