body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0; background-color: #f4f6f8; color: #333; }
header { background: #6a0dad; color: white; padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
header h1 { margin: 0; font-size: 1.5rem; }
.user-area, #pi-rate-display { font-size: 0.9rem; }
main { padding: 1rem 2rem; }

.controls { margin-bottom: 1.5rem; display: flex; gap: 1rem; }
#search-input { flex-grow: 1; padding: 0.5rem; border: 1px solid #ddd; border-radius: 4px; }
#new-product-btn { background-color: #007bff; color: white; border: none; padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; }
#new-product-btn:hover { background-color: #0056b3; }

#product-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }
.product-card { background: white; border: 1px solid #e0e0e0; border-radius: 8px; padding: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: box-shadow 0.2s; }
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.product-card h3 { margin: 0.5rem 0; font-size: 1.1rem; }
.price { font-weight: bold; color: #6a0dad; font-size: 1.2rem; }
.usd-price { font-size: 0.8rem; color: #666; }
.product-seller { font-size: 0.8rem; color: #777; margin: 0.5rem 0; }
.product-actions button { background: #eee; border: 1px solid #ccc; padding: 5px 10px; border-radius: 4px; cursor: pointer; margin-right: 5px; }
.product-actions button:hover { background: #ddd; }

/* Modal Styles */
.modal { position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; }
.modal-content { background-color: #fefefe; padding: 20px; border: 1px solid #888; width: 80%; max-width: 500px; border-radius: 8px; }
.close-btn { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
#new-product-form { display: flex; flex-direction: column; gap: 1rem; }
#new-product-form input, #new-product-form textarea { padding: 0.75rem; border: 1px solid #ccc; border-radius: 4px; }
#new-product-form button { padding: 0.75rem; background-color: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; }
#new-product-form button:hover { background-color: #218838; }

/* Chat Styles */
#chat-container { position: fixed; bottom: 0; right: 20px; width: 320px; background: white; border: 1px solid #ccc; border-radius: 8px 8px 0 0; box-shadow: 0 0 15px rgba(0,0,0,0.2); display: flex; flex-direction: column; }
.chat-header { background: #6a0dad; color: white; padding: 10px; display: flex; justify-content: space-between; align-items: center; }
.chat-header h3 { margin: 0; font-size: 1rem; }
#close-chat-btn { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
#chat-messages { height: 250px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-message { max-width: 80%; padding: 8px 12px; border-radius: 12px; }
.chat-message.sent { background: #007bff; color: white; align-self: flex-end; }
.chat-message.received { background: #e9e9eb; color: #333; align-self: flex-start; }
.chat-input-area { display: flex; border-top: 1px solid #ccc; }
#chat-input { flex-grow: 1; border: none; padding: 10px; outline: none; }
#chat-send-btn { background: #007bff; color: white; border: none; padding: 0 15px; cursor: pointer; }