/* ============================================================
   mobile.css — UX mobil pentru Inspectie AFC
   Brand: #367DA2
   Aplica peste CSS-ul existent (inline + style.css)
   ============================================================ */

:root {
  --afc-primary: #367DA2;
}

/* ── Buton hamburger (afisat doar pe mobile) ──────────────── */
.mobile-hamburger {
  display: none;
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1100;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--afc-primary);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  align-items: center;
  justify-content: center;
}
.mobile-hamburger:active { transform: scale(0.96); }

/* ── Overlay pentru sidebar mobile ────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.show { opacity: 1; }

/* ============================================================
   < 900px : layout mobile/tableta (sidebar slide-in + hamburger)
   ============================================================ */
@media (max-width: 899.98px) {

  /* Hamburger devine vizibil */
  .mobile-hamburger {
    display: flex;
  }

  /* Sidebar ascuns by default, slide-in din stanga */
  #sb {
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    width: 260px !important;
    will-change: transform;
  }
  #sb.open {
    transform: translateX(0);
    box-shadow: 0 0 24px rgba(0, 0, 0, .35);
  }

  /* Overlay vizibil cand sidebar e deschis */
  .sidebar-overlay.show {
    display: block;
  }

  /* Main content ocupa toata latimea pe mobil */
  .main {
    margin-left: 0 !important;
  }

  /* Topbar are spatiu pentru hamburger */
  .topbar {
    padding-left: 60px !important;
  }

  /* Content padding mai mic */
  .content {
    padding: 12px !important;
  }

  /* ── Touch-friendly buttons ────────────────────────────── */
  .btn-primary,
  .btn-success,
  .btn-danger,
  .btn-p,
  .btn-s {
    min-height: 48px;
  }

  /* Spatiu intre butoane in liste */
  .btn-group-vertical .btn,
  .actions-list .btn,
  .hdr-actions > * {
    margin-bottom: 12px;
  }

  /* Inputs >= 44px si fara zoom iOS (font 16px) */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  select,
  textarea,
  .form-control {
    min-height: 44px;
    font-size: 16px !important;
  }
  textarea.form-control {
    min-height: 88px;
  }

  /* Tabele scrollabile pe mobil */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Aplica safe-area-inset si full-width pe bara existenta de finalizare inspectie */
  .finalizeaza-wrap {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    background: #fff !important;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, .08);
    z-index: 90;
    margin: 0 !important;
  }
  .finalizeaza-wrap .btn-finalizeaza {
    width: 100%;
    min-height: 52px;
    font-size: 15px;
  }
  /* Spatiu jos pe pagina inspectie ca sa nu fie ascuns continutul */
  body.has-finalizeaza-wrap {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Bottom action bar generic ─────────────────────────── */
  .mobile-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, .08);
    display: flex;
    gap: 8px;
  }
  .mobile-action-bar .btn {
    flex: 1;
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
  }

  /* Spatiu jos pentru continut, sa nu fie ascuns de bara */
  body.has-mobile-action-bar {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* Pe desktop, mobile-action-bar afiseaza inline (NU fixed) */
@media (min-width: 900px) {
  .mobile-action-bar {
    position: static;
    border-top: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
  }
}

/* ── Photo compression progress overlay ───────────────────── */
.photo-compress-progress {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(54, 125, 162, .96);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 2000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  pointer-events: none;
}
