/* --------------------------------------------------
   GLOBAL
-------------------------------------------------- */
body {
  font-family: Segoe UI, sans-serif;
  background: #eef2f7;
  margin: 0;
  user-select: none;
}

/* Smooth animation for all major UI blocks */
.fade-slide {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s ease-in-out;
}
.fade-slide.show {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------
   HEADER
-------------------------------------------------- */
header {
  background: #003b73;
  color: white;
  padding: 1.5rem;
  text-align: center;
  font-size: 1.5rem;
}

/* --------------------------------------------------
   NAV TABS
-------------------------------------------------- */
.tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  background: #dce3ec;
  padding: 0.8rem;
}
.tabs button {
  background: white;
  border: 1px solid #b9c3d0;
  border-radius: 10px;
  padding: 0.9rem 1.4rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.2s;
}
.tabs button:hover {
  background: #f2f4f7;
}
.tabs button.active {
  background: #003b73;
  color: white;
  font-weight: bold;
}
.logout {
  background: #d9534f !important;
  color:white;
}

/* --------------------------------------------------
   LAYOUT
-------------------------------------------------- */
main {
  max-width: 1100px;
  margin: auto;
  padding: 1rem;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  padding: 1.3rem;
  margin-top: 1.3rem;
  animation: fadeIn 0.25s ease;
}

/* --------------------------------------------------
   INPUTS
-------------------------------------------------- */
input[type=text],
input[type=password],
input[type=number] {
  padding: 0.8rem;
  font-size: 1.1rem;
  border-radius: 6px;
  border: 1px solid #bfc7d2;
  width: 100%;
  margin-bottom: 0.75rem;
  transition: 0.2s;
}

input:focus {
  border-color:#003b73;
  box-shadow: 0 0 5px rgba(0,59,115,0.4);
  outline: none;
}

/* --------------------------------------------------
   BUTTONS
-------------------------------------------------- */
.big-btn {
  background: #003b73;
  color: white;
  padding: 1rem;
  font-size: 1.3rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  transition: 0.2s;
}
.big-btn:hover { background: #00529c; }

/* Small buttons */
.btn-small {
  padding: 0.6rem 1rem;
  background: #003b73;
  color: white;
  border:none;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}
.btn-small:hover {
  background: #00529c;
}

/* --------------------------------------------------
   SEARCH TABLE (results list)
-------------------------------------------------- */
#search_table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
}
#search_table thead {
  background: #003b73;
  color: white;
}
#search_table th,
#search_table td {
  padding: 14px;
  font-size: 1.1rem;
}
#search_table tr {
  transition: 0.2s;
}
#search_table tr:hover {
  background: #eef6ff;
  cursor: pointer;
}

/* Row ripple effect */
#search_table tr:active {
  background: #d6e8ff;
}

/* Ensure table doesn't jump */
#search_table,
#no_result_box,
#product_card {
  display: none;
}

/* --------------------------------------------------
   PRODUCT CARD
-------------------------------------------------- */
.product-card,
#product_card {
  display: flex;
  gap: 1.2rem;
  background: white;
  padding: 1.2rem;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  margin-top: 1rem;
  align-items: flex-start;
}

.product-card img,
#product_img {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  background:#eef2f7;
  border:1px solid #d2dae6;
}

/* Upload area */
.product-image-box {
  width: 210px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  text-align: center;
  transition: 0.2s;
}

.product-image-box:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.upload-btn {
  display: block;
  width: 100%;
  background:#0073aa;
  color:#fff;
  border:none;
  padding:10px 0;
  border-radius:6px;
  cursor:pointer;
  margin-top:6px;
  transition: 0.2s;
}
.upload-btn:hover { background:#005f8d; }

/* --------------------------------------------------
   NO RESULT BOX
-------------------------------------------------- */
#no_result_box {
  background:white;
  padding:1.3rem;
  border-radius:12px;
  text-align:center;
  margin-top:10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size:1.2rem;
}

/* --------------------------------------------------
   TOAST MESSAGE (Success popup)
-------------------------------------------------- */
#successPopup {
  position: fixed;
  top: 15px;
  right: 15px;
  background: #28a745;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events:none;
  transition: opacity .5s, transform .5s;
  z-index: 9999;
  font-size: 15px;
  transform: translateY(-10px);
}
#successPopup.show {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------
   ERRORS / STATUS
-------------------------------------------------- */
.error { color: red; font-weight: bold; }
.ok { color: green; font-weight: bold; }

/* --------------------------------------------------
   LOGIN PAGE
-------------------------------------------------- */
.login-body {
  background: #003b73;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
.login-box {
  width: 350px;
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
  text-align: center;
}
.login-box input {
  font-size: 1.3rem;
}
.login-box button {
  padding: 1rem;
  font-size: 1.3rem;
  border-radius: 10px;
}

/* Fade animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
