/* =========================================
   Sidebar Categories
========================================= */

.category-sidebar {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 20px;
  min-height: 980px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

}

/* Custom Scrollbar */

.category-sidebar::-webkit-scrollbar {
  width: 8px;
}

.category-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

.category-sidebar::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 5px;
}

.category-sidebar::-webkit-scrollbar-thumb:hover {
  background: #888;
}

.category-group {
  margin-bottom: 25px;
}

.category-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2c3e50;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f1f1f1;
}

.subcategories {
  display: flex;
  flex-direction: column;
  
}

.subcategory-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  padding-bottom: 10px;

  border-radius: 0px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  color: #495057;
}

.subcategory-item:hover {
  background-color: #f8f9fa;
  color: #004a8d;
}

.subcategory-item.active {
  background-color: #6eb5f8;
  color: white;
  border-left: 4px solid #0056b3;
  padding-left: 6px;
  padding-right: 8px;
}

.subcategory-item i {
  font-size: 1.1rem;
  min-width: 20px;
}

.category-icon {
  width: 40px;
  height: 30px;
  object-fit: contain;
}

/* Icon States */

.icon-default {
  display: inline-block;
}

.icon-active {
  display: none;
}

.subcategory-item.active .icon-default {
  display: none;
}

.subcategory-item.active .icon-active {
  display: inline-block;
}

/* =========================================
   Image Viewer Section
========================================= */

.image-viewer-section {
  background: white;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.main-image-container {
  position: relative;
  height: 520px;
  background: #111;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mainImage,
.main-image-container img,
.main-image-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.main-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Navigation Buttons */

.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.nav-button:hover {
  background-color: rgba(0, 0, 0, 0.6);
}

.nav-button.prev {
  left: 15px;
}

.nav-button.next {
  right: 15px;
}

/* =========================================
   Image Gallery
========================================= */

.image-gallery {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;

  margin-top: 16px;

  /* Important: space INSIDE the scrolling area */
  padding: 0 4px 10px 4px;
  box-sizing: border-box;

  scroll-behavior: smooth;
  scrollbar-width: none;
}

.image-gallery::-webkit-scrollbar {
  display: none;
}

.gallery-item {
  position: relative;
  flex: 0 0 80px;
  width: 80px;
  height: 60px;
  border: 2px solid #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item img,
.video-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item:hover {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.gallery-item.active {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Video Items */

.video-item {
  position: relative;
  overflow: hidden;
}

.video-item i {
  font-size: 1.8rem;
  color: #0d6efd;
  -webkit-text-stroke: 1px #ffffff;
  text-shadow:
    0 0 2px rgba(255, 255, 255, 0.8),
    0 0 4px rgba(255, 255, 255, 0.6);
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 34px;
  transition: all 0.25s ease;
}

.video-item:hover .video-play-overlay {
  background: rgba(0, 0, 0, 0.7);
}

/* =========================================
   Machine Navigation
========================================= */

.machine-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 0 8px;
}

.machine-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.machine-nav-btn:hover {
  color: #0d6efd;
}

/* =========================================
   Machine Details
========================================= */

.machine-details {
  background: white;
  border-radius: 4px;
  padding: 25px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.machine-details h3 {
  color: #2c3e50;
  font-size: 1.3rem;
  line-height: 1.4;
}

.machine-details p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* =========================================
   Applications List
========================================= */

.specs-badge {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
}

.specs-badge::before {
  content: "Applications:";
  margin-bottom: 3px;
  color: #2c3e50;
  font-size: 0.9rem;
  font-weight: 700;
}

.specs-badge .badge {
  display: block;
  padding: 0 !important;
  margin: 0 !important;

  background: none !important;
  background-color: transparent !important;

  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  color: #495057 !important;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
}

.specs-badge .badge::before {
  content: "•";
  display: inline-block;
  margin-right: 8px;
  color: #495057;
}
/* Buttons */

.btn-primary {
  background-color: #0056b3;
  border-color: #0056b3;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: #004085;
  border-color: #004085;
}

/* =========================================
   Configuration Cards
========================================= */

.configuration-card {
  position: relative;
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  height: 100%;
}

.configuration-card:hover {
  border-color: #1083ff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
  transform: translateY(-2px);
}

.configuration-card.viewing {
  border: 2px solid #1083ff;
  background-color: #f0f7ff;
}

.configuration-card.viewing .config-image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 3px;
  pointer-events: none;
}

.config-image-wrapper {
  position: relative;
  width: 100%;
  height: 80px;
  background-color: #f8f9fa;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.config-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewing-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;

  padding: 5px 12px;
  border-radius: 4px;

  background-color: rgba(13, 110, 253, 0.9);
  color: white;

  border: 2px solid rgba(255, 255, 255, 0.85);

  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2px;

  backdrop-filter: blur(2px);
}

.config-name {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: #2c3e50;
}

.config-count {
  position: relative;
  top: 4px;

  margin-left: 4px;

  color: #7a869a;
  font-size: 1rem;
  font-weight: 500;
  vertical-align: baseline;
}

/* =========================================
   Configurations Container
========================================= */

#configurationsContainer {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;

  width: 100%;

  overflow-x: auto;
  overflow-y: hidden;

  padding-bottom: 10px;

  scroll-behavior: smooth;
  scrollbar-width: none;
}

#configurationsContainer::-webkit-scrollbar {
  display: none;
}

.config-item {
  flex: 0 0 auto;
  width: 200px;
}

/* =========================================
   Responsive
========================================= */

@media (max-width: 991px) {
  .category-sidebar {
    max-height: 400px;
  }

  .main-image-container {
    height: 280px;
  }
}