/**
 * DeMV Platform - Marketplace Cards CSS
 * Enhanced cyberpunk styling for marketplace vehicle cards
 */

/* Marketplace card container - inherits from vehicle-card */
.marketplace-card, .vehicle-card, .card.vehicle-card {
  display: flex;
  flex-direction: column;
  background: rgba(18, 18, 30, 0.9);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(108, 99, 255, 0.2);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), 0 0 10px rgba(108, 99, 255, 0.1);
  margin-bottom: 20px;
  height: 100%;
  min-height: 400px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  width: 100%;
  max-width: 100%;
}

.marketplace-card:hover, .vehicle-card:hover, .card.vehicle-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(108, 99, 255, 0.2);
  border-color: rgba(108, 99, 255, 0.6);
  cursor: pointer;
}

.cyberpunk-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(108, 99, 255, 0.1);
}

/* NFT Card Action Buttons as per user preference */
.vehicle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 0 0 16px;
}

.vehicle-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  min-width: 0; /* Prevents buttons from overflowing */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.vehicle-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.vehicle-actions .btn-primary {
  background: linear-gradient(to right, #6c63ff, #4d44db);
  border: none;
  color: white;
  box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.vehicle-actions .btn-outline {
  background: rgba(20, 20, 30, 0.4);
  border: 1px solid rgba(108, 99, 255, 0.3);
  color: rgba(255, 255, 255, 0.9);
}

/* Dropdown menu styling */
.vehicle-actions-dropdown {
  position: relative;
}

.more-actions-btn {
  width: 40px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 30, 0.4);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Hover functionality removed as requested */

.dropdown-menu {
  position: absolute;
  left: 0; /* Position on the left */
  bottom: 100%; /* Position above the button */
  background: rgba(18, 18, 30, 0.95);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  z-index: 100;
  margin-bottom: 5px; /* Add margin to the bottom instead of top */
  display: none;
  overflow: hidden;
}

/* Hover functionality removed as requested */

/* Ensure dropdown is visible */
.vehicle-actions-dropdown .dropdown-menu.active {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: background-color 0.2s ease;
  font-size: 14px;
}

.dropdown-item:hover {
  background: rgba(108, 99, 255, 0.2);
  color: white;
}

.dropdown-item i {
  color: #6c63ff;
  width: 16px;
  text-align: center;
}

/* NFT Card Links as per user preference */
.vehicle-specs span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(20, 20, 30, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  margin-right: 5px;
  margin-bottom: 5px;
  font-size: 13px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.vehicle-specs span:hover {
  transform: translateY(-1px);
  background: rgba(108, 99, 255, 0.1);
}

.vehicle-specs i {
  color: #6c63ff;
}

/* Vehicle description styling */
.vehicle-description {
  margin-bottom: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

/* Marketplace card dropdown styling */
.marketplace-card .vehicle-actions-dropdown {
  position: relative;
}

.marketplace-card .more-actions-btn {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(108, 99, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
  width: 40px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
}

/* Hover functionality removed as requested */

.marketplace-card .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(25, 25, 40, 0.95);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(108, 99, 255, 0.2);
  z-index: 1000;
  min-width: 180px;
  margin-top: 5px;
  padding: 5px 0;
  overflow: visible;
}

.marketplace-card .dropdown-menu.show {
  display: block;
}

.marketplace-card .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  text-decoration: none;

}

.marketplace-card .dropdown-item:hover {
  background: rgba(108, 99, 255, 0.1);
  color: white;
  text-decoration: none;
}

.marketplace-card .dropdown-item i {
  color: rgba(108, 99, 255, 0.8);
  width: 16px;
  text-align: center;
}

.cyberpunk-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #6c63ff, #ff6584);
    z-index: 1;
}

/* Vehicle grid for better card layout */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Vehicle image container */
.vehicle-image-container {
  position: relative;
  overflow: hidden;
  height: 220px;
  border-bottom: 1px solid rgba(108, 99, 255, 0.2);
  background-color: rgba(10, 10, 20, 0.8); /* Dark background for when image is loading */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1; /* Lower z-index than the badge */
}

.vehicle-image-link {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.vehicle-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease, filter 0.5s ease, opacity 0.3s ease;
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.vehicle-card:hover .vehicle-image {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Hover effect on the image link */
.vehicle-image-link:hover .vehicle-image {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Vehicle details section */
.vehicle-details {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    gap: 10px;
}

/* Vehicle title */
.vehicle-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}

.vehicle-title a {
    color: white;
    text-decoration: none;
    transition: color 0.2s ease;
}

.vehicle-title a:hover {
    color: #6c63ff;
}

/* Vehicle description */
.vehicle-description {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

/* Vehicle specs container */
.vehicle-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

/* Status badges */
.vehicle-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(20, 20, 30, 0.4);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 5; /* Increased z-index to ensure it appears in front of the image */
    text-transform: capitalize;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* Added shadow for better visibility */
}

.tag-active {
    background: rgba(39, 174, 96, 0.8);
}

.tag-pending {
    background: rgba(243, 156, 18, 0.8);
}

.tag-sold {
    background: rgba(231, 76, 60, 0.8);
}

/* Verified badge */
.verified-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(108, 99, 255, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

/* Image zoom indicator */
.image-zoom-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.7;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.vehicle-image-container:hover .image-zoom-indicator {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(108, 99, 255, 0.8);
}

.vehicle-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;

}

.vehicle-image-link:hover .vehicle-image-overlay {
    opacity: 1;
}

.view-details-text {
    color: white;
    font-weight: 600;
    background: rgba(108, 99, 255, 0.8);
    padding: 8px 16px;
    border-radius: 4px;
    transform: translateY(20px);

}

.vehicle-image-link:hover .view-details-text {
    transform: translateY(0);
}

/* Vehicle info */
.vehicle-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Vehicle header */
.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

/* Vehicle title */
.vehicle-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--primary-color, #6c63ff);
    line-height: 1.3;
    flex: 1;
}

.vehicle-title a {
    color: inherit;
    text-decoration: none;

}

.vehicle-title a:hover {
    color: #00eeff;
}

.vehicle-title::after {
    content: '';
    display: block;
    height: 2px;
    width: 100%;
    background: rgba(108, 99, 255, 0.5);
    margin-top: 5px;
}

/* Vehicle price */
.vehicle-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #00eeff;
    white-space: nowrap;
}

/* Vehicle meta */
.vehicle-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.vehicle-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 4px 8px;
    background: rgba(26, 26, 37, 0.6);
    border-radius: 4px;
    border: 1px solid rgba(108, 99, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.vehicle-meta i {
    color: var(--primary-color, #6c63ff);
    font-size: 0.9rem;
    min-width: 16px;
    text-align: center;
}

/* Vehicle description */
.vehicle-description {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    flex: 1;
}

/* Vehicle actions */
.marketplace-card .vehicle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(108, 99, 255, 0.1);
}

.marketplace-card .btn {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    text-decoration: none;
}

.marketplace-card .btn-primary {
    background: linear-gradient(135deg, #6c63ff 0%, #3a36b1 100%);
    border: 1px solid #6c63ff;
    color: white;
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.3);
}

.marketplace-card .btn-primary:hover {
    background: linear-gradient(135deg, #7c73ff 0%, #4a46c1 100%);
    box-shadow: 0 0 15px rgba(108, 99, 255, 0.5);
    transform: translateY(-2px);
}

.marketplace-card .btn-outline {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(108, 99, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.marketplace-card .btn-outline:hover {
    background: rgba(108, 99, 255, 0.1);
    border-color: rgba(108, 99, 255, 0.5);
    color: white;
}

/* Legacy button classes for backward compatibility */
.marketplace-card .btn-view-details {
    flex: 2;
    background: linear-gradient(135deg, #6c63ff 0%, #3a36b1 100%);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;

}

.marketplace-card .btn-view-details:hover {
    background: linear-gradient(135deg, #7c73ff 0%, #4a46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.marketplace-card .btn-make-offer,
.marketplace-card .btn-add-compare {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(108, 99, 255, 0.3);
    color: white;
    border-radius: 4px;
    padding: 8px 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

}

.marketplace-card .btn-make-offer:hover,
.marketplace-card .btn-add-compare:hover {
    background: rgba(108, 99, 255, 0.1);
    border-color: rgba(108, 99, 255, 0.5);
}

.btn-add-compare:hover {
    background: rgba(108, 99, 255, 0.2);
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.2);
}

.btn-add-compare.active {
    background: rgba(108, 99, 255, 0.3);
    color: #fff;
    box-shadow: 0 0 10px rgba(108, 99, 255, 0.4);
}

.combined-button {
    grid-column: span 2;
}

/* Vehicle status badge */
.vehicle-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
    text-transform: capitalize;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

.for-sale-only {
    background-color: rgba(108, 99, 255, 0.9);
    color: white;
}

.for-rent-only {
    background-color: rgba(255, 101, 132, 0.9);
    color: white;
}

.sale-and-rent {
    background-color: rgba(255, 187, 0, 0.9);
    color: white;
}

/* Verified badge */
.verified-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #00e676;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-badge i {
    font-size: 0.8rem;
}

/* Vehicle tags */
.vehicle-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.vehicle-tag {
    background-color: rgba(108, 99, 255, 0.15);
    color: #6c63ff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
}

.tag-electric {
    background-color: rgba(0, 230, 118, 0.15);
    color: #00e676;
}

.tag-hybrid {
    background-color: rgba(0, 176, 255, 0.15);
    color: #00b0ff;
}

.tag-luxury {
    background-color: rgba(255, 187, 0, 0.15);
    color: #ffbb00;
}

.tag-sport {
    background-color: rgba(255, 61, 0, 0.15);
    color: #ff3d00;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vehicle-header {
        flex-direction: column;
    }
    
    .vehicle-price {
        align-self: flex-start;
    }
    
    .vehicle-actions {
        grid-template-columns: 1fr;
    }
    
    .btn-view-details,
    .combined-button {
        grid-column: auto;
    }
}

/* Marketplace grid */
.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Grid view specific styles */
.grid-view .vehicle-card {
    display: flex;
    flex-direction: column;
}

/* List view specific styles */
.list-view .vehicle-card {
    display: flex;
    flex-direction: row;
}

.list-view .vehicle-image-container {
    width: 300px;
    height: 200px;
    flex-shrink: 0;
}

.list-view .vehicle-info {
    flex: 1;
}

@media (max-width: 768px) {
    .list-view .vehicle-card {
        flex-direction: column;
    }
    
    .list-view .vehicle-image-container {
        width: 100%;
    }
}
