@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@200;300;400;500;600;700&display=swap');

:root{
    --blue:#0078AD;
    --black:#000000;
    --white:#ffffff;
    --light-color:#131313;
    --box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1);
}


*{
    font-family: 'roboto', sans-serif;
    margin: 0;
    padding: 0;
    font-weight:bolder;
    box-sizing: border-box;
    text-decoration: none;
    outline: none;
    border: none;
    text-transform: capitalize;
    transition: all .2s linear;
}
body{
    background-color:var(--black);
}

html{
    font-size: 65%;
    overflow-x: hidden;
    scroll-padding-top:5.5rem;
}

section{
    padding: 2rem 9%;
}









/* Full screen splash */
.loading-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;

  background: linear-gradient(to bottom, #0078AD 0%, #043146 60%, #000 100%);
  z-index: 9999;

  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease;
}

/* Center logo PERFECTLY */
.loading-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 220px;
  animation: logoFade 2.5s ease-in-out forwards;
}

/* Spinner bottom center */
.loading-spinner {
  position: absolute;
  left: 50%;
  bottom: env(safe-area-inset-bottom, 40px);
  transform: translateX(-50%);

  width: 28px;
  height: 28px;
  bottom: 28px;

  border: 4px solid #fff;
  border-top: 4px solid #0078AD;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Animations */
@keyframes spin {
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

@keyframes logoFade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Mobile */
@media (max-width: 480px) {
  .loading-logo {
    width: 160px;
  }
}












/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

/* Navbar visible under header */
.top-navbar {
    position: fixed;
    top: 55px;
    left: 0;
    width: 100%;
    background: var(--light-color);
    z-index: 1001;
}

/* Icons */
.icons {
    position: absolute;
}

.icons.left { left: 15px; }
.icons.right { right: 15px; }

header .icons i,
header .icons a{
    cursor: pointer;
    font-size: 1.7rem;
    color: #fff;
}

header .icons #menu-bars{
    display: left;
    margin-left: 0px;
}


.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 58px; /* increased height */
  background: var(--light-color);
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  box-shadow: 0 -3px 15px rgba(0,0,0,0.6);
  z-index: 999;
}

.nav-item {
  flex: 1;
  text-align: center;
  color: #aaa;
  padding-bottom: 10px;
  font-size: 11px;
}

.nav-item span {
  display: block;
  font-size: 22px;
}

.nav-item.active {
  color: var(--blue);
}

.center-logo {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.6px;
}

.center-logo img {
  width: 40px;
  height: 40px;
}


header .logo img {
    height: 40px;
    display: block;
}







#scanOverlay {
  position: fixed;
  inset: 0;
  background: black;
  z-index: 99999;
}

/* CAMERA CONTAINER */
#scanner {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

/* FORCE VIDEO TO SHOW */
#scanner video,
#scanner canvas {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* UI ABOVE CAMERA */
.scan-frame,
.scan-top,
.scan-text {
  position: relative;
  z-index: 10;
}










/* PAGE SYSTEM */
.page {
  display: none;
  padding: 80px 15px 80px;
  color: #fff;
}

.active-page {
  display: block;
}

/* HOME CENTER */
.home-logo {
  height: calc(100vh - 120px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-logo img {
  width: 120px;
  opacity: 0.9;
}

/* ================= HOME PAGE ================= */
#homeSearch {
    width: 100%;
    font-size: 10px;
    padding: 10px;
    background: #1c1c1c;
    color: #fff;
    border-radius: 8px;
    border: 2px solid #0078AD;
    margin-bottom: 10px;
}

/* ITEMS GRID */
#homeItems {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

#homeItems div {
    background: #0078AD;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #fff;
}

#homeItems div:active {
    background: var(--light-color);
}

/* CART */
#homeCart {
    margin-top: 10px;
    background: #131313;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    margin-bottom: -5px;
}

#homeCart div {
    display: flex;
    justify-content: space-between;
    background-color: #131313;
    padding: 0px 10;
    font-size: 13px;
    border-bottom: 2px dashed #0078AD;
}

/* GO TO PAYMENT */

.payment-box {
  width: 100%;
  background: #000;
  margin-top: 10px;
  border-radius: 10px;
}

.payment-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 5px;
  background: #000;
  color: #fff;
  border: 1px solid #0078AD;
  border-radius: 6px;
}


/* ================= INVENTORY ================= */
.inventory-form {
    background: #131313;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid #0078AD;
}

.inventory-form input {
    width: 100%;
    padding: 10px;
    font-size: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: #000;
    color: #fff;
    border: 1px solid #fff;
}

.inventory-form button {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    background: #131313;
    border-radius: 6px;
    font-size: 1px;
}

/* inventory list scroll */
#inventoryList {
  max-height: calc(100vh - 170px);
  overflow-y: auto;
}

/* inventory row */
.inventory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #131313;
  border: 2px solid #0078AD;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 8px;
}

/* left info */
.inv-info {
  display: flex;
  flex-direction: column;
}

.inv-info strong {
  font-size: 12px;
  color: #fff;
}

.inv-info small {
  font-size: 10px;
  padding-top: 10px;
  color: #aaa;
}

/* right icon actions */
.inv-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.inv-actions i {
  font-size: 14px;
  color: #ccc;
  cursor: pointer;
}

.inv-actions i:hover {
  color: var(--blue);
}





/* ================= PAYMENT ================= */
#paymentSummary {
    background: #0078AD;
    padding: 0px;
    border-radius: 10px;
    margin-top: 15px;
}



/* PAYMENT BUTTONS */
.page button {
    width: 100%;
    padding: 14px;
    margin-bottom: 10px;
    font-size: 14px;
    border-radius: 10px;
    background: #222;
    color: #fff;
}

.page button:active {
    background: var(--blue);
}

/* ================= INPUT / BUTTON UX ================= */
button {
    cursor: pointer;
}

input:focus {
    border-color: var(--blue);
}


/* CART DELETE */
.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;   /* 🔥 KEY FIX */
  padding: 8px 10px;
  background: #111;
  margin-left: -5px;
  margin-bottom: 6px;
  border-radius: 6px;
  gap: 10px;
}


.cart-row i {
  color: #ff5555;
  cursor: pointer;
}

.cart-row span:first-child {
  flex: 1;                 /* item name takes left space */
  text-align: left;
}

.cart-row span:nth-child(2) {
  min-width: 80px;         /* price fixed width */
  text-align: right;      /* price aligned properly */
  font-weight: bold;
}

.cart-row i {
  color: #ff5555;
  cursor: pointer;
  margin-left: 8px;
}

/* TOTAL ROW STYLE */
.cart-row:last-child,
#homeCart strong {
  display: flex;                 /* 🔥 key */
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: bolder;
  color: green;
  padding-left: 5px;
  padding-right: 5px;
}


/* DUE LIST */

#dueSearch {
  width: 100%;
  margin-bottom: 15px;
  padding: 10px;
  font-size: 10px;
  background: #111;
  color: #fff;
  border: 2px solid #0078AD;
  border-radius: 8px;
}

.due-row {
  background: #131313;
  padding: 15px;
  row-gap: 100px;
  border: 2px solid #0078AD;
  margin-bottom: 20px;
  border-radius: 8px;
}

.due-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
}

.due-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.due-name {
  font-weight: bold;
  font-size: 15px;
}

.due-phone {
  font-size: 10px;
}

.due-date {
  font-size: 10px;
  color: #666;
}

.due-right {
  text-align: right;
}

.due-amount {
  font-size: 18px;
  font-weight: bold;
  color: #e53935;
}

.due-icons {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.icon {
  cursor: pointer;
  font-size: 18px;
}

.settle-icon {
  color: green;
}

.reminder-icon {
  color: orange;
}



/*--MORE-- */

.more-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.more-header h2 {
  margin: 0;
  color: #fff;
}

#monthSelect {
  padding: 3px;
  font-size: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.more-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 🔥 force equal boxes */
  gap: 10px;
}

.more-card {
  background: #0078AD;
  color: #fff;
  padding: 12px;
  border-radius: 10px;
}

.more-card small {
  opacity: 0.8;
}

.more-card h3 {
  margin: 5px 0 0;
  font-size: 20px;
}

/*--SCAN-- */

.scan-input {
  position: relative;
}

.scan-input input {
  width: 100%;
  padding-right: 35px;
}

.scan-icon {
  position: absolute;
  right: 10px;
  top: 40%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #0078AD;
  cursor: pointer;
}


#scanOverlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: none;
}

#scanVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Top icons */
.scan-top {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  gap: 10px;
}

/* Scan frame */
.scan-frame {
  position: absolute;
  top: 20%;
  left: 5%;
  width: 90%;
  height: 180px;
  border-radius: 8px;
}

.corner {
  position: absolute;
  width: 25px;
  height: 25px;
  border: 3px solid #fff;
}

.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* Red scan line */
.scan-line {
  position: absolute;
  top: 50%;
  left: 10px;
  right: 10px;
  height: 2px;
  background: red;
  animation: scanMove 2s infinite ease-in-out;
}

@keyframes scanMove {
  0% { top: 10%; }
  50% { top: 90%; }
  100% { top: 10%; }
}

/* Bottom text */
.scan-text {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  color: white;
  font-size: 14px;
}
