/**
 * License Plate Styles - Dynamic EU Plate Rendering
 * Creates authentic EU license plates using CSS (no static background image)
 * Uses FE-Schrift font for authentic German/EU plate styling
 */

/* ===========================================
   EU LICENSE PLATE VISUAL COMPONENT
   
   Structure:
   - Container with proper EU plate aspect ratio (520mm x 110mm = 4.73:1)
   - Blue left band (~9%) with EU stars and country code
   - White right area (~91%) with plate number
   =========================================== */

.license-plate-visual {
  position: relative;
  display: inline-flex;
  flex-direction: row; /* Explicit: EU band on LEFT, main area on RIGHT */
  align-items: stretch; /* Children stretch to full height */
  width: 100%;
  max-width: 520px;
  /* Standard EU plate ratio: 520mm x 110mm ≈ 4.73:1 */
  aspect-ratio: 520 / 110;
  border-radius: 6px;
  overflow: hidden;
  /* Black border for contrast */
  border: 3px solid #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background: #fff;
  font-family: 'FE-Schrift', 'Arial Black', 'Impact', sans-serif;
  user-select: none;
}

/* Blue EU band on the left side */
.license-plate-visual .plate-eu-band {
  position: relative;
  width: 9%;
  min-width: 9%;
  height: 100%;
  background: linear-gradient(180deg, #003399 0%, #002b7f 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4% 0;
  box-sizing: border-box;
}

/* Ensure all elements inside the EU band have transparent backgrounds */
.license-plate-visual .plate-eu-band * {
  background: transparent;
}

/* EU Stars circle - ensure transparent background */
.license-plate-visual .plate-eu-stars {
  width: 65%;
  max-width: 30px;
  height: auto;
  object-fit: contain;
  margin-bottom: 3px;
  /* Ensure fully transparent background - critical! */
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 0;
  margin-top: 0;
  box-shadow: none !important;
  display: block;
}

/* Country code in the EU band */
.license-plate-visual .plate-country-code {
  font-family: 'FE-Schrift', 'Arial Black', 'Impact', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  margin-top: 2px;
}

/* White area for plate number */
.license-plate-visual .plate-main-area {
  flex: 1;
  height: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3%;
  box-sizing: border-box;
}

/* Plate number text */
.license-plate-visual .plate-number {
  font-family: 'FE-Schrift', 'Arial Black', 'Impact', sans-serif;
  font-weight: 400;
  font-size: 2.5rem;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  line-height: 1;
  text-align: center;
}

/* ===========================================
   SIZE VARIATIONS - EXPLICIT SIZING
   =========================================== */

/* Large size - for detail pages */
.license-plate-visual.plate-large {
  max-width: 600px;
}

.license-plate-visual.plate-large .plate-eu-stars {
  max-width: 38px;
}

.license-plate-visual.plate-large .plate-country-code {
  font-size: 1.1rem;
}

.license-plate-visual.plate-large .plate-number {
  font-size: 4.5rem;
}

/* Card size variation - for grid listings (~300-380px width) */
.license-plate-visual.plate-card {
  max-width: 100%; /* Allow full width in grid */
  border-width: 2px;
  /* Ensure proper height sizing for cards */
  height: auto;
  min-height: 60px;
}

.license-plate-visual.plate-card .plate-eu-band {
  /* Ensure EU band maintains proper dimensions in card context */
  min-width: 28px;
  padding: 6px 0;
}

.license-plate-visual.plate-card .plate-eu-stars {
  width: 55%;
  max-width: 20px;
  min-width: 14px;
  margin-bottom: 2px;
}

.license-plate-visual.plate-card .plate-country-code {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.license-plate-visual.plate-card .plate-number {
  font-size: clamp(1.5rem, 5vw, 2.2rem); /* Responsive font size for card */
  letter-spacing: 0.06em;
}

/* Mini size for dashboard etc */
.license-plate-visual.plate-mini {
  max-width: 220px;
  border-width: 2px;
}

.license-plate-visual.plate-mini .plate-eu-stars {
  max-width: 18px;
}

.license-plate-visual.plate-mini .plate-country-code {
  font-size: 0.5rem;
}

.license-plate-visual.plate-mini .plate-number {
  font-size: 1.2rem;
}

/* Extra large for hero displays */
.license-plate-visual.plate-hero {
  max-width: 700px;
}

.license-plate-visual.plate-hero .plate-eu-stars {
  max-width: 45px;
}

.license-plate-visual.plate-hero .plate-country-code {
  font-size: 1.3rem;
}

.license-plate-visual.plate-hero .plate-number {
  font-size: 5rem;
}

/* ===========================================
   LICENSE PLATE GRID (Browse Page)
   =========================================== */

.license-plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg, 1.5rem);
  padding: var(--space-md, 1rem) 0;
}

@media (max-width: 768px) {
  .license-plate-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md, 1rem);
  }
}

/* ===========================================
   LICENSE PLATE CARD
   =========================================== */

.license-plate-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border-color, #e5e7eb);
  cursor: pointer;
}

.license-plate-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
}

.license-plate-card-image {
  width: 100%;
  padding: var(--space-lg, 1.5rem);
  background: var(--bg-muted, #f8f9fa);
  display: flex;
  align-items: center;
  justify-content: center;
}

.license-plate-card-content {
  padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.5rem;
}

/* Price section - prominent display below plate */
.license-plate-card-price-section {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.license-plate-card-price-section .license-plate-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary, #C11A1A);
  border: none;
  padding: 0;
  margin: 0;
}

.license-plate-vat-info {
  font-size: 0.7rem;
  color: var(--text-muted, #9ca3af);
}

/* License Plate Property Badges (February 2026 UX update - matching reference) */
.license-plate-card-badges {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: var(--space-xs, 0.25rem) 0;
}

.license-plate-card-badges .badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.badge-separator {
  color: var(--text-muted, #9ca3af);
  font-size: 0.7rem;
  padding: 0 0.125rem;
}

.plate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  white-space: nowrap;
  background: transparent;
}

.plate-badge i {
  font-size: 0.65rem;
}

/* Damage badge highlight */
.plate-badge.badge-damage {
  color: var(--error, #dc2626);
}

/* Condition badges (legacy support) */
.plate-badge.badge-new {
  color: #059669;
}

.plate-badge.badge-used {
  background: var(--bg-muted, #f3f4f6);
  color: var(--text-secondary, #6b7280);
}

/* Status badges */
.plate-badge.badge-legal {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.plate-badge.badge-collectible {
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
}

/* Damage warning badge */
.plate-damage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: var(--radius-sm, 4px);
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.plate-damage-badge i {
  font-size: 0.65rem;
}

/* Dark mode adjustments */
[data-theme="dark"] .plate-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #a1a1aa);
}

[data-theme="dark"] .plate-badge.badge-new {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

[data-theme="dark"] .plate-badge.badge-legal {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

[data-theme="dark"] .plate-badge.badge-collectible {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

[data-theme="dark"] .plate-damage-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.license-plate-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-sm, 0.5rem);
  border-top: 1px solid var(--border-color, #e5e7eb);
  font-size: 0.75rem;
  color: var(--text-muted, #9ca3af);
}

.license-plate-card-location {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.license-plate-card-location i {
  font-size: 0.65rem;
}

.license-plate-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.license-plate-card-meta .seller-type {
  font-weight: 500;
}

.license-plate-card-meta .view-count {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.license-plate-card-meta .view-count i {
  font-size: 0.65rem;
}

/* Legacy price/date styles */
.license-plate-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary, #C11A1A);
}

.license-plate-card-date {
  font-size: 0.75rem;
  color: var(--text-muted, #9ca3af);
}

/* Featured badge */
.license-plate-card.is-featured {
  border-color: var(--primary, #C11A1A);
  box-shadow: 0 0 0 2px rgba(193, 26, 26, 0.1);
}

.license-plate-card .featured-badge {
  position: absolute;
  top: var(--space-sm, 0.5rem);
  right: var(--space-sm, 0.5rem);
  background: var(--primary, #C11A1A);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Short description badge */
.license-plate-card .short-description-badge {
  color: var(--primary, #C11A1A);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* ===========================================
   LICENSE PLATE DETAIL PAGE
   =========================================== */

.license-plate-detail-container {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-xl, 2rem);
  align-items: start;
}

@media (max-width: 1024px) {
  .license-plate-detail-container {
    grid-template-columns: 1fr;
  }
}

.license-plate-detail-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg, 1.5rem);
}

.license-plate-detail-image-wrapper {
  background: var(--bg-muted, #f8f9fa);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-xl, 2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg, 0 16px 48px rgba(0, 0, 0, 0.15));
}

.license-plate-detail-image-wrapper .license-plate-visual {
  max-width: 600px;
}

@media (max-width: 768px) {
  .license-plate-detail-image-wrapper {
    padding: var(--space-lg, 1.5rem);
  }
  
  .license-plate-detail-image-wrapper .license-plate-visual {
    max-width: 100%;
  }
}

.license-plate-detail-info {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
}

.license-plate-detail-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: var(--space-md, 1rem);
  padding-bottom: var(--space-sm, 0.5rem);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.license-plate-detail-info .detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm, 0.5rem) 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.license-plate-detail-info .detail-item:last-child {
  border-bottom: none;
}

.license-plate-detail-info .detail-item strong {
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  font-size: 0.875rem;
}

.license-plate-detail-info .detail-item span {
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
}

.license-plate-detail-info .detail-item.price-row span {
  font-size: 1.5rem;
  color: var(--primary, #C11A1A);
}

.license-plate-description-block {
  margin-top: var(--space-lg, 1.5rem);
}

.license-plate-description-block h3 {
  margin-bottom: var(--space-sm, 0.5rem);
}

.license-plate-description-block p {
  color: var(--text-secondary, #6b7280);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ===========================================
   SELLER INFO CARD
   =========================================== */

.seller-info-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
  position: sticky;
  top: 100px;
}

.seller-info-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: var(--space-md, 1rem);
  padding-bottom: var(--space-sm, 0.5rem);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.seller-info-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md, 1rem);
}

.seller-info-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 0.5rem);
}

.seller-info-row i {
  width: 20px;
  color: var(--text-muted, #9ca3af);
}

.seller-info-row span {
  color: var(--text-primary, #1a1a1a);
}

.seller-organization {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 0.5rem);
  padding: var(--space-sm, 0.5rem);
  background: var(--bg-muted, #f8f9fa);
  border-radius: var(--radius-md, 8px);
}

.seller-organization img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-sm, 4px);
}

.seller-organization-name {
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
}

.seller-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.5rem);
  margin-top: var(--space-md, 1rem);
}

.seller-actions .btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 1024px) {
  .seller-info-card {
    position: static;
  }
}

/* ===========================================
   SELL LICENSE PLATE FORM
   =========================================== */

.sell-plate-container {
  max-width: 800px;
  margin: 0 auto;
}

.sell-plate-form {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-xl, 2rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
}

.sell-plate-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg, 1.5rem);
}

@media (max-width: 768px) {
  .sell-plate-form-grid {
    grid-template-columns: 1fr;
  }
}

.sell-plate-form-grid .form-group.full-width {
  grid-column: 1 / -1;
}

.sell-plate-form-grid .form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md, 1rem);
  margin-top: var(--space-md, 1rem);
  padding-top: var(--space-lg, 1.5rem);
  border-top: 1px solid var(--border-color, #e5e7eb);
}

@media (max-width: 768px) {
  .sell-plate-form-grid .form-actions {
    flex-direction: column;
  }
  
  .sell-plate-form-grid .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Plate preview in form */
.plate-preview-container {
  background: var(--bg-muted, #f8f9fa);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg, 1.5rem);
}

.plate-preview-container .license-plate-visual {
  max-width: 450px;
}

/* ===========================================
   ACTIVATE LICENSE PLATE PAGE
   =========================================== */

.activate-plate-container {
  max-width: 1000px;
  margin: 0 auto;
}

.activate-plate-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-xl, 2rem);
  align-items: start;
}

@media (max-width: 1024px) {
  .activate-plate-layout {
    grid-template-columns: 1fr;
  }
}

.activate-plate-summary {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
}

.activate-plate-summary h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: var(--space-md, 1rem);
}

.activate-plate-preview {
  background: var(--bg-muted, #f8f9fa);
  border-radius: var(--radius-md, 8px);
  padding: var(--space-lg, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md, 1rem);
}

.activate-plate-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.5rem);
}

.activate-plate-details .detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.activate-plate-details .detail-row strong {
  color: var(--text-secondary, #6b7280);
}

.activate-plate-details .detail-row span {
  color: var(--text-primary, #1a1a1a);
  font-weight: 500;
}

/* ===========================================
   NO RESULTS STATE
   =========================================== */

.no-plates-found {
  text-align: center;
  padding: var(--space-2xl, 3rem);
  color: var(--text-muted, #9ca3af);
}

.no-plates-found i {
  font-size: 3rem;
  margin-bottom: var(--space-md, 1rem);
  opacity: 0.5;
}

.no-plates-found h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: var(--space-sm, 0.5rem);
}

.no-plates-found p {
  margin-bottom: var(--space-lg, 1.5rem);
}

/* ===========================================
   LOADING STATE
   =========================================== */

.plates-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl, 3rem);
  color: var(--text-muted, #9ca3af);
}

.plates-loading i {
  font-size: 2rem;
  margin-bottom: var(--space-md, 1rem);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===========================================
   DASHBOARD LICENSE PLATES SECTION
   =========================================== */

.dashboard-plates-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md, 1rem);
}

.dashboard-plate-item {
  display: flex;
  align-items: center;
  gap: var(--space-md, 1rem);
  padding: var(--space-md, 1rem);
  background: var(--card-bg, #fff);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border-color, #e5e7eb);
  transition: background 0.2s ease;
}

.dashboard-plate-item:hover {
  background: var(--bg-hover, #f8f9fa);
}

.dashboard-plate-item .plate-preview {
  flex-shrink: 0;
}

.dashboard-plate-item .plate-info {
  flex-grow: 1;
  min-width: 0;
}

.dashboard-plate-item .plate-number {
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: 0.25rem;
}

.dashboard-plate-item .plate-meta {
  font-size: 0.875rem;
  color: var(--text-muted, #9ca3af);
}

.dashboard-plate-item .plate-price {
  font-weight: 700;
  color: var(--primary, #C11A1A);
  font-size: 1.125rem;
}

.dashboard-plate-item .plate-actions {
  display: flex;
  gap: var(--space-sm, 0.5rem);
}

.dashboard-plate-item .plate-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.75rem;
  font-weight: 500;
}

.dashboard-plate-item .plate-status.active {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.dashboard-plate-item .plate-status.draft {
  background: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
}

.dashboard-plate-item .plate-status.expired {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

@media (max-width: 768px) {
  .dashboard-plate-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .dashboard-plate-item .plate-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: var(--space-sm, 0.5rem);
  }
}

/* ===========================================
   SEARCH FILTER - LICENSE PLATES MODE
   =========================================== */

.search-filter-component[data-mode="license-plates"] .vehicle-only-filter {
  display: none;
}

.search-filter-component .plate-only-filter {
  display: none;
}

.search-filter-component[data-mode="license-plates"] .plate-only-filter {
  display: block;
}

/* Category tabs for search filter */
.search-category-tabs {
  display: flex;
  gap: var(--space-sm, 0.5rem);
  margin-bottom: var(--space-lg, 1.5rem);
  border-bottom: 2px solid var(--border-color, #e5e7eb);
  padding-bottom: var(--space-sm, 0.5rem);
}

.search-category-tab {
  padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
  background: transparent;
  border: none;
  border-radius: var(--radius-md, 8px) var(--radius-md, 8px) 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-xs, 0.25rem);
}

.search-category-tab:hover {
  background: var(--bg-hover, #f8f9fa);
  color: var(--text-primary, #1a1a1a);
}

.search-category-tab.active {
  background: var(--primary, #C11A1A);
  color: #fff;
}

.search-category-tab i {
  font-size: 1rem;
}

/* ===========================================
   RESPONSIVE ADJUSTMENTS
   =========================================== */

@media (max-width: 768px) {
  /* Plate visual on tablets */
  .license-plate-visual {
    max-width: 100%;
  }
  
  /* Plate hero card on tablet */
  .plate-hero-card .license-plate-visual {
    max-width: 100%;
  }
  
  /* Responsive font adjustments for Hero */
  .license-plate-visual.plate-hero .plate-number {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  /* Card plates on mobile - adjust font size for smaller screens */
  .license-plate-visual.plate-card .plate-number {
    font-size: 1.6rem;
  }
  
  .license-plate-visual.plate-card .plate-eu-stars {
    max-width: 16px;
    min-width: 12px;
  }
  
  .license-plate-visual.plate-card .plate-country-code {
    font-size: 0.55rem;
  }
  
  .license-plate-card-content {
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
  }
  
  .license-plate-card-price {
    font-size: 1.125rem;
  }
  
  /* Adjust plate visual wrapper for mobile */
  .plate-visual-wrapper .license-plate-visual {
    height: 60px;
  }
  
  .plate-visual-wrapper .license-plate-visual.plate-card {
    height: 56px;
  }
}

/* ===========================================
   LICENSE PLATES BROWSE PAGE
   =========================================== */

/* Filter Section */
.plate-filter-section {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-lg, 1.5rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
}

.plate-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md, 1rem);
  align-items: end;
}

.plate-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plate-filter-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
}

.plate-filter-field select,
.plate-filter-field input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  background: var(--input-bg, #fff);
  color: var(--text-primary, #1a1a1a);
  font-size: 0.875rem;
}

.price-range-inputs {
  display: flex;
  gap: 0.5rem;
}

.price-range-inputs input {
  width: 100%;
}

.plate-filter-actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .plate-filter-row {
    grid-template-columns: 1fr;
  }
  
  .plate-filter-actions {
    flex-direction: column;
  }
  
  .plate-filter-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Plate card grid on mobile - single column */
  .plate-card-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md, 1rem);
  }
  
  /* Plate visual wrapper adjustments */
  .plate-visual-wrapper {
    padding: 0.75rem 1rem;
    height: 90px;
    min-height: 90px;
    max-height: 90px;
  }
  
  .plate-visual-wrapper .license-plate-visual {
    height: 66px;
  }
  
  .plate-visual-wrapper .license-plate-visual.plate-card {
    height: 62px;
  }
}

/* Plate Card Grid */
.plate-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg, 1.5rem);
}

/* Plate Listing Card */
.plate-listing-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plate-listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
}

.plate-visual-wrapper {
  position: relative; /* Required for absolute positioning of child buttons */
  padding: 1rem 1.5rem;
  background: var(--bg-muted, #f8f9fa);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fixed height for consistent card layout - accommodates plate aspect ratio */
  height: 110px;
  min-height: 110px;
  max-height: 110px;
}

/* Favorite remove button inside plate visual wrapper */
.plate-visual-wrapper .favorite-remove-btn,
.plate-listing-card .favorite-remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  padding: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.plate-visual-wrapper .favorite-remove-btn:hover,
.plate-listing-card .favorite-remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Ensure plate card visual fills the wrapper properly */
.plate-visual-wrapper .license-plate-visual {
  /* Maintain inline-flex from base - do NOT change to flex as it can break layout */
  display: inline-flex;
  flex-direction: row; /* Explicit: EU band on left, main area on right */
  /* Size based on container height - plate has 520:110 aspect ratio (~4.73:1) */
  height: 80px; /* Fixed height for consistent card display */
  width: auto; /* Let aspect-ratio determine width based on height */
  max-width: 100%;
  aspect-ratio: 520 / 110;
  align-self: center;
  flex-shrink: 0;
}

.plate-visual-wrapper .license-plate-visual.plate-card {
  height: 72px; /* Slightly smaller for card context */
}

.plate-info {
  padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
}

.plate-info .plate-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary, #C11A1A);
  margin-bottom: 0.5rem;
}

.plate-info .plate-meta {
  display: flex;
  gap: var(--space-md, 1rem);
  color: var(--text-muted, #9ca3af);
  font-size: 0.875rem;
  margin-bottom: var(--space-md, 1rem);
}

.plate-info .plate-meta i {
  margin-right: 0.25rem;
}

.plate-info .plate-actions {
  display: flex;
  gap: 0.5rem;
}

.plate-info .plate-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Loading State */
.plate-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl, 3rem);
  color: var(--text-muted, #9ca3af);
}

.plate-loading i {
  font-size: 2rem;
  margin-bottom: var(--space-md, 1rem);
  animation: spin 1s linear infinite;
}

/* Empty State */
.plate-empty-state {
  text-align: center;
  padding: var(--space-2xl, 3rem);
  color: var(--text-muted, #9ca3af);
}

.plate-empty-state i {
  font-size: 3rem;
  margin-bottom: var(--space-md, 1rem);
  opacity: 0.5;
}

.plate-empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: var(--space-sm, 0.5rem);
}

.plate-empty-state p {
  margin-bottom: var(--space-lg, 1.5rem);
}

/* Pagination */
.plate-pagination {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: var(--space-xl, 2rem);
}

.plate-pagination button {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  background: var(--card-bg, #fff);
  color: var(--text-primary, #1a1a1a);
  cursor: pointer;
  transition: all 0.2s ease;
}

.plate-pagination button:hover:not(:disabled) {
  border-color: var(--primary, #C11A1A);
  color: var(--primary, #C11A1A);
}

.plate-pagination button.active {
  background: var(--primary, #C11A1A);
  border-color: var(--primary, #C11A1A);
  color: #fff;
}

.plate-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===========================================
   LICENSE PLATE DETAIL PAGE
   =========================================== */

.plate-detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-xl, 2rem);
  align-items: start;
}

@media (max-width: 1024px) {
  .plate-detail-layout {
    grid-template-columns: 1fr;
  }
}

.plate-detail-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg, 1.5rem);
}

.plate-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg, 1.5rem);
  position: sticky;
  top: 100px;
}

@media (max-width: 1024px) {
  .plate-detail-sidebar {
    position: static;
  }
}

/* Plate Hero Card */
.plate-hero-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-xl, 2rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
  text-align: center;
}

.plate-hero-card .license-plate-visual {
  max-width: 580px;
  margin: 0 auto var(--space-lg, 1.5rem);
}

/* Larger plate display for detail page - use hero size */
.plate-hero-card .license-plate-visual .plate-eu-stars {
  max-width: 42px;
}

.plate-hero-card .license-plate-visual .plate-country-code {
  font-size: clamp(0.85rem, 2vw, 1.2rem);
  font-weight: 700;
}

.plate-hero-card .license-plate-visual .plate-number {
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  letter-spacing: 0.08em;
}

.plate-detail-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: 0.5rem;
}

.plate-detail-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary, #C11A1A);
}

/* Plate Description Card */
.plate-description-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
}

.plate-description-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: var(--space-md, 1rem);
}

.plate-description-card h3 i {
  color: var(--primary, #C11A1A);
}

.plate-description-card p {
  color: var(--text-secondary, #6b7280);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* Plate Properties Card (February 2026 UX update) */
.plate-properties-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
  margin-bottom: var(--space-md, 1rem);
}

.plate-properties-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: var(--space-md, 1rem);
}

.plate-properties-card h3 i {
  color: var(--primary, #C11A1A);
}

.plate-properties-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.5rem);
}

.plate-property-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm, 0.5rem) 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.plate-property-item:last-child {
  border-bottom: none;
}

.plate-property-item .property-label {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
}

.plate-property-item .property-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  padding: 0.25rem 0.75rem;
  background: var(--bg-muted, #f3f4f6);
  border-radius: var(--radius-sm, 4px);
}

.plate-property-item .property-value.property-new {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.plate-property-item .property-value.property-road-legal {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.plate-property-item .property-value.property-damage {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

[data-theme="dark"] .plate-property-item .property-value {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .plate-property-item .property-value.property-new {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

[data-theme="dark"] .plate-property-item .property-value.property-road-legal {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

[data-theme="dark"] .plate-property-item .property-value.property-damage {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Stats Card */
.plate-stats-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
}

.plate-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md, 1rem);
}

.plate-stat-item {
  text-align: center;
  padding: var(--space-sm, 0.5rem);
}

.plate-stat-item .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a1a);
}

.plate-stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Seller Card */
.plate-seller-card {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
}

.plate-seller-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: var(--space-md, 1rem);
}

.plate-seller-card h3 i {
  color: var(--primary, #C11A1A);
}

.plate-contact-btn {
  width: 100%;
  margin-top: var(--space-md, 1rem);
}

.plate-contact-info {
  margin-top: var(--space-md, 1rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm, 0.5rem);
}

.plate-contact-info .contact-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 0.5rem);
  padding: var(--space-sm, 0.5rem);
  background: var(--bg-muted, #f8f9fa);
  border-radius: var(--radius-md, 8px);
}

.plate-contact-info .contact-row i {
  width: 20px;
  color: var(--primary, #C11A1A);
}

.plate-contact-info .contact-row a {
  color: var(--text-primary, #1a1a1a);
  text-decoration: none;
}

.plate-contact-info .contact-row a:hover {
  color: var(--primary, #C11A1A);
}

/* ===========================================
   SELL LICENSE PLATE PAGE
   =========================================== */

.sell-plate-section {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-lg, 1.5rem);
  margin-bottom: var(--space-lg, 1.5rem);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
  border: 1px solid var(--border-color, #e5e7eb);
}

.sell-plate-section h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin-bottom: var(--space-lg, 1.5rem);
  padding-bottom: var(--space-sm, 0.5rem);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.sell-plate-section h3 i {
  color: var(--primary, #C11A1A);
}

.sell-plate-preview {
  display: flex;
  justify-content: center;
  padding: var(--space-lg, 1.5rem);
  background: var(--bg-muted, #f8f9fa);
  border-radius: var(--radius-md, 8px);
}

.sell-plate-preview .license-plate-visual {
  /* Fixed width to prevent shrinking during typing */
  width: 450px;
  min-width: 450px;
  max-width: 450px;
}

@media (max-width: 520px) {
  .sell-plate-preview .license-plate-visual {
    /* On smaller screens, use percentage but still fixed */
    width: 100%;
    min-width: 280px;
    max-width: 100%;
  }
}

.sell-plate-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg, 1.5rem);
}

@media (max-width: 768px) {
  .sell-plate-fields {
    grid-template-columns: 1fr;
  }
}

.sell-plate-fields .form-group.full-width {
  grid-column: 1 / -1;
}

/* Checkbox label styling for sell form */
.sell-plate-fields .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm, 0.5rem);
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-primary, #1a1a1a);
  line-height: 1.5;
}

.sell-plate-fields .checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary, #C11A1A);
}

.sell-plate-fields .checkbox-label span {
  flex: 1;
}

/* ===========================================
   PRINT STYLES
   =========================================== */

@media print {
  .license-plate-visual {
    max-width: 300px;
    box-shadow: none;
  }
  
  .seller-actions,
  .search-filter-wrapper,
  .plate-filter-section,
  .plate-pagination {
    display: none;
  }
}
