/* Machine Detail Page Styles */
.machine-detail-page {
  padding: 2rem 0;
}

/* Machine Header */
.machine-header h1 {
  font-size: 3rem !important; /* Force 3rem size */
  font-weight: 700;
  color: var(--brand-dark-red);
}

.machine-category {
  color: #666;
  font-size: 1.1rem;
}

.machine-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-dark-red);
}

/* Media Tabs */
.media-tabs .nav-link {
  color: #495057;
  border-radius: 0;
  padding: 0.75rem 1rem;
  font-weight: 500;
}

.media-tabs .nav-link.active {
  color: var(--brand-dark-red);
  border-bottom: 3px solid var(--brand-dark-red);
}

.media-content {
  min-height: 400px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-top: none;
  padding: 1.5rem;
  border-radius: 0 0 0.25rem 0.25rem;
}

/* Image Gallery */
.product-image-slider {
  height: 400px;
  background-color: #fff;
  border-radius: 0.25rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-slider .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-slider .swiper-slide img {
  max-height: 380px; /* Reduced from 100% to provide some padding */
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Ensure the main image container maintains proper proportions */
.machine-main-image {
  width: 75%;
  display: flex;
  flex-direction: column;
}

/* Styles moved to responsive.css */

.image-controls {
  font-size: 0.875rem;
}

.image-counter {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
}

/* 360 View */
.view360-container, .model3d-container {
  background-color: #fff;
  border-radius: 0.25rem;
  overflow: hidden;
}

.view360-viewer, .model3d-viewer {
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
}

.placeholder-message {
  text-align: center;
  color: #6c757d;
}

/* Video Container */
.video-container {
  background-color: #000;
  border-radius: 0.25rem;
  overflow: hidden;
}

/* Action Buttons */
.btn-datenblatt {
  background-color: var(--brand-dark-red);
  color: white;
}

.btn-datenblatt:hover {
  background-color: var(--brand-red);
  color: white;
}

/* Specs Highlights */
.specs-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.spec-highlight {
  flex: 1 1 calc(25% - 1rem);
  min-width: 150px;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.spec-highlight .spec-icon {
  font-size: 1.5rem;
  color: var(--brand-dark-red);
  margin-bottom: 0.5rem;
}

.spec-highlight .spec-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.spec-highlight .spec-label {
  font-size: 0.875rem;
  color: #6c757d;
}

/* Specs Table */
.specs-table th {
  width: 40%;
  background-color: #f8f9fa;
}

/* Description Section */
.machine-description {
  line-height: 1.5;
  margin-bottom: 2rem;
}

.machine-description h3 {
  color: var(--brand-dark-red);
  margin-top: 0;
  margin-bottom: 1rem;
  line-height: 2.2;
}

.machine-description ul {
  padding-left: 1.5rem;
}

.machine-description img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 0.25rem;
}

.description-content {
  background-color: #ffffff!important;
  border-radius: 0.375rem;
}

/* Highlighted Attributes in Specs Table */
.specs-table-row-highlight {
  background-color: rgba(251, 178, 151, 0.38) !important;
}

/* Clean tab visibility rules */
.force-visible,
.force-visible .nav-tabs,
.force-visible .tab-content,
.force-visible .tab-pane {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

.force-visible .nav-tabs {
  display: flex !important;
}

.force-visible .tab-pane:not(.active) {
  display: none !important;
}

.force-visible .tab-pane.active {
  display: block !important;
}

/* Remove conflicting animation rules */
.tab-documents {
  /* Remove opacity: 0 and transform rules that cause conflicts */
  transition: none;
}

.document-item {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.5s ease-out;
  animation: documentFadeIn 0.6s ease-out forwards;
}

.document-item:nth-child(1) { animation-delay: 0.1s; }
.document-item:nth-child(2) { animation-delay: 0.2s; }
.document-item:nth-child(3) { animation-delay: 0.3s; }
.document-item:nth-child(4) { animation-delay: 0.4s; }
.document-item:nth-child(5) { animation-delay: 0.5s; }
.document-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes documentFadeIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.document-card {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.document-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-dark-red), #ff6b6b);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.document-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  border-color: var(--brand-dark-red);
}

.document-card:hover::before {
  transform: scaleX(1);
}

.document-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.document-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--brand-dark-red), #ff6b6b);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.document-icon i {
  font-size: 1.5rem;
  color: white;
}

.document-card:hover .document-icon {
  transform: scale(1.1) rotate(5deg);
}

.document-info {
  flex: 1;
  min-width: 0;
}

.document-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.document-meta {
  font-size: 0.875rem;
  color: #718096;
  margin: 0;
  font-weight: 500;
}

.document-actions {
  margin-top: auto;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--brand-dark-red), #c53030);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-download::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-download:hover::before {
  left: 100%;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
  text-decoration: none;
  color: white;
}

.btn-download:active {
  transform: translateY(0);
}

.btn-download i {
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

.btn-download span {
  position: relative;
  z-index: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .document-card {
    padding: 1.25rem;
  }
  
  .document-icon {
    width: 40px;
    height: 40px;
  }
  
  .document-icon i {
    font-size: 1.25rem;
  }
  
  .document-title {
    font-size: 1rem;
  }
}

/* Updated document actions layout */
.document-actions {
    margin-top: auto;
}

/* Preview button (main button) */
.btn-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--brand-dark-red), #c53030);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-preview:hover::before {
    left: 100%;
}

.btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    text-decoration: none;
    color: white;
}

.btn-preview:active {
    transform: translateY(0);
}

.btn-preview i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

/* Download icon button (small) */
.btn-download-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-download-icon:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    color: white;
    text-decoration: none;
}

.btn-download-icon i {
    font-size: 0.9rem;
}

/* PDF Preview Modal */
.pdf-preview-modal .modal-dialog {
    max-width: 90vw;
    height: 90vh;
    margin: 2vh auto;
}

.pdf-preview-modal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pdf-preview-modal .modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.pdf-preview-modal .pdf-viewer-container {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-preview-modal .pdf-loading {
    text-align: center;
    color: #6c757d;
}

.pdf-preview-modal .pdf-error {
    text-align: center;
    color: #dc3545;
    padding: 2rem;
}

/* Custom Filename Popover Styling */
.popover.filename-popover {
    max-width: 200px !important;
    border: 2px solid var(--brand-dark-red) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

.popover.filename-popover .popover-body {
    text-align: center !important;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #2d3748 !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
}

.popover.filename-popover .popover-arrow::before {
    border-top-color: var(--brand-dark-red) !important;
}

.popover.filename-popover .popover-arrow::after {
    border-top-color: white !important;
}

/* Related Machines */
.related-machines-title {
  margin-bottom: 1.5rem;
  color: var(--brand-dark-red);
}

.related-machine-card {
  height: 100%;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem; /* Increased border radius for more rounded corners */
  overflow: hidden;
  background-color: white; /* White background for better visibility */
}

.related-machine-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Related Machine Image - Further Increased Height */
.related-machine-image {
  height: 250px; /* Further increased from 200px for better visibility */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 0.5rem 0.5rem 0 0; /* Round top corners to match card */
}

.related-machine-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* Changed from 'cover' to 'contain' for proper aspect ratio handling */
  border-radius: 0.5rem 0.5rem 0 0; /* Round top corners to match card */
}

.related-machine-card:hover .related-machine-image img {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.related-machine-info {
  padding: 1rem;
}

.related-machine-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  /* Removed height, overflow, and line-clamp constraints to show full text */
}

.related-machine-category {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.related-machine-price {
  font-weight: 700;
  color: var(--brand-dark-red);
}

/* Override Bootstrap h-75 class for swiper slides in related machines */
#relatedMachinesSlider .swiper-slide .related-machine-card.h-75 {
  height: 100% !important; /* Override h-75 (75% height) to show full content */
}

/* Share Modal */
.share-modal .modal-header {
  background-color: var(--brand-dark-red);
  color: white;
}

.share-modal .close {
  color: white;
}

.share-option {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.share-option:hover {
  background-color: #f8f9fa;
}

.share-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
}

.share-icon.facebook {
  color: #3b5998;
}

.share-icon.twitter {
  color: #1da1f2;
}

.share-icon.linkedin {
  color: #0077b5;
}

.share-icon.whatsapp {
  color: #25d366;
}

.share-icon.email {
  color: #d44638;
}

.share-icon.link {
  color: #6c757d;
}

.share-info {
  flex-grow: 1;
}

.share-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.share-description {
  font-size: 0.875rem;
  color: #6c757d;
}

/* Link Copy Input */
.copy-link-input {
  position: relative;
}

.copy-link-input .form-control {
  padding-right: 4.5rem;
}

.copy-link-input .btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .spec-highlight {
    flex: 1 1 calc(50% - 1rem);
  }

  .product-image-slider, .view360-viewer, .model3d-viewer {
    height: 350px;
  }

  .product-image-slider .swiper-slide img {
    max-height: 330px;
  }
}

@media (max-width: 768px) {
  .machine-header h1 {
    font-size: 2.5rem !important;
  }

  .specs-table th {
    width: 50%;
  }

  .product-image-slider, .view360-viewer, .model3d-viewer {
    height: 300px;
  }

  .product-image-slider .swiper-slide img {
    max-height: 280px;
  }
}

@media (max-width: 576px) {
  .spec-highlight {
    flex: 1 1 100%;
  }

  .action-buttons .btn {
    width: 100%;
    margin-right: 0 !important;
  }

  .product-image-slider, .view360-viewer, .model3d-viewer {
    height: 250px;
  }

  .product-image-slider .swiper-slide img {
    max-height: 230px;
  }
}

/* Error Message */
.error-message {
  text-align: center;
  padding: 2rem;
  background-color: #f8d7da;
  color: #721c24;
  border-radius: 0.25rem;
  margin: 2rem 0;
}

.error-message i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.loading-spinner i {
  font-size: 3rem;
  color: var(--brand-dark-red);
  margin-bottom: 1rem;
}

/* Fullscreen Lightbox Customization */
.fancybox-bg {
  background: #000;
}

.fancybox-is-open .fancybox-bg {
  opacity: 0.9;
}

.fancybox-caption {
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
  padding: 1rem;
}

/* Machine Gallery - New Implementation */
.machine-gallery-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  position: relative;
}

/* Thumbnails Container */
.machine-thumbnails {
  width: 25%;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.machine-thumbnails::-webkit-scrollbar {
  display: none;
}

/* Main Image Container */
.machine-main-image {
  width: 75%;
}

/* Thumbnail Styling */
.thumbnail-item {
  display: block;
  width: 100%;
  height: 120px; /* Increased from 80px to 120px */
  margin-bottom: 10px;
  border: 2px solid var(--brand-dark-red);
  border-radius: 0.25rem;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.thumbnail-item.active {
  opacity: 1;
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .machine-gallery-container {
    flex-direction: column-reverse;
  }

  .machine-thumbnails {
    width: 100%;
    max-height: 120px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: 10px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }

  /* Hide scrollbar for Chrome, Safari and Opera */
  .machine-thumbnails::-webkit-scrollbar {
    display: none;
  }

  .machine-main-image {
    width: 100%;
  }

  #thumbnailsContainer {
    display: flex;
    flex-direction: row;
    gap: 10px;
  }

  .thumbnail-item {
    width: 120px; /* Increased from 80px to 120px */
    height: 120px; /* Increased from 80px to 120px */
    flex-shrink: 0;
    margin-bottom: 0;
  }
}
