* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --dark: #0f172a;
    --deep: #111827;
    --text: #1e293b;
    --muted: #64748b;
    --light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --soft-blue: #eff6ff;
    --soft-cyan: #ecfeff;
    --success: #10b981;
    --danger: #ef4444;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    --shadow-small: 0 10px 30px rgba(15, 23, 42, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 35%),
        radial-gradient(circle at top right, rgba(6, 182, 212, 0.12), transparent 35%),
        radial-gradient(circle at bottom, rgba(245, 158, 11, 0.08), transparent 40%);
    z-index: -2;
    pointer-events: none;
}

a {
    text-decoration: none;
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
}

/* PAGE */
.ai-support-page {
    width: 100%;
    max-height: 100%;
    padding: 28px;
}

.ai-chat-shell {
    width: min(1280px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: stretch;
}

/* CHAT PANEL */
.chat-panel {
    min-height: calc(100vh - 56px);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 34px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(18px);
}

/* HEADER */
.chat-header {
    padding: 22px 24px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.bot-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bot-avatar,
.message-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 18px;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.bot-avatar {
    width: 58px;
    height: 58px;
}

.bot-avatar img,
.message-avatar img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    border-radius: 12px;
}

.chat-header h1 {
    font-size: 22px;
    color: var(--dark);
    letter-spacing: -0.6px;
}

.chat-header p {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}

.status-dot {
    width: 9px;
    height: 9px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.14);
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-btn,
.icon-btn {
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--dark);
    font-weight: 900;
    border-radius: 999px;
    transition: 0.25s ease;
}

.mini-btn {
    padding: 11px 17px;
}

.icon-btn {
    width: 43px;
    height: 43px;
    font-size: 22px;
}

.mini-btn:hover,
.icon-btn:hover {
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-small);
}

/* NOTICE */
.chat-notice {
    margin: 20px 24px 0;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(6, 182, 212, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 22px;
    display: grid;
    gap: 4px;
}

.chat-notice strong {
    color: var(--primary);
    font-size: 14px;
}

.chat-notice span {
    color: var(--muted);
    font-size: 14px;
}

/* CHAT BODY */
.chat-body {
    flex: 1;
    min-height: 420px;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-body:empty::before {
    content: "Start a conversation with IMPACTECH AI Support.";
    margin: auto;
    color: var(--muted);
    font-weight: 800;
    background: rgba(255, 255, 255, 0.8);
    border: 1px dashed rgba(37, 99, 235, 0.25);
    border-radius: 22px;
    padding: 18px 22px;
    text-align: center;
}

.chat-body::-webkit-scrollbar {
    width: 8px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

/* REAL AI MESSAGES */
.message {
    display: flex;
    gap: 12px;
    max-width: 88%;
    animation: messageIn 0.25s ease both;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 42px;
    height: 42px;
    border-radius: 15px;
}

.message-content {
    padding: 16px 18px;
    border-radius: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.bot-message .message-content {
    background: var(--white);
    border: 1px solid var(--border);
    border-top-left-radius: 8px;
}

.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border-top-right-radius: 8px;
}

.message-name {
    display: block;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 6px;
    color: var(--primary);
}

.user-message .message-name {
    color: rgba(255, 255, 255, 0.78);
}

.message-content p {
    font-size: 15.5px;
    color: var(--text);
    white-space: pre-wrap;
}

.user-message .message-content p {
    color: var(--white);
}

/* AI TOOLS BAR */
.ai-tools-bar {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.ai-tools-bar::-webkit-scrollbar {
    height: 6px;
}

.ai-tools-bar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.tool-btn {
    flex: 0 0 auto;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: var(--soft-blue);
    color: var(--primary);
    padding: 11px 15px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 13px;
    transition: 0.25s ease;
}

.tool-btn:hover {
    background: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-small);
}

/* TYPING */
.typing-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.typing-bubble {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    border-top-left-radius: 8px;
    padding: 15px 18px;
    display: flex;
    gap: 6px;
    box-shadow: var(--shadow-small);
}

.typing-bubble span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.35;
    animation: typing 1.2s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-bubble span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* CHAT FOOTER */
.chat-footer {
    padding: 18px 24px 22px;
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid var(--border);
}

.input-wrap {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    gap: 10px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px;
}

.attach-btn,
.send-btn {
    border: none;
    border-radius: 999px;
    font-weight: 900;
}

.attach-btn {
    width: 40px;
    height: 40px;
    background: var(--white);
    color: var(--primary);
    font-size: 24px;
}

.input-wrap input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--text);
}

.input-wrap input::placeholder {
    color: #94a3b8;
}

.send-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.send-btn:hover,
.attach-btn:hover {
    transform: translateY(-2px);
}

.chat-footer p {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin-top: 10px;
}

/* SIDEBAR */
.support-sidebar {
    display: grid;
    gap: 18px;
    align-content: start;
}

.sidebar-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 26px;
    box-shadow: var(--shadow-small);
    backdrop-filter: blur(18px);
}

.sidebar-card h2 {
    color: var(--dark);
    font-size: 22px;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.sidebar-card a,
.sidebar-tool {
    display: block;
    width: 100%;
    text-align: left;
    color: var(--muted);
    font-weight: 800;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    transition: 0.25s ease;
    font-size: 14px;
}

.sidebar-card a:hover,
.sidebar-tool:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.sidebar-card a:last-child,
.sidebar-tool:last-child {
    border-bottom: none;
}

.highlight-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border: none;
}

.highlight-card h2 {
    color: var(--white);
}

.highlight-card .sidebar-btn {
    display: flex;
    justify-content: center;
    text-align: center;
    border: none;
    background: var(--white);
    color: var(--primary);
    padding: 12px 18px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.highlight-card .sidebar-btn:hover {
    transform: translateY(-2px);
    color: var(--primary);
}

.faq-item {
    display: grid;
    gap: 5px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item strong {
    color: var(--dark);
    font-size: 14px;
}

.faq-item span {
    color: var(--muted);
    font-size: 13px;
}

/* RESPONSIVE */
@media (max-width: 1050px) {
    .ai-chat-shell {
        grid-template-columns: 1fr;
    }

    .chat-panel {
        min-height: 760px;
    }

    .support-sidebar {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 850px) {
    .support-sidebar {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 100%;
    }
}

@media (max-width: 620px) {
    .ai-support-page {
        padding: 12px;
    }

    .chat-panel {
        border-radius: 24px;
        min-height: calc(100vh - 24px);
    }

    .chat-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .chat-actions {
        width: 100%;
    }

    .mini-btn {
        flex: 1;
    }

    .chat-body,
    .chat-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ai-tools-bar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .input-wrap {
        grid-template-columns: 42px 1fr;
        border-radius: 22px;
    }

    .send-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .bot-avatar {
        width: 52px;
        height: 52px;
    }

    .chat-header h1 {
        font-size: 20px;
    }
}
/* PAGE */
.ai-support-page {
    width: 100%;
    height: 100vh;
    padding: 14px;
    overflow: hidden;
}

.ai-chat-shell {
    width: 100%;
    max-width: 1100px;
    height: calc(100vh - 28px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    align-items: stretch;
}

/* CHAT PANEL */
.chat-panel {
    height: 100%;
    min-height: 0;
    max-height: calc(100vh - 28px);
    border-radius: 24px;
}

/* HEADER */
.chat-header {
    padding: 14px 18px;
}

.bot-avatar {
    width: 46px;
    height: 46px;
}

.chat-header h1 {
    font-size: 18px;
}

.chat-header p {
    font-size: 12px;
}

/* NOTICE */
.chat-notice {
    margin: 12px 16px 0;
    padding: 12px 14px;
    border-radius: 16px;
}

/* CHAT BODY */
.chat-body {
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
}

/* AI TOOLS BAR */
.ai-tools-bar {
    padding: 10px 16px;
}

/* FOOTER */
.chat-footer {
    padding: 12px 16px 14px;
}

.chat-footer p {
    display: none;
}

/* SIDEBAR */
.support-sidebar {
    max-height: calc(100vh - 28px);
    overflow-y: auto;
}

.sidebar-card {
    padding: 18px;
    border-radius: 22px;
}

.sidebar-card h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

.sidebar-card a,
.sidebar-tool {
    padding: 9px 0;
    font-size: 13px;
}
.ai-rich-content p {
    margin-bottom: 10px;
}

.ai-rich-content strong {
    color: var(--dark);
    font-weight: 900;
}

.ai-list {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 10px 0 12px;
}

.ai-list li {
    background: var(--soft-blue);
    border: 1px solid rgba(37, 99, 235, 0.12);
    color: var(--text);
    padding: 10px 12px 10px 34px;
    border-radius: 14px;
    position: relative;
    font-weight: 700;
}

.ai-list li::before {
    content: "✓";
    position: absolute;
    left: 12px;
    top: 9px;
    color: var(--primary);
    font-weight: 900;
}

.ai-price-line {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    font-weight: 800;
}

.ai-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.ai-action-btn {
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 15px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.25s ease;
}

.primary-action {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.light-action {
    background: var(--soft-blue);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.ai-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-small);
}

.ai-inline-link {
    color: var(--primary);
    font-weight: 900;
    text-decoration: underline;
    word-break: break-word;
}
/* ICON + TEXT SPACING FIX */

/* buttons */
.tool-btn,
.sidebar-tool,
.sidebar-btn,
.mini-btn,
.send-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* sidebar links */
.sidebar-btn,
.sidebar-tool {
    width: 100%;
}

/* headings */
.chat-notice strong,
.sidebar-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* footer text */
.chat-footer p {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* bot avatar icon */
.bot-avatar i {
    font-size: 24px;
    color: white;
}

/* tool bar icon */
.tool-btn i {
    font-size: 14px;
    flex-shrink: 0;
}

/* sidebar icons */
.sidebar-tool i,
.sidebar-btn i {
    width: 18px;
    flex-shrink: 0;
}

/* header buttons */
.mini-btn i,
.send-btn i,
.attach-btn i,
.icon-btn i {
    flex-shrink: 0;
}

/* notice icon */
.chat-notice strong i {
    color: var(--primary);
}

/* sidebar heading icon */
.sidebar-card h2 i {
    color: var(--primary);
}

/* highlight card icons */
.highlight-card h2 i,
.highlight-card .sidebar-btn i {
    color: inherit;
}
/* BETTER SMALL DEVICE RESPONSIVENESS */
@media (max-width: 900px) {
    body {
        overflow-x: hidden;
    }

    .ai-support-page {
        height: auto;
        min-height: 100vh;
        padding: 10px;
        overflow: visible;
    }

    .ai-chat-shell {
        width: 100%;
        height: auto;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .chat-panel {
        width: 100%;
        height: calc(100vh - 20px);
        min-height: 560px;
        max-height: none;
        border-radius: 22px;
    }

    .support-sidebar {
        display: grid;
        grid-template-columns: 1fr;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 600px) {
    .ai-support-page {
        padding: 0;
    }

    .ai-chat-shell {
        gap: 0;
    }

    .chat-panel {
        height: 100vh;
        min-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .chat-header {
        padding: 12px;
        gap: 10px;
        flex-direction: row;
        align-items: center;
    }

    .bot-profile {
        gap: 10px;
        min-width: 0;
    }

    .bot-avatar {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .bot-avatar i {
        font-size: 20px;
    }

    .chat-header h1 {
        font-size: 15px;
        white-space: nowrap;
    }

    .chat-header p {
        font-size: 11px;
    }

    .chat-actions {
        width: auto;
        gap: 6px;
        flex-shrink: 0;
    }

    .mini-btn {
        padding: 9px 10px;
        font-size: 12px;
    }

    .mini-btn i {
        margin-right: 0;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .chat-notice {
        margin: 10px 12px 0;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .chat-notice strong {
        font-size: 12px;
    }

    .chat-notice span {
        font-size: 12px;
        line-height: 1.4;
    }

    .chat-body {
        padding: 12px;
        gap: 12px;
    }

    .chat-body:empty::before {
        font-size: 13px;
        padding: 14px;
        border-radius: 16px;
    }

    .message {
        max-width: 96%;
        gap: 8px;
    }

    .message-avatar {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .message-avatar img {
        width: 68%;
        height: 68%;
    }

    .message-content {
        padding: 12px 14px;
        border-radius: 17px;
    }

    .message-name {
        font-size: 11px;
    }

    .message-content p {
        font-size: 14px;
    }

    .ai-list li {
        font-size: 13px;
        padding: 9px 10px 9px 30px;
    }

    .ai-action-row {
        gap: 8px;
    }

    .ai-action-btn {
        width: 100%;
        min-height: 38px;
        font-size: 12px;
    }

    .ai-tools-bar {
        padding: 9px 10px;
        gap: 8px;
    }

    .tool-btn {
        padding: 9px 12px;
        font-size: 12px;
    }

    .chat-footer {
        padding: 10px;
    }

    .input-wrap {
        display: grid;
        grid-template-columns: 38px 1fr 72px;
        gap: 6px;
        border-radius: 18px;
        padding: 6px;
    }

    .attach-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .input-wrap input {
        font-size: 14px;
        min-width: 0;
    }

    .send-btn {
        width: auto;
        padding: 9px 11px;
        font-size: 12px;
        grid-column: auto;
    }

    .send-btn i {
        display: none;
    }

    .chat-footer p {
        display: none !important;
    }

    .support-sidebar {
        display: none;
    }
}

@media (max-width: 380px) {
    .chat-header h1 {
        font-size: 13px;
    }

    .mini-btn {
        font-size: 0;
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
    }

    .mini-btn i {
        font-size: 14px;
    }

    .input-wrap {
        grid-template-columns: 34px 1fr 60px;
    }

    .send-btn {
        font-size: 11px;
        padding: 8px;
    }
}
