/* ===== Page background ===== */
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #38bdf8 0, #020617 40%, #020617 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Wrapper to stack chat + footer */
.page-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 560px;
    padding: 12px;
    box-sizing: border-box;
}

/* ===== Main chat card ===== */
.chat-wrapper {
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
}

.chat-window {
    background: radial-gradient(circle at top, #020617 0, #020617 45%, #020617 100%);
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.45);
    display: flex;
    flex-direction: column;
    height: 680px;
    overflow: hidden;
}

/* ===== Header ===== */
.chat-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(135deg, #020617, #0f172a);
}

/* GioTech brand styling */
.giotech-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    margin: 0;
}

.giotech-badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #facc15, #fbbf24); /* GioTech gold */
    color: #0f172a;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(250, 204, 21, 0.6);
    box-shadow:
        0 0 10px rgba(250, 204, 21, 0.75),
        inset 0 0 6px rgba(255, 255, 255, 0.25);
}

.giotech-product {
    color: #e5e7eb;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Header right side */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.status-text {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* small profile tag on header */
.profile-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #facc15, #fbbf24);
    border: 1px solid rgba(250, 204, 21, 0.7);
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.7);
}

.profile-tag .avatar-circle {
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

.profile-name {
    font-size: 0.75rem;
    color: #0f172a;
    font-weight: 600;
}

/* ===== Top bar: quick chips + links ===== */
.top-bar {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(30, 64, 175, 0.7);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(8, 47, 73, 0.9));
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 0.7rem;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.chip:hover {
    background: rgba(56, 189, 248, 0.25);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}

.top-links {
    display: flex;
    gap: 10px;
}

.top-links a {
    font-size: 0.75rem;
    color: #93c5fd;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.6);
    background: rgba(15, 23, 42, 0.7);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.top-links a:hover {
    background: rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
    transform: translateY(-1px);
}

/* ===== Messages area ===== */
.chat-messages {
    flex: 1;
    padding: 16px 16px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: radial-gradient(circle at top, #020617 0, #020617 45%, #020617 100%);
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(30, 64, 175, 0.8);
    border-radius: 999px;
}

/* ===== Message bubbles ===== */
.message {
    max-width: 86%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    text-align: right;
}

/* meta: avatar + name */
.meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.message.user .meta {
    flex-direction: row-reverse;
}

.name {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* avatar circle shared */
.avatar-circle {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: radial-gradient(circle at top left, #38bdf8, #0f172a);
    border: 1px solid rgba(148, 163, 184, 0.7);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

.avatar-circle.small {
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
}

/* actual bubble */
.bubble {
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.bot .bubble {
    background: rgba(8, 47, 73, 0.9);
    border: 1px solid rgba(129, 140, 248, 0.8);
    color: #e0f2f1;
    border-top-left-radius: 4px;
}

.message.user .bubble {
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    color: #f9fafb;
    border-bottom-right-radius: 4px;
}

/* ===== Typing indicator (3 dots) ===== */
.typing {
    padding: 4px 18px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #9ca3af;
}

.hidden {
    display: none;
}

.typing-text {
    margin-right: 4px;
}

.dot {
    width: 4px;
    height: 4px;
    background: #9ca3af;
    border-radius: 999px;
    display: inline-block;
    margin-right: 3px;
    animation: blink 1s infinite ease-in-out;
}

.dot:nth-child(3) { animation-delay: 0.2s; }
.dot:nth-child(4) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 100% { opacity: 0.2; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-1px); }
}

/* ===== Input area ===== */
.chat-input-area {
    padding: 10px 12px 14px;
    border-top: 1px solid rgba(30, 64, 175, 0.8);
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #020617, #0b1120);
}

.input-shell {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    padding: 3px;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.95));
}

.chat-input-area input {
    width: 100%;
    border-radius: 999px;
    border: none;
    padding: 9px 13px;
    background: transparent;
    color: #e5e7eb;
    outline: none;
    font-size: 0.9rem;
}

.chat-input-area input::placeholder {
    color: #6b7280;
}

/* mic icon button */
.icon-btn {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.18s ease, transform 0.12s ease, background 0.18s ease;
}

.icon-btn:hover {
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
    transform: translateY(-1px);
    background: rgba(15, 23, 42, 1);
}

/* Send button with glow hover */
#send-btn {
    border-radius: 999px;
    border: none;
    padding: 9px 16px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    color: #0b1120;
    box-shadow: 0 0 0 rgba(14, 165, 233, 0.0);
    transition: box-shadow 0.18s ease, transform 0.12s ease, filter 0.18s ease;
    font-size: 0.9rem;
}

#send-btn:hover {
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.9);
    filter: brightness(1.06);
    transform: translateY(-1px);
}

#send-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
}

/* ===== Footer ===== */
.app-footer {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
}

/* ===== Responsive tweaks ===== */
@media (max-width: 600px) {
    .chat-window {
        height: 90vh;
    }
    .top-links {
        margin-top: 4px;
    }
}
