* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #f5f7fb;
  display: flex;
  justify-content: center;
  padding: 20px;
  color: #1f2933;
}

#appContainer {
  width: 100%;
  max-width: 1120px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 20px;
}

.iconCircle {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #065f46, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-size: 30px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #064e3b;
}

.header p {
  margin-top: 4px;
  font-size: 14px;
  color: #4b5563;
}

/* Layout */
.mainArea {
  display: flex;
  gap: 20px;
  width: 100%;
}

/* Panels */
.leftPanel,
.rightPanel {
  flex: 1;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

/* Media */
.mediaCard {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1120;
  margin-bottom: 12px;
  position: relative;
}

#cameraView {
  width: 100%;
  height: 230px;
  object-fit: cover;
  background: #000;
}

#uploadedImage {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  display: none;
  background: #000;
}

/* Buttons */
.buttonRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

button {
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  color: #ffffff;
  background: #065f46;
  transition: background 0.15s ease, transform 0.1s ease;
}

button:hover {
  background: #047857;
  transform: translateY(-1px);
}

/* Upload label */
#uploadLabel {
  flex: 1;
  text-align: center;
  background: #0f766e;
  color: #ecfdf5;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

#uploadLabel input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Model status & prediction */
#modelStatus {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ecfdf3;
  color: #065f46;
  font-size: 13px;
}

#predictionText {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

/* Chatbox */
#chatbox {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#chatMessages {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: #f3f4f6;
  overflow-y: auto;
  margin-bottom: 8px;
}

/* Messages */
.message {
  display: flex;
  margin-bottom: 8px;
}

.message.user {
  justify-content: flex-end;
}

.message.bot {
  justify-content: flex-start;
}

.bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}

.message.user .bubble {
  background: #065f46;
  color: #ecfdf5;
  border-bottom-right-radius: 4px;
}

.message.bot .bubble {
  background: #ffffff;
  color: #111827;
  border-bottom-left-radius: 4px;
  border: 1px solid #e5e7eb;
}

/* Options */
.chatOptions {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chatOptions button {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  background: #e0f2f1;
  color: #065f46;
  cursor: pointer;
  border: 1px solid #c9e7e3;
  transition: 0.15s ease;
}

.chatOptions button:hover {
  background: #ccfbf1;
  transform: translateY(-1px);
}

/* Clear chat button */
.clearChatBtn {
  width: 100%;
  margin-top: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.clearChatBtn:hover {
  background: #b91c1c;
}

/* Footer */
.footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

/* Responsive */
@media screen and (max-width: 900px) {
  .mainArea {
    flex-direction: column;
  }

  #cameraView,
  #uploadedImage {
    height: 210px;
  }
}
