/* =======================================================
   SECTION 9 : AI STRUCTURAL ENGINEERING ASSISTANT
======================================================= */
.ai-assistant-section {
    position: relative;
    padding: 110px 5.5%;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(46, 196, 255, 0.08), transparent 28%),
        radial-gradient(circle at 88% 80%, rgba(180, 130, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #081a29 0%, #07111d 100%);
}
.ai-assistant-section::before {
    position: absolute;
    inset: 0;
    content: "";
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(101, 204, 249, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(101, 204, 249, 0.04) 1px, transparent 1px);
    background-size: 58px 58px;
    pointer-events: none;
}
.ai-assistant-section .section-header,
.assistant-layout,
.suggested-prompts,
.ai-assistant-section > .glass-card {
    position: relative;
    z-index: 1;
    width: min(1380px, 100%);
    margin-right: auto;
    margin-left: auto;
}
/* ---------- Assistant workspace ---------- */
.assistant-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 0.32fr);
    align-items: stretch;
    gap: 24px;
}
.chat-panel {
    display: flex;
    flex-direction: column;
    min-height: 690px;
    padding: 0;
    overflow: hidden;
}
.chat-panel::before {
    display: none;
}
/* ---------- Chat header ---------- */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(132, 211, 244, 0.14);
    background:
        linear-gradient(90deg, rgba(46, 196, 255, 0.075), rgba(180, 130, 255, 0.04));
}
.assistant-avatar,
.message-icon {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    color: #04131f;
    border-radius: 11px;
    background: linear-gradient(135deg, #8be8ff, #2ec4ff);
    font-size: 0.74rem;
    font-weight: 700;
    box-shadow: 0 0 22px rgba(46, 196, 255, 0.24);
    place-items: center;
}
.chat-header > div:nth-child(2) {
    min-width: 0;
}
.chat-header h3 {
    margin: 0;
    color: #e9faff;
    font-size: 0.88rem;
    font-weight: 600;
}
.online-status {
    display: inline-block;
    margin-top: 4px;
    color: #8fedb8;
    font-size: 0.68rem;
}
.chat-header button {
    margin-left: auto;
    padding: 7px 10px;
    color: #9fc4d3;
    border: 1px solid rgba(135, 212, 245, 0.18);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
    font-size: 0.69rem;
    cursor: pointer;
    transition: 0.2s ease;
}
.chat-header button:hover {
    color: #ffffff;
    border-color: rgba(46, 196, 255, 0.48);
    background: rgba(46, 196, 255, 0.1);
}
/* ---------- Messages ---------- */
.chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    overflow-y: auto;
    background:
        linear-gradient(rgba(46, 196, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 196, 255, 0.022) 1px, transparent 1px),
        rgba(3, 17, 28, 0.47);
    background-size: 28px 28px;
}
.message {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    max-width: 82%;
}
.message-content {
    padding: 14px 16px;
    border: 1px solid rgba(132, 211, 244, 0.14);
    border-radius: 4px 12px 12px;
    background: rgba(12, 38, 57, 0.8);
    color: #b8d2dd;
    font-size: 0.78rem;
    line-height: 1.68;
}
.message-content p {
    margin: 0 0 10px;
}
.message-content p:last-child {
    margin-bottom: 0;
}
.message-content ul {
    display: grid;
    gap: 5px;
    margin: 10px 0 0;
    padding-left: 18px;
}
.message-content li::marker {
    color: var(--cyan);
}
.message-icon {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
    border-radius: 9px;
    font-size: 0.59rem;
}
.user-message {
    align-self: flex-end;
    justify-content: flex-end;
    margin-left: auto;
}
.user-message .message-content {
    color: #e4f9ff;
    border-color: rgba(46, 196, 255, 0.3);
    border-radius: 12px 4px 12px 12px;
    background: linear-gradient(135deg, rgba(46, 196, 255, 0.2), rgba(21, 88, 123, 0.32));
}
.ai-message .message-content strong {
    display: block;
    margin: 10px 0;
    color: #9feec0;
    font-weight: 600;
}
/* ---------- Chat composer ---------- */
.chat-input {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 15px 18px;
    border-top: 1px solid rgba(132, 211, 244, 0.14);
    background: rgba(9, 30, 46, 0.94);
}
.chat-input textarea {
    flex: 1;
    min-height: 47px;
    max-height: 130px;
    padding: 12px 13px;
    resize: vertical;
    outline: none;
    color: #d9f2fc;
    border: 1px solid rgba(134, 212, 245, 0.17);
    border-radius: 9px;
    background: rgba(3, 18, 30, 0.62);
    font-size: 0.76rem;
    line-height: 1.5;
    transition: 0.2s ease;
}
.chat-input textarea::placeholder {
    color: rgba(151, 186, 202, 0.56);
}
.chat-input textarea:focus {
    border-color: rgba(46, 196, 255, 0.62);
    box-shadow: 0 0 0 3px rgba(46, 196, 255, 0.08);
}
.chat-input button {
    min-height: 47px;
    padding: 11px 17px;
    color: #04131f;
    border: 0;
    border-radius: 9px;
    background: var(--cyan);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(46, 196, 255, 0.18);
    transition: 0.2s ease;
}
.chat-input button:hover {
    transform: translateY(-2px);
    background: #7ae3ff;
    box-shadow: 0 13px 25px rgba(46, 196, 255, 0.3);
}
/* ---------- Assistant sidebar ---------- */
.assistant-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.assistant-sidebar .glass-card {
    padding: 20px;
    border-radius: 13px;
}
.assistant-sidebar h3 {
    margin: 0 0 16px;
    color: #e8f9ff;
    font-size: 0.89rem;
    font-weight: 600;
}
/* ---------- Quick commands ---------- */
.command-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
.command-grid button {
    min-height: 52px;
    padding: 9px;
    color: #aad0df;
    border: 1px solid rgba(132, 211, 244, 0.14);
    border-radius: 8px;
    background: rgba(3, 17, 29, 0.3);
    font-size: 0.68rem;
    line-height: 1.35;
    cursor: pointer;
    transition: 0.2s ease;
}
.command-grid button:hover {
    transform: translateY(-2px);
    color: #e8faff;
    border-color: rgba(46, 196, 255, 0.4);
    background: rgba(46, 196, 255, 0.1);
}
/* ---------- Sidebar model table ---------- */
.assistant-sidebar table {
    width: 100%;
    border-collapse: collapse;
}
.assistant-sidebar td {
    padding: 9px 0;
    border-bottom: 1px solid rgba(132, 211, 244, 0.1);
    color: #88a9b9;
    font-size: 0.71rem;
}
.assistant-sidebar tr:last-child td {
    border-bottom: 0;
}
.assistant-sidebar td:last-child {
    color: #dff4fc;
    font-weight: 500;
    text-align: right;
}
/* ---------- Capability list ---------- */
.capability-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.capability-list li {
    color: #9beebd;
    font-size: 0.72rem;
    line-height: 1.4;
}
/* ---------- Suggested questions ---------- */
.suggested-prompts {
    margin-top: 24px;
}
.suggested-prompts h3 {
    margin: 0 0 17px;
    color: #e8f9ff;
    font-size: 0.92rem;
    font-weight: 600;
}
.prompt-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.prompt-examples button {
    padding: 10px 13px;
    color: #b9d9e7;
    border: 1px solid rgba(133, 211, 244, 0.16);
    border-radius: 999px;
    background: rgba(3, 17, 29, 0.3);
    font-size: 0.72rem;
    cursor: pointer;
    transition: 0.2s ease;
}
.prompt-examples button:hover {
    transform: translateY(-2px);
    color: #eaffff;
    border-color: rgba(46, 196, 255, 0.42);
    background: rgba(46, 196, 255, 0.1);
}
/* ---------- Document generation ---------- */
.ai-assistant-section > .glass-card {
    margin-top: 24px;
}
.ai-assistant-section > .glass-card .card-header {
    margin-bottom: 20px;
}
.ai-assistant-section > .glass-card .card-header h3 {
    margin: 0;
    color: #e8faff;
    font-size: 0.94rem;
    font-weight: 600;
}
.document-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.document-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 166px;
    padding: 17px;
    border: 1px solid rgba(133, 211, 244, 0.13);
    border-radius: 10px;
    background: rgba(3, 17, 29, 0.31);
    transition: 0.22s ease;
}
.document-card:hover {
    transform: translateY(-4px);
    border-color: rgba(46, 196, 255, 0.35);
    background: rgba(46, 196, 255, 0.055);
}
.document-card > span {
    display: grid;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: rgba(46, 196, 255, 0.1);
    font-size: 1.1rem;
    place-items: center;
}
.document-card h4 {
    margin: 15px 0;
    color: #dff5fc;
    font-size: 0.77rem;
    font-weight: 600;
    line-height: 1.45;
}
.document-card button {
    margin-top: auto;
    padding: 7px 11px;
    color: #86dfff;
    border: 1px solid rgba(46, 196, 255, 0.24);
    border-radius: 7px;
    background: rgba(46, 196, 255, 0.06);
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease;
}
.document-card button:hover {
    color: #06131f;
    background: var(--cyan);
}
/* ---------- Responsive AI assistant section ---------- */
@media (max-width: 1080px) {
    .ai-assistant-section {
        padding: 88px 4%;
    }
    .assistant-layout {
        grid-template-columns: 1fr;
    }
    .assistant-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
    .assistant-sidebar .glass-card:first-child {
        grid-column: 1 / -1;
    }
    .document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    .ai-assistant-section {
        padding: 72px 22px;
    }
    .chat-panel {
        min-height: 620px;
    }
    .chat-header {
        padding: 13px 15px;
    }
    .chat-header button {
        padding: 6px 8px;
        font-size: 0.63rem;
    }
    .chat-messages {
        padding: 16px;
    }
    .message {
        max-width: 94%;
    }
    .message-content {
        padding: 12px 13px;
        font-size: 0.73rem;
    }
    .chat-input {
        padding: 12px;
    }
    .chat-input button {
        padding: 10px 13px;
    }
    .assistant-sidebar {
        display: flex;
    }
    .command-grid {
        grid-template-columns: 1fr;
    }
    .document-grid {
        grid-template-columns: 1fr;
    }
    .document-card {
        min-height: 135px;
    }
    .prompt-examples {
        display: grid;
        grid-template-columns: 1fr;
    }
    .prompt-examples button {
        width: 100%;
        border-radius: 9px;
        text-align: left;
    }
}
