/* ================================
   Root Theme Variables
   ================================ */
:root {
  /* Light Theme Colors */
  --bg-color: #f1f3f6; /* light grey background */
  --bg-color-hover: #e4e6eb;
  --text-color: #222222;

  /* Brand Colors */
  --primary-color: #003153; /* Prussian Blue */
  --primary-color-hover: #00243d; /* darker Prussian Blue */
  --link-color: #004f80; /* brighter blue for readability */

  /* Buttons & Forms */
  --btn-bg: var(--primary-color);
  --btn-bg-hover: var(--primary-color-hover);

  --form-bg: #ffffff;
  --table-bg: #ffffff;
  --table-header-bg: var(--primary-color);
  --table-header-color: #ffffff;
  --table-row-alt-bg: #f9f9f9;

  /* Bootstrap overrides */
  --bs-primary: var(--primary-color);
  --bs-primary-rgb: 0, 49, 83; /* Prussian Blue RGB */
  --bs-link-color: var(--link-color);
  --bs-link-hover-color: #00243d;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* ================================
   Dark Theme Overrides
   ================================ */
body.dark-theme {
  --bg-color: #121212; /* near-black background */
  --bg-color-hover: #1e1e1e;
  --text-color: #e6e6e6;

  --primary-color: #003153; /* Prussian Blue still primary */
  --primary-color-hover: #004f80; /* lighter blue hover */
  --link-color: #4da6ff; /* bright blue for visibility */

  --btn-bg: var(--primary-color);
  --btn-bg-hover: var(--primary-color-hover);

  --form-bg: #1e1e1e;
  --table-bg: #1e1e1e;
  --table-header-bg: var(--primary-color);
  --table-header-color: #ffffff;
  --table-row-alt-bg: #2c2c2c;
  --card-bg: #1e1e1e;
}

/* ================================
   Table Styling
   ================================ */
table.table thead,
table.table thead tr,
table.table thead th {
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.05) !important;
}

.table thead.thead-dark,
.table thead.thead-dark th {
  background-color: var(--primary-color) !important;
  color: #ffffff !important;
}

/* ================================
   Card Headers
   ================================ */
.card-header,
.card .card-header {
  background-color: var(--primary-color) !important;
  color: #fff !important;
}

/* ================================
   Navbar
   ================================ */
.navbar,
.navbar.bg-primary,
.navbar-brand {
  background-color: var(--primary-color) !important;
  color: #fff !important;
}

.navbar .nav-link {
  color: #fff !important;
}

.navbar .nav-link:hover {
  color: #cce4ff !important;
}

/* ================================
   Buttons
   ================================ */
.btn-primary {
  background-color: var(--btn-bg) !important;
  border-color: var(--btn-bg) !important;
}
.btn-primary:hover {
  background-color: var(--btn-bg-hover) !important;
  border-color: var(--btn-bg-hover) !important;
}

/* ================================
   Floating Release Button
   ================================ */
#release-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--primary-color);
  color: white;
  padding: 10px 15px;
  border-radius: 25px;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 14px;
  box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.3s;
  z-index: 1001;
}
#release-button:hover {
  background: var(--primary-color-hover);
}

/* Pulse animation in brand color */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 49, 83, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 49, 83, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 49, 83, 0);
  }
}

/* /////////////////////////////////////////////// */
/* /////////////////////////////////////////////// */
/* /////////////////////////////////////////////// */
/* /////////////////////////////////////////////// */
/* /////////////////////////////////////////////// */

body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
  background-color: #2a2a2a;
  color: #eee;
  border: 1px solid #555;
}

body.dark-theme a {
  color: var(--link-color);
}

body.dark-theme a:hover {
  color: var(--primary-color-hover);
}

body.dark-theme .btn-primary {
  background-color: var(--btn-bg);
  color: white;
}

body.dark-theme .btn-primary:hover {
  background-color: var(--btn-bg-hover);
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--primary-color-hover);
}

h1,
h2,
h3 {
  color: var(--primary-color);
  margin-top: 0;
}

.btn-primary {
  background-color: var(--btn-bg);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--btn-bg-hover);
}

.btn-outline-light {
  border-color: #999999;
  color: #333;
}
.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.3); /* Slightly more opaque */
  color: #000000; /* Dark text on hover */
  border-color: #222222; /* Keep the border white */
}

.btn-outline-secondary {
  color: #444 !important;
  border-color: #444 !important;
}
.btn-outline-secondary:hover {
  background-color: #444 !important;
  color: #fff !important;
}

form {
  background-color: var(--form-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  max-width: 600px;
  color: var(--text-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
input[type="file"],
select {
  width: 100%;
  padding: 10px;
  margin: 8px 0 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 16px;
  background-color: #fff;
  color: #000;
}

textarea {
  resize: vertical;
}

/* button {
  font-family: inherit;
} */

img {
  max-height: 180px;
  object-fit: contain;
  background: #bdbbbb;
  border-radius: 0.5rem 0.5rem 0 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--table-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 20px;
  color: var(--text-color);
}

table th,
table td {
  padding: 12px 16px;
  text-align: left;
}

table th {
  background-color: var(--table-header-bg);
  color: var(--table-header-color);
}

table tr:nth-child(even) {
  background-color: var(--table-row-alt-bg);
}

.table thead.custom-primary {
  background-color: #007bff !important; /* uses your Bootstrap primary variable */
  color: #fff !important; /* white text for contrast */
}

.product-card {
  background-color: var(--card-bg);
  color: var(--text-color);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 200px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  object-fit: contain;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-card img {
  max-width: 100%;
  height: auto;
  margin-bottom: 10px;
  border-radius: 5px;
}

.product-info {
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-info h5 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.product-info p {
  font-weight: bold;
  margin-bottom: 1rem;
}

.card {
  background-color: var(--card-bg);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
}

.product-image {
  max-height: 180px;
  object-fit: contain;
  width: 100%;
  padding: 10px;
  background-color: #fff;
}

.add-product-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.add-product-form input,
.add-product-form button {
  height: 38px;
  font-size: 14px;
  padding: 5px 10px;
}

.add-product-form input[type="text"],
.add-product-form input[type="number"] {
  width: 200px;
}

.add-product-form button {
  white-space: nowrap;
}

.card-body {
  background-color: var(--card-bg);
  color: #222222;
}

body.dark-theme .card-body {
  color: #e6e6e6;
}

.text-secondary {
  color: var(--text-color);
}

.product-text {
  color: var(--text-color);
}

.product-text h3 {
  font-size: calc(1rem + 0.3vw);
}

.order-card {
  background-color: var(--card-bg);
  border: 1px solid #2c2c2c;
  border-radius: 1rem;
  transition: background-color 0.3s ease;
}
.order-card:hover {
  background-color: var(--bg-color-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.card-title small {
  color: var(--primary-color);
}

.status-badge {
  font-size: 0.8rem;
  padding: 0.4em 0.6em;
  border-radius: 0.5rem;
}

.status-Pending {
  background-color: #ffc107;
  color: #000;
}

.status-Paid {
  background-color: #198754;
}

.status-Shipped {
  background-color: #0dcaf0;
  color: #000;
}

.status-Cancelled {
  background-color: #dc3545;
}

.cart-card {
  background-color: var(--form-bg);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}
.cart-card:hover {
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.form-control,
.btn-primary {
  font-size: 1rem;
}

.site-footer {
  border-top: 1px solid #ccc;
  padding: 30px 20px;
  text-align: center;
  margin-top: 40px;
}

/* small safety: table cells text color if needed */
.table thead th,
.table thead td {
  color: #fff !important;
}

/* Force header text & links to white */
table.table thead th,
table.table thead th a,
.card-header,
.card-header a,
.navbar,
.navbar a,
.navbar .nav-link {
  color: #fff !important;
}

table.table thead th a:hover,
.card-header a:hover,
.navbar .nav-link:hover {
  color: #cce4ff !important; /* optional: lighter on hover */
}

.dropdown-menu {
  background-color: #fff !important; /* White background */
  color: #212529 !important; /* Bootstrap's default dark text */
}

.dropdown-menu a.dropdown-item {
  color: #212529 !important;
}

.dropdown-menu a.dropdown-item:hover,
.dropdown-menu a.dropdown-item:focus {
  background-color: #0d6efd !important; /* Bootstrap primary blue */
  color: white !important;
}

/* Table border and cell borders */
.table-bordered {
  border: 1px solid #dee2e6; /* Light grey border around the table */
}

.table-bordered th,
.table-bordered td {
  border: 1px solid #dee2e6; /* Borders around each cell */
}

/* Override Bootstrap's striped background to ensure better contrast */
.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #f8f9fa; /* Light grey for odd rows */
}

.table-striped > tbody > tr:nth-of-type(even) {
  background-color: #e9ecef; /* Slightly darker grey for even rows */
}

.thankyou-container {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.thankyou-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.3);
}

.product-image-container {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg);
  padding: 10px;
}

.product-image-container img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.quantity-group input[type="number"]::-webkit-outer-spin-button,
.quantity-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.quantity-group input[type="number"] {
  -moz-appearance: textfield;
}

.stock-message {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.stock-message.hide {
  opacity: 0;
}

.bg-primary,
header.bg-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

header {
  background-color: var(--primary-color) !important;
}

/* NEW Badge for Floating Button */
#new-badge {
  background: red;
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  margin-left: 8px;
  border-radius: 12px;
  vertical-align: middle;
}

/* Pulse animation for Floating Button */
.pulse {
  animation: pulse 1.5s infinite;
}

/* Changelog page styles */
.changelog-container {
  max-width: 800px;
  margin: 50px auto;
  font-family: Arial, sans-serif;
}

.release {
  border-bottom: 1px solid #ccc;
  padding: 15px 0;
}

.release h3 {
  margin: 0 0 5px;
  color: var(--primary-color);
}

.release ul {
  margin: 5px 0 0 20px;
}

.release-meta {
  font-size: 12px;
  color: #555;
}

/* NEW Badge on each release */
.release-new-badge {
  background: var(--primary-color);
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  margin-left: 8px;
  border-radius: 12px;
  vertical-align: middle;
  display: none; /* default hidden */
}

/* Highlight unseen releases */
.unseen {
  border-left: 5px solid var(--primary-color);
  background-color: var(
    --bg-color-hover
  ); /* use hover grey instead of greenish bg */
  padding-left: 10px;
}

/* Dark theme: only for the product details cart form */
body.dark-theme .product-add-to-cart-form {
  border-color: #888; /* lighter grey for visibility in dark mode */
}
