/* Top Bar Styles */
.top-bar {
  background-color: #ffffff;
  padding: 24px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 2px solid #bae6fd;
}

.top-bar .brand {
  font-weight: 950;
  color: #0f766e;
  font-size: 1.6rem;
  letter-spacing: 1px;
}

.top-status {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f0f9ff;
  padding: 8px 15px;
  border-radius: 8px;
  border: 2px solid #0ea5e9;
  cursor: pointer;
  min-width: 100px;
}

.status-label {
  font-weight: 800;
  color: #0369a1;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.status-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: white;
  border: 2px solid #0ea5e9;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  z-index: 2000;
  flex-direction: column;
  gap: 12px;
}

.status-dropdown.show {
  display: flex;
}

.status-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 5px;
}

.btn-change {
  background: #0ea5e9;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  font-weight: bold;
}

.btn-clear {
  background: #dc2626;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  font-weight: bold;
}

.status-image-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.image-slot {
  width: 100px;
  height: 100px;
  border: 2px dashed #bae6fd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}

.image-slot:hover {
  border-color: #0ea5e9;
  background-color: #f0f9ff;
}

.status-preview {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.plus-icon {
  font-size: 2rem;
  color: #0ea5e9;
  font-weight: bold;
}

/* Image Viewer Modal */
.image-viewer-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  animation: zoomIn 0.3s ease;
}

.viewer-content {
  max-width: 90%;
  max-height: 85%;
  border: 5px solid white;
  border-radius: 10px;
}

.viewer-close {
  position: absolute;
  top: 25px;
  right: 40px;
  color: white;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
}

.top-nav {
  display: flex;
  gap: 15px;
  flex-wrap: wrap; /* Allow links to wrap on small screens */
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .top-bar {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  .top-nav {
    justify-content: center;
  }
}

.top-nav a {
  text-decoration: none;
  color: #475569;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.top-nav a:hover {
  color: #0f766e;
}

/* Style for active navigation link */
.top-nav a.active {
  color: #0ea5e9; /* A distinct color for active link */
  border-bottom: 2px solid #0ea5e9; /* Optional: add an underline */
  padding-bottom: 3px; /* Adjust padding for underline */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #e0f7fa, #fff7ed);
  scroll-behavior: smooth; /* Enable smooth scrolling */
  color: #102a43;
}

/* Centering page content: width + margin auto */
#container {
  width: 86%;
  max-width: 1100px;
  min-width: 320px;
  margin: 0 auto;
  padding: 24px;
}

/* Hero demonstrates height, vh, background image, background-size, background-position, text-shadow, border-radius, padding */
.hero {
  min-height: 100vh;
  background-image: linear-gradient(rgba(0, 44, 70, 0.25), rgba(0, 44, 70, 0.65)), url("ism.jpeg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  margin: 0;
  width: 100%;
}

.hero-overlay {
  padding: 3em;
  max-width: 780px;
}

.small-title {
  color: #fbbf24;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 2em;
  margin: 0;
  color: white;
  text-shadow: 4px 4px 8px #000000;
}

.subtitle {
  font-size: 1.2em;
  color: #f8fafc;
  max-width: 700px;
}

.button {
  display: inline-block;
  background-color: #72507f;
  color: rgba(240, 237, 237, 0.943);
  padding: 14px 24px;
  border-radius: 30px;
  text-decoration: none;
  border: 2px solid white;
  box-shadow: 3px 4px 8px rgba(0, 0, 0, 0.25);
}

.button:hover {
  opacity: 0.85;
}

.section {
  margin: 30px 0;
}

.card {
  background-color: white;
  padding: 28px;
  border: 2px solid #bae6fd;
  border-radius: 20px;
  box-shadow: 6px 6px 15px rgba(15, 23, 42, 0.12);
}

h2 {
  color: #0f766e;
  border-left: 8px solid #f97316;
  padding-left: 14px;
  margin-top: 0;
}

.intro {
  font-size: 1.05em;
  line-height: 2;
}

/* CSS units demo */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.unit-box {
  background-color: #ecfeff;
  border: 3px solid #0891b2;
  border-radius: 16px;
  padding: 1em;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.15);
}

.unit-number {
  display: block;
  font-size: 1.8em;
  font-weight: 900;
  color: #0f622f;
  margin: 8px 0;
}

.type-in {
  color: #166534;
  font-weight: bold;
}

.type-out {
  color: #dc2626;
  font-weight: bold;
}

.text-danger {
  color: #dc2626;
}

/* Transaction Table Styles */
.transaction-container {
  overflow-x: auto;
  margin-top: 15px;
}

.transaction-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}

.transaction-table th, 
.transaction-table td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.transaction-table th {
  background-color: #f8fafc;
  color: #0f766e;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 0.5px;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: bold;
}

.status-badge.success {
  background-color: #dcfce7;
  color: #166534;
}

/* Chat-like Material Movement */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 600px; /* Limit width for chat-like appearance */
  margin: 20px auto; /* Center the chat container */
  padding: 15px;
  background-color: #f0f2f5; /* Light background for chat area */
  border-radius: 15px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.chat-message {
  display: flex;
  align-items: flex-end;
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 20px;
  position: relative;
  font-size: 0.95em;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message .message-content {
  flex-grow: 1;
}

.chat-message .message-item {
  margin: 0;
  font-weight: bold;
  color: #333;
}

.chat-message .message-price {
  margin: 5px 0 0;
  font-size: 0.85em;
  color: #666;
}

.chat-message .message-time {
  font-size: 0.75em;
  color: #999;
  margin-left: 10px;
  white-space: nowrap; /* Prevent time from wrapping */
}

.message-in {
  background-color: #e2f7cb; /* Light green for 'in' */
  align-self: flex-start;
  border-bottom-left-radius: 5px; /* Pointy corner */
}

.message-out {
  background-color: #ffe0e0; /* Light red for 'out' */
  align-self: flex-end;
  border-bottom-right-radius: 5px; /* Pointy corner */
}

/* Inventory Entry Forms */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

.stock-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 15px;
}

.stock-form input,
.stock-form select {
  padding: 12px;
  border: 2px solid #bae6fd;
  border-radius: 10px;
  font-size: 1rem;
  background-color: white;
}

.stock-form input[type="file"] {
  border: none;
  padding: 10px 0;
}

.stock-form input:focus,
.stock-form select:focus {
  outline: none;
  border-color: #0891b2;
  box-shadow: 0 0 5px rgba(8, 145, 178, 0.3);
}

.filter-select {
  padding: 8px 12px;
  border: 2px solid #bae6fd;
  border-radius: 8px;
  background: white;
  color: #0f766e;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.stock-form .button {
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn-out {
  background-color: #dc2626;
}

.btn-new {
  background-color: #0891b2;
}

/* Centering demo */
.center-demo {
  width: 80%;
  margin: 0 auto;
  padding: 25px;
  background-color: #dbeafe;
  border: 3px solid #2563eb;
  border-radius: 15px;
  text-align: center;
}

/* Background image + opacity-like panel */
.background-panel {
  min-height: 280px;
  background-image: linear-gradient(rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.25)), url("sunway.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}

.transparent-message {
  background-color: rgba(255, 255, 255, 0.82);
  padding: 25px;
  border-radius: 18px;
  border: 2px solid white;
  width: 75%;
  margin: 0 auto;
}

/* Opacity property example */
.transparent-message:hover {
  opacity: 0.75;
}

.effects-section {
  background-color: #0f172a;
  color: white;
  padding: 28px;
  border-radius: 20px;
}

.effects-section h2 {
  color: #f8fafc;
  border-left-color: #38bdf8;
}

.effects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.effect-box {
  background-color: #1e293b;
  padding: 24px;
  min-height: 150px;
  border: 2px solid #475569;
}

.rounded-effect {
  border-radius: 30px;
}

.shadow-effect {
  box-shadow: 8px 8px 0 #38bdf8;
}

.text-shadow-effect h3 {
  font-size: 1.8em;
  text-shadow: 3px 3px 5px #f97316;
}

.challenge ol {
  line-height: 1.9;
}

.footer {
  text-align: center;
  padding: 25px;
  color: #475569;
}

code {
  background-color: #e2e8f0;
  padding: 3px 6px;
  border-radius: 5px;
  color: #7c2d12;
}

/* Role Access Grid for Home Page */
.role-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

/* Charts Grid for Analytics */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.chart-item {
  background: #ffffff;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.role-box {
  text-align: center;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.role-box h3 {
  color: #0f766e;
  font-size: 1.5em;
  margin-bottom: 15px;
}

/* Login Page Styles */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: #1e40af;
}

.login-card {
  display: flex;
  background: white;
  width: 90%;
  max-width: 900px;
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-image {
  flex: 1;
  display: none; /* Hidden on mobile */
}

@media (min-width: 768px) {
  .login-image {
    display: block;
  }
}

.login-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-form-container {
  flex: 1;
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-top-bar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #ffffff;
  color: #1e40af;
  padding: 15px 0;
  text-align: center;
  font-weight: 800;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.login-top-bar.hidden {
  top: -70px; /* Adjust this value if the bar's height changes */
  transition: top 0.3s ease-in-out;
}

/* Product catalogue assistance on Inventory page */
.field-label {
  display: block;
  margin: 4px 0 -4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.field-hint {
  display: block;
  margin: -4px 0 4px;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.catalog-status {
  margin-top: -2px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.4;
}

.catalog-status.existing {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.catalog-status.new {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.catalog-status.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.stock-form input[readonly],
.stock-form select:disabled {
  cursor: not-allowed;
  background: #eef2f7;
  color: #475569;
  opacity: 1;
}
