/* Mobile-first, clean & responsive */

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: #f4f7fb;
  color: #222;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height: 1.35;
}

.container {
  width: 96%;
  max-width: 820px;
  margin: 16px auto;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(16,24,40,0.08);
}

.demoBtn {
  background: linear-gradient(90deg, #4ade80, #16a34a);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  margin: 0 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.demoBtn:hover {
  background: linear-gradient(90deg, #16a34a, #15803d);
  transform: scale(1.05);
}

.demoBtn:active {
  transform: scale(0.97);
}

.demoBtn::before {
  content: "🎬 ";
}

.fileName{
  text-align: center;
  font-size: 0.9rem;
  color: #444;
  margin-top: -4px;
  margin-bottom: 6px;
  word-break: break-word;
}
/* header */
.header { margin-bottom: 12px; }
.brand { display:flex; gap:12px; align-items:center; }
.logo-circle {
  width:48px; height:48px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg,#4CAF50,#2E8B57);
  color:white; font-weight:700; font-size:18px;
}
h1 { font-size:1.1rem; }
.tag { font-size:0.85rem; color:#555; }

/* tabs */
.tabs { display:flex; gap:8px; margin:10px 0 14px; }
.tab {
  flex:1; padding:10px 8px; border-radius:8px; border:1px solid #e6ecf1;
  background:#fbfcfd; cursor:pointer; font-weight:600; font-size:0.95rem;
}
.tab.active { background:#4CAF50; color:#fff; border-color:#4CAF50; box-shadow:0 4px 12px rgba(46,139,87,0.12); }

/* controls */
.controls { display:grid; gap:10px; margin-bottom:10px; }
.file-label {
  display:inline-block; padding:10px; border-radius:8px; border:1px dashed #ccd7e0; text-align:center;
  background:#fff; cursor:pointer; font-weight:600;
}
.file-label input { display:none; }
#cameraBtn, #analyzeBtn, #captureBtn {
  padding:10px; border-radius:8px; border:none; font-weight:600; cursor:pointer;
}
#cameraBtn { background:#0077ff; color:#fff; }
#analyzeBtn { background:#22c55e; color:#fff; }
#captureBtn { background:#ff7a00; color:#fff; }
#preview-container { text-align:center; margin-top:10px; }
#detection-result { font-size:0.9rem; color:#0077cc; }
/* camera view */
#cameraWrap { margin-top:8px; display:flex; justify-content:center; }
#video { width:100%; max-width:360px; border-radius:8px; border:1px solid #e6ecf1; }

/* loading */
.loading { margin:10px 0; color:#555; font-weight:600; display:flex; align-items:center; gap:8px; min-height:24px; }
.loading::before { content: ""; width:16px; height:16px; border:3px solid rgba(0,0,0,0.15); border-top-color:#4CAF50; border-radius:50%; animation: spin 1s linear infinite; display:inline-block; }
.loading.hidden { visibility:hidden; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

button:disabled,
button[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #4CAF50;
  outline-offset: 3px;
}

.file-label {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.file-label:hover {
  border-color: #4CAF50;
}

.modal-content {
  max-width: 420px;
}

/* results layout */
.results { margin-top:12px; }
.scoreRow {
  display:flex; gap:12px; align-items:center; flex-wrap:wrap;
}
.scoreBox {
  flex:1 1 220px; padding:12px; border-radius:10px; background:linear-gradient(180deg,#f6fff6,#fff);
  border:1px solid #e6f3ea; text-align:center;
}
.scoreValue { font-size:2.2rem; font-weight:800; color:#2d7a3b; }
.scoreLabel { font-size:0.85rem; color:#444; margin-top:4px; }
.scoreBar { width:100%; height:12px; background:#eee; border-radius:999px; overflow:hidden; margin-top:10px; }
.scoreFill { height:100%; width:0%; background:linear-gradient(90deg,#ef476f,#4CAF50); transition:width 800ms ease; }

/* chart */
.chartBox { flex:1 1 180px; padding:8px; border-radius:10px; background:#fff; border:1px solid #eef6ff; }

/* cards */
.card { margin-top:12px; padding:12px; border-radius:8px; background:#fff; border:1px solid #eef6ff; }
.card h4 { font-size:1rem; margin-bottom:8px; }
.tip { display:block; padding:8px; border-radius:6px; margin-bottom:8px; }
.good { background:#e6f9e6; color:#0b6623; font-weight:600; }
.warning { background:#fff7e6; color:#8a5900; font-weight:700; }
.bad { background:#fff0f0; color:#9b1c1c; font-weight:700; }

/* verdict */
.verdict { margin-top:12px; padding:12px; border-radius:8px; font-weight:800; font-size:1rem; text-align:center; }

/* footer */
footer {
  text-align: center;
  padding: 20px;
  color: #333;
  font-size: 14px;
}

/* Profile */
.profile-btn {
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content input, 
.modal-content select {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* responsive tweaks */
@media (max-width:640px) {
  .scoreRow { flex-direction:column; align-items:stretch; }
  .chartBox { order: -1; }
}
.stavan-labs{
  color: #333;
  text-decoration: none;
  cursor: pointer;
}