
/* =========================================
   IZZYJAMZ AI ASSISTANT
   CLEAN COMPLETE STYLESHEET
========================================= */

/* COLOUR VARIABLES */
:root {
    --ink: #18202b;
    --muted: #667085;
    --brand: #6d35c7;
    --bg: #f5f3fa;
    --line: #e5e1ed;
}

/* GLOBAL RESET */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.5 Inter, system-ui, Arial, sans-serif;
}

p {
    color: var(--muted);
}

/* HEADER AND NAVIGATION */
header {
    height: 70px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(5vw, 20px);
}

.brand {
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
    font-size: 19px;
}

.brand span {
    color: var(--brand);
    font-weight: 600;
    font-size: 14px;
    margin-left: 6px;
}

nav {
    display: flex;
    gap: 22px;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}

/* MAIN LAYOUT */
main {
    max-width: 920px;
    margin: 45px auto;
    padding: 0 18px;
}

.chat-shell,
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 12px 35px #30204a0b;
}

.chat-shell {
    max-width: 760px;
    margin: auto;
}

.intro {
    text-align: center;
    padding: 12px 12px 25px;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 1.7px;
    color: var(--brand);
    font-weight: 800;
}

h1 {
    font-size: 30px;
    line-height: 1.2;
    margin: 10px 0;
}

/* CHAT WINDOW */
.chat-log {
    height: 390px;
    overflow: auto;
    background: #faf9fc;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* MESSAGE BUBBLES */
.bubble {
    max-width: 85%;
    padding: 12px 15px;
    border-radius: 16px;
    overflow-wrap: anywhere;
    min-width: 0;
}

.bubble.assistant {
    background: #eee8f8;
    align-self: flex-start;
    max-width: 100%;
    width: fit-content;
    font-size: 15px;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.bubble.user {
    background: var(--brand);
    color: white;
    align-self: flex-end;
    white-space: pre-wrap;
}

/* AI RESPONSE PARAGRAPHS */
.bubble.assistant p {
    margin: 0 0 5px;
    padding: 0;
    line-height: 1.45;
}

.bubble.assistant p:last-child {
    margin-bottom: 0;
}

.bubble.assistant p:empty {
    display: none;
}

/* AI RESPONSE HEADINGS */
.bubble.assistant h1,
.bubble.assistant h2,
.bubble.assistant h3,
.bubble.assistant h4 {
    font-weight: 700;
    line-height: 1.3;
    padding: 0;
    margin: 10px 0 5px;
}

.bubble.assistant h1 {
    font-size: 1.4rem;
}

.bubble.assistant h2 {
    font-size: 1.2rem;
}

.bubble.assistant h3 {
    font-size: 1.08rem;
}

.bubble.assistant h4 {
    font-size: 1rem;
}

.bubble.assistant > :first-child {
    margin-top: 0;
}

.bubble.assistant > :last-child {
    margin-bottom: 0;
}

/* TEXT FORMATTING */
.bubble.assistant strong {
    font-weight: 750;
}

.bubble.assistant em {
    font-style: italic;
}

.bubble.assistant blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid var(--brand);
    background: #f5f0fc;
    border-radius: 4px;
}

.bubble.assistant hr {
    border: 0;
    border-top: 1px solid #c9c3d3;
    margin: 10px 0;
}

/* AI RESPONSE LISTS */
.bubble.assistant ul,
.bubble.assistant ol {
    padding-left: 22px;
    margin: 4px 0 7px;
}

.bubble.assistant li {
    margin: 0 0 2px;
    padding-left: 2px;
    line-height: 1.45;
}

.bubble.assistant li:last-child {
    margin-bottom: 0;
}

.bubble.assistant li > p {
    margin-bottom: 3px;
}

/* LINKS */
.bubble.assistant a {
    color: #1747a6;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.bubble.assistant a:hover {
    color: var(--brand);
}

/* TABLES */
.bubble.assistant table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: auto;
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.45;
}

.bubble.assistant th,
.bubble.assistant td {
    border: 1px solid #9ca3af;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.bubble.assistant th {
    background-color: #e5e7eb;
    color: #111827;
    font-weight: 700;
}

.bubble.assistant tr:nth-child(even) td {
    background-color: #f9fafb;
}

/* CODE BLOCKS */
.bubble.assistant pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 12px;
    background: #f1eef6;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre;
}

.bubble.assistant code {
    overflow-wrap: anywhere;
    font-size: 0.9em;
}

/* CHAT INPUT */
#chat-form {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

textarea,
input {
    font: inherit;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    width: 100%;
    background: #fff;
}

#chat-form textarea {
    resize: vertical;
    min-height: 54px;
}

/* BUTTONS */
button {
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: white;
    padding: 12px 20px;
    font-weight: 700;
    cursor: pointer;
}

button:disabled {
    opacity: .6;
    cursor: wait;
}

.secondary {
    background: #eee8f8;
    color: var(--brand);
}

/* STATUS AND ADMIN PANELS */
.status,
.muted {
    font-size: 13px;
    color: var(--muted);
}

.status {
    text-align: center;
    margin-top: 12px;
}

.panel {
    max-width: 720px;
    margin: auto;
}

.narrow {
    max-width: 420px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 15px 0 6px;
}

.panel form button {
    margin-top: 16px;
}

.notice {
    background: #fff2df;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats {
    display: flex;
    gap: 14px;
    margin: 25px 0;
}

.stats div {
    flex: 1;
    background: #f8f6fb;
    border-radius: 14px;
    padding: 18px;
}

.stats b,
.stats span {
    display: block;
}

.stats b {
    font-size: 26px;
}

.stats span {
    color: var(--muted);
    font-size: 13px;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 600px) {
    main {
        margin: 18px auto;
    }

    .chat-shell,
    .panel {
        padding: 18px;
        border-radius: 16px;
    }

    .chat-log {
        height: 52vh;
    }

    h1 {
        font-size: 25px;
    }

    #chat-form {
        flex-direction: column;
    }

    #chat-form button {
        width: 100%;
    }

    .bubble.assistant {
        font-size: 15px;
        padding: 14px;
        line-height: 1.45;
    }

    .bubble.assistant table {
        font-size: 13px;
    }

    .bubble.assistant th,
    .bubble.assistant td {
        padding: 8px;
    }

    .bubble.assistant h1 {
        font-size: 1.4em;
    }

    .bubble.assistant h2 {
        font-size: 1.2em;
    }
}
