* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 100%;
    max-width: 900px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #16213e;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #0f3460;
    border-bottom: 2px solid #06b6d4;
}

.chat-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #06b6d4;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header select {
    background: #1e2a4a;
    border: 1px solid #4a5568;
    color: #a0aec0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.chat-header select:focus {
    border-color: #06b6d4;
}

.chat-header button {
    background: transparent;
    border: 1px solid #4a5568;
    color: #a0aec0;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.chat-header button:hover {
    border-color: #06b6d4;
    color: #06b6d4;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    animation: fadeIn 0.2s ease-in;
}

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

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

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 14px;
}

.message.user .message-content {
    background: #0891b2;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: #1e2a4a;
    color: #e0e0e0;
    border: 1px solid #2d3a5c;
    border-bottom-left-radius: 4px;
}

.message-content strong {
    color: #06b6d4;
}

.message-content code {
    background: #0d1b36;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.message-content a {
    color: #3b82f6;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.loading .dots::after {
    content: "";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75% { content: "..."; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-input {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: #0f3460;
    border-top: 1px solid #2d3a5c;
}

.chat-input textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #2d3a5c;
    border-radius: 8px;
    background: #1e2a4a;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
}

.chat-input textarea:focus {
    border-color: #06b6d4;
}

.chat-input textarea::placeholder {
    color: #4a5568;
}

.chat-input button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.chat-input button:hover {
    opacity: 0.9;
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Product cards */
.product-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    max-width: 100%;
}

.product-card {
    background: #0f1b35;
    border: 1px solid #2d3a5c;
    border-radius: 10px;
    padding: 12px 14px;
    width: calc(50% - 5px);
    min-width: 260px;
    font-size: 13px;
    line-height: 1.5;
    transition: border-color 0.15s;
}

.product-card:hover {
    border-color: #06b6d4;
}

.pc-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.pc-mfg {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #06b6d4;
    font-weight: 600;
}

.pc-pn {
    font-size: 14px;
    font-weight: 700;
    color: #f0f0f0;
    word-break: break-all;
}

.pc-type {
    font-size: 12px;
    color: #8892a8;
    margin-bottom: 6px;
    text-transform: capitalize;
}

.pc-specs {
    font-size: 12px;
    color: #c0c8d8;
    margin-bottom: 6px;
}

.pc-details {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.pc-tag {
    display: inline-block;
    background: #1a2744;
    border: 1px solid #2d3a5c;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    color: #a0b0c8;
}

.pc-cutting {
    background: #132040;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
    font-size: 12px;
}

.pc-cutting-label {
    color: #06b6d4;
    font-weight: 600;
    text-transform: capitalize;
    margin-right: 6px;
}

.pc-val {
    color: #e0e8f0;
    margin-right: 10px;
    font-weight: 500;
}

@media (max-width: 600px) {
    .product-card {
        width: 100%;
    }
}
