/* =====================================================
   NUTRI SCAN FIT — index.css
   Light theme · Mobile first
   ===================================================== */


/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


/* ── Tokens ── */
:root {
  --brand:          #00C8A0;
  --brand-dark:     #009C7A;
  --brand-subtle:   rgba(0, 200, 160, 0.10);

  --surface:        #F7F8FA;
  --card-bg:        #FFFFFF;

  --text-primary:   #1A1A2E;
  --text-secondary: #6B7280;
  --text-hint:      #9CA3AF;

  --border:         rgba(0, 0, 0, 0.08);

  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --radius-pill:    999px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


/* ── Base ── */
html, body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--surface);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}


/* =====================================================
   HEADER
   ===================================================== */
header {
  background: var(--card-bg);
  border-bottom: 0.5px solid var(--border);
  padding: 12px 16px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.header-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

header h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-sub {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ── Chip buttons (header) ── */
.badge-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-dark);
  background: var(--brand-subtle);
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.badge-btn:hover {
  background: rgba(0, 200, 160, 0.18);
}


/* ── Generic badge (Scanner : inconnu) ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}


/* =====================================================
   LAYOUT
   ===================================================== */
main.grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}


/* =====================================================
   CARD
   ===================================================== */
.card {
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}


/* =====================================================
   BUTTONS
   ===================================================== */
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 18px;
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: background 0.15s;
}

.primary:hover  { background: var(--brand-dark); }
.primary:active { transform: scale(0.98); }

/* Stop button */
button#stopBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

button#stopBtn:hover  { background: #EDEEF0; }
button#stopBtn:active { transform: scale(0.98); }

/* Row wrapper for start/stop */
/* Ligne boutons scan */
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}
/* =====================================================
   VIDEO / VIEWFINDER
   ===================================================== */
video#preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #1A1A2E;
  border-radius: var(--radius-md);
  display: block;
  object-fit: cover;
}


/* =====================================================
   MANUAL INPUT ROW
   ===================================================== */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 2px;
}

.divider-line {
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

.divider-text {
  font-size: 12px;
  color: var(--text-hint);
  font-weight: 500;
  white-space: nowrap;
}

/* Input + search button */
#manualInput {
  flex: 1;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s;
}

#manualInput::placeholder {
  color: var(--text-hint);
  font-size: 14px;
}

#manualInput:focus {
  border-color: var(--brand);
}

#manualBtn {
  background: var(--brand);
  border: none;
  border-radius: var(--radius-md);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #fff;
  font-size: 18px;
  transition: background 0.15s;
}

#manualBtn:hover  { background: var(--brand-dark); }
#manualBtn:active { transform: scale(0.98); }

#scanStatus {
  font-size: 13px;
  color: var(--text-hint);
  margin-top: 8px;
  min-height: 18px;
}


/* =====================================================
   RESULT CARD
   ===================================================== */
#resultCard .title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

#result {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.6;
}

#result.muted {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 0;
  font-size: 14px;
  color: var(--text-hint);
  text-align: center;
}


/* =====================================================
   PROFILE CARD
   ===================================================== */
#profileCard {
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
}


/* =====================================================
   DAILY INFO MODAL
   ===================================================== */
.info-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.45);
  display: flex;
  align-items: center;        /* ← était flex-end */
  justify-content: center;
  z-index: 100;
  padding: 0 16px;            /* ← était 0 0 24px */
}

.info-modal.hidden {
  display: none;
}

.info-box {
  background: var(--card-bg);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-md) var(--radius-md);
  border: 0.5px solid var(--border);
  padding: 24px 20px 20px;
  width: 100%;
  max-width: 480px;
  position: relative;
}


.info-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-pill);
  width: 30px;
  height: 30px;
  font-size: 18px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.info-box p {
  font-weight: bold;
  font-size: 15px;
  color: var(--color-black);
  line-height: 1.65;
  margin-bottom: 18px;
}

.info-actions {
  display: flex;
  justify-content: flex-end;
}

.share-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-dark);
  background: var(--brand-subtle);
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.share-info-btn:hover {
  background: rgba(0, 200, 160, 0.18);
}


/* =====================================================
   FOOTER
   ===================================================== */
footer {
  font-size: 12px;
  color: var(--text-hint);
  text-align: center;
  padding: 20px 20px 32px;
  line-height: 1.6;
  border-top: 0.5px solid var(--border);
  margin-top: 8px;
}


/* =====================================================
   UTILITIES
   ===================================================== */
.muted {
  color: var(--text-hint);
  font-size: 14px;
}
