/* Import font */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

/* Variables */
:root {
  /* Brand Colors */
  --primary-red: #a32e29;
  /* Deep Red - Must Stay */
  --vibrant-red: #bc2727f6;
  /* Vibrant Red - Secondary/Hover */
  --accent-yellow: #ffff00;
  /* Accent Yellow */

  /* Functional Colors */
  --bg-color: #eeeeee;
  --card-bg: #ffffff;
  --text-color: #333333;
  --text-muted: #666666;
  --border-color: #e0e0e0;

  /* Spacing & Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  --header-height: 80px;
}

/* Body */
body {
  font-family: 'Open Sans', 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.4;
}

/* Container */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

#preloader.active {
  opacity: 1;
  visibility: visible;
}

#loader {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 8px solid var(--vibrant-red);
  border-top-color: var(--bg-color);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 0.8s ease infinite;
  margin: -30px 0 0 -30px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* Header */
.top-bar {
  position: fixed;
  background-color: var(--card-bg);
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  box-sizing: border-box;
  box-shadow: var(--shadow-md);
  z-index: 100;
}

/* Logotype */
.logo img {
  height: 60px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.search {
  flex-grow: 1;
  max-width: 600px;
  margin: 0 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.search form {
  display: flex;
  width: 100%;
}

.search input {
  flex-grow: 1;
  border: 1px solid var(--border-color);
  height: 40px;
  padding: 0 15px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
  box-shadow: none !important;
  font-size: 16px;
  margin: 0 !important;
  width: auto !important;
  max-width: none !important;
}

.search input:focus {
  outline: none;
  border-color: var(--primary-red);
}

.search button {
  border: none;
  height: 42px;
  /* Match input height including borders */
  width: 50px;
  background-color: var(--primary-red);
  color: var(--accent-yellow);
  margin: 0 !important;
  padding: 0;
  cursor: pointer;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: background-color 0.2s;
  font-size: 16px;
}

.search button:hover {
  background-color: var(--vibrant-red);
}

/* Logout button */
.logout-btn {
  margin-right: 0;
}

.logout-btn a {
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  font-weight: 600;
  transition: color 0.2s;
}

.logout-btn a:hover {
  color: var(--primary-red);
}

/* Menu button */
.menu-btn {
  width: 50px;
  height: 50px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-color);
  font-size: 20px;
}

/* Side menu */
.side-menu {
  z-index: 90;
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 250px;
  height: calc(100vh - var(--header-height));
  background-color: #2c2c2c;
  /* Slightly softer than pure black */
  transform: translateX(0);
  transition: transform 0.3s ease-in-out;
  overflow-y: auto;
}

/* Side menu items */
.side-menu ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.side-menu li {
  padding: 15px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 15px;
}

/* Side menu icons */
.side-menu li i {
  width: 25px;
  margin-right: 10px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

/* Hover effect */
.side-menu li:hover {
  background-color: var(--primary-red);
}

.side-menu li:hover i {
  color: var(--accent-yellow);
}

.side-menu .budget {
  font-size: 14px;
  color: #ccc;
  padding: 20px 25px;
  line-height: 1.5;
  background-color: rgba(0, 0, 0, 0.2);
  margin: 0;
}

.dashboard-menu {
  overflow: hidden;
  height: calc(100vh - 20px);
}

/* Main content */
.main-content {
  margin-top: var(--header-height);
  padding: 30px;
  padding-bottom: 0px;
  margin-left: 260px;
  overflow-y: auto;
  height: calc(100vh - var(--header-height) - 45px);
  background-color: var(--bg-color);
}

/* Home page */
.home-page {
  text-align: left;
  height: 100%;
}

.home-page h2 {
  color: var(--primary-red);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 30px;
  margin-top: 0;
}

/* Media queries */
@media (max-width: 992px) {
  #detailedswitch {
    display: none;
  }

  .menu-btn {
    display: flex;
  }

  .side-menu {
    transform: translateX(-260px);
  }

  .side-menu.open {
    transform: translateX(0);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  }

  .main-content {
    margin-left: 0;
    padding: 15px;
  }

  .search {
    margin: 0 15px;
  }
}

@media only screen and (max-width: 600px) {
  .logo img {
    height: 40px;
    width: auto;
  }

  .top-bar {
    padding: 0 10px;
    height: 60px;
  }

  .side-menu {
    top: 60px;
    height: calc(100vh - 60px);
  }

  .main-content {
    margin-top: 60px;
    height: calc(100vh - 60px);
  }

  .search {
    display: none;
  }

  th,
  td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  tr {
    border-bottom: 2px solid var(--border-color);
    display: block;
    margin-bottom: 10px;
  }

  .articlepost {
    width: 100% !important;
    margin-right: 0 !important;
  }

  .product-page {
    display: block;
  }

  .product-pic,
  .product-title,
  .product-desc {
    grid-column: auto !important;
    grid-row: auto !important;
    width: auto !important;
    margin: 10px 0 !important;
  }

  .cartinhoud {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cartinhoud .foto {
    max-width: 100% !important;
    margin-bottom: 15px;
  }

  .cartinhoud>div {
    grid-column: auto !important;
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--card-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: #eee;
  color: var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: #fafafa;
}

/* Buttons */
.new-btn,
.std-btn,
.btn {
  background-color: var(--primary-red) !important;
  color: #fff !important;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.new-btn:hover,
.std-btn:hover,
.btn:hover {
  background-color: var(--vibrant-red) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.new-btn {
  float: right;
  margin: 10px 0;
}

/* Inputs */
input,
textarea,
select {
  display: inline-block;
  width: 100%;
  max-width: 400px;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #fff;
  margin-bottom: 15px;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s;
  box-shadow: none !important;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-red);
}

label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
  display: block;
  margin-bottom: 5px;
}

label i {
  font-size: 12px;
  color: var(--text-muted);
  font-style: normal;
}

/* Timeline */
.timeline ul {
  margin-top: 2rem;
  position: relative;
  padding: 0;
}

.timeline li {
  list-style: none;
  padding: 0 0 2rem 2rem;
  border-left: 2px solid var(--border-color);
  position: relative;
  margin-left: 10px;
}

.timeline li:before {
  content: '';
  width: 14px;
  height: 14px;
  background: var(--primary-red);
  border-radius: 50%;
  position: absolute;
  left: -8px;
  top: 0;
  box-shadow: 0 0 0 3px rgba(163, 46, 41, 0.2);
}

.timeline p {
  margin-top: 0;
  color: var(--text-muted);
}

/* Article Post (Product Card) */
.articlepost {
  display: inline-block;
  vertical-align: top;
  margin: 0 15px 20px 0;
  width: calc(25% - 25px);
  /* 4 per row approximately */
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 15px;
  box-sizing: border-box;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  height: auto;
  min-height: 380px;
  position: relative;
  padding-bottom: 60px;
  line-height: 1;
  /* Space for button */
}

.articlepost:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.articlepost img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.articlepost .description {
  font-size: 18px;
  font-weight: 600;
  height: 60px;
  overflow: hidden;
  margin: 10px 0;
  padding:0px;
  line-height: 1;
  color: var(--text-color);
}

.articlepost .articlecode {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 5px;
  height: 14px;
}

.articlepost .price {
  font-weight: 700;
  font-size: 18px;
  color: var(--primary-red);
  margin: 5px 0;
  height: 20px;
}

.articlepost .btn {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  width: auto;
  margin: 0;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

/* Product Page Details */
.product-page {
  display: grid;
  grid-template-columns: 35% 1fr 250px;
  gap: 20px;
}

.product-pic,
.product-title,
.product-desc {
  background-color: var(--card-bg);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 0;
  grid-row: auto;
  grid-column: auto;
}

.product-pic {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.product-title {
  grid-column: 2 / span 2;
  grid-row: 1;
}

.product-desc {
  grid-column: 2 / span 2;
  grid-row: 2;
}

.productpicture img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  margin: 0 auto 20px;
}

.thumbnails {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.thumbnail {
  width: 60px;
  height: 60px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 2px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.thumbnail.active {
  border-color: var(--primary-red);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Cart */
.cartinhoud {
  display: grid;
  grid-template-columns: 120px 1fr 150px 150px;
  gap: 20px;
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 15px;
  margin-bottom: 15px;
  align-items: center;
}

.cartinhoud .foto img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.cartinhoud .description {
  font-size: 18px;
  font-weight: 600;
}

.cartinhoud .aantal,
.cartinhoud .knoppen {
  display: flex;
  justify-content: center;
}

/* Tips Box */
.tips {
  margin: 20px auto !important;
  width: 90% !important;
  background-color: var(--card-bg) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
}

.tips button {
  margin-top: 10px;
}