/* ================================
   LICENSE PLATE STYLES - OPTIMIZED
   ================================ */

/* Visual license plates - Pentru popup-uri și previzualizări (NU se micșorează pe mobil) */
.visual-license-plate {
  position: relative;
  font-family: "Arial", sans-serif;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  background: linear-gradient(145deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid #000;
  border-radius: 4px;
  padding: 0;
  height: 50px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin: 0 auto 10px auto;
  max-width: 220px;
}

/* Current and preview plates in popups - mai mari */
.current-license-plate,
.preview-license-plate {
  position: relative;
  font-family: "Arial Black", Arial, sans-serif;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  background: linear-gradient(145deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid #000;
  border-radius: 6px;
  padding: 0;
  height: 60px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  margin: 0 auto;
  max-width: 300px;
}

/* License plates - Pentru liste și grids (SE MICȘOREAZĂ pe mobil) */
.license-plate {
  position: relative;
  font-family: "Arial", sans-serif;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  background: linear-gradient(145deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid #000;
  border-radius: 4px;
  padding: 0;
  height: 50px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin: 0;
  max-width: 220px;
  width: auto;
}

/* License plates in cards - aligned left */
.parking-card .license-plate,
.parking-card-plate .license-plate {
  margin: 0;
  width: auto;
}

/* CARD-SPECIFIC LICENSE PLATES */
.card-license-plate-wrapper {
  display: inline-block;
  max-width: 160px;
  width: auto;
}

.license-plate-card {
  position: relative;
  font-family: "Arial Black", Arial, sans-serif;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  border-radius: 3px;
  padding: 0;
  height: 35px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
}

/* Card plate base styles */
.license-plate-card.plate-base {
  background: #fff;
  border: 2px solid #000;
  box-shadow: inset 0 0 0 1px #000;
}

/* Country flag section for cards */
.country-flag-section-card {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 30px;
  background: #003399;
  border-right: 1px solid #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

/* EU Flag for cards */
.eu-flag-svg-card {
  width: 16px;
  height: 16px;
  background-image: url("https://olimpiaparking.com/wp-content/uploads/2025/05/european-flag-svgrepo-com.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: brightness(0) saturate(100%) invert(84%) sepia(75%) saturate(2000%)
    hue-rotate(15deg) brightness(95%) contrast(90%);
}

/* Country flag for cards */
.country-flag-svg-card {
  width: 16px;
  height: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Country code for cards */
.country-code-card {
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  margin-top: 1px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
}

/* License plate number for cards */
.license-plate-number-card {
  flex: 1;
  text-align: center;
  padding-left: 35px;
  padding-right: 5px;
}

.license-plate-number-card strong {
  font-size: 16px !important;
  font-weight: 900 !important;
  color: #000 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
  font-family: "Arial Black", Arial, sans-serif !important;
}

/* Card-specific country plate styles */
.license-plate-card.plate-ro-permanent {
  background: linear-gradient(145deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid #000;
}

.license-plate-card.plate-ro-provisional .license-plate-number-card strong {
  color: #c00 !important;
}

.license-plate-card.plate-it-provisional {
  background: #228b22;
  border: 1px solid #000;
}

.license-plate-card.plate-it-provisional .license-plate-number-card strong {
  color: #fff !important;
}

.license-plate-card.plate-de-provisional {
  background: linear-gradient(145deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid #c00;
}

.license-plate-card.plate-de-provisional .country-flag-section-card {
  display: none;
}

.license-plate-card.plate-de-provisional .license-plate-number-card {
  padding-left: 8px !important;
}

.license-plate-card.plate-de-provisional .license-plate-number-card strong {
  color: #c00 !important;
}

.license-plate-card.plate-ua-provisional {
  background: #c00;
  border: 1px solid #000;
}

.license-plate-card.plate-ua-provisional .license-plate-number-card strong {
  color: #fff !important;
}

.license-plate-card.plate-gb-permanent {
  background: #ffd700;
  border: 1px solid #000;
}

.license-plate-card.plate-gb-permanent .country-flag-section-card {
  display: none;
}

.license-plate-card.plate-gb-permanent .license-plate-number-card {
  padding-left: 8px !important;
}

.license-plate-card.plate-gb-provisional {
  background: #fff;
  border: 1px solid #c00;
}

.license-plate-card.plate-gb-provisional .country-flag-section-card {
  display: none;
}

.license-plate-card.plate-gb-provisional .license-plate-number-card {
  padding-left: 8px !important;
}

.license-plate-card.plate-gb-provisional .license-plate-number-card strong {
  color: #c00 !important;
}

/* Generic plates (non-EU) flag emoji styles */
.license-plate-card.plate-generic .country-flag-section-card {
  background: #fff;
  border-right: 1px solid #e0e0e0;
}

.license-plate-card.plate-generic .country-code-card {
  color: #333;
  text-shadow: none;
}

.license-plate-card.plate-generic .country-flag-emoji-card {
  font-size: 16px;
  line-height: 1;
  display: block;
}

/* EU Common Styles */
.eu-plate {
  background: linear-gradient(145deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid #000;
}

/* EU Section - pentru TOATE tipurile */
.eu-section {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 45px;
  background: #003399;
  border-right: 1px solid #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

/* Country flag emoji in EU section */
.eu-section .country-flag-emoji {
  font-size: 24px;
  line-height: 1;
  display: block;
}

.visual-license-plate .eu-section {
  width: 40px;
  padding: 3px;
}

.current-license-plate .eu-section,
.preview-license-plate .eu-section {
  width: 45px;
  padding: 4px;
}

/* EU Flag */
.eu-flag-svg {
  width: 24px;
  height: 24px;
  background-image: url("https://olimpiaparking.com/wp-content/uploads/2025/05/european-flag-svgrepo-com.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: brightness(0) saturate(100%) invert(84%) sepia(75%) saturate(2000%)
    hue-rotate(15deg) brightness(95%) contrast(90%);
}

.visual-license-plate .eu-flag-svg {
  width: 20px;
  height: 20px;
}

.current-license-plate .eu-flag-svg,
.preview-license-plate .eu-flag-svg {
  width: 24px;
  height: 24px;
}

/* Country code */
.country-code {
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  margin-top: 2px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
}

.visual-license-plate .country-code {
  font-size: 9px;
}

.current-license-plate .country-code,
.preview-license-plate .country-code {
  font-size: 10px;
}

/* License plate numbers */
.license-plate-number {
  flex: 1;
  text-align: center;
  padding-left: 55px;
  padding-right: 10px;
}

.visual-license-plate .license-plate-number,
.current-license-plate .license-plate-number,
.preview-license-plate .license-plate-number {
  padding-left: 55px;
  padding-right: 10px;
}

/* License plate text */
.license-plate-number strong {
  font-size: 17px !important;
  font-weight: 900 !important;
  color: #000 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
  font-family: "Arial", sans-serif !important;
}

.visual-license-plate .license-plate-number strong {
  font-size: 18px !important;
}

.current-license-plate .license-plate-number strong,
.preview-license-plate .license-plate-number strong {
  font-size: 20px !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Red text for provisional plates */
.red-text .license-plate-number strong {
  color: #c00 !important;
}

/* Preview sections in forms */
#license-plate-preview-step4 .license-plate,
#license-preview .license-plate,
#preview-plate-container-step4 .license-plate,
#preview-plate-container .license-plate {
  height: 60px !important;
  border-radius: 6px !important;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  max-width: 300px !important;
}

/* Grid layouts */
.license-plates-grid-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.license-plates-grid-mini .license-plate {
  cursor: pointer;
  transition: all 0.3s ease;
}

.license-plates-grid-mini .license-plate:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.license-plates-grid-mini .license-plate.selected {
  border-color: #fc7f00;
  box-shadow: 0 0 0 3px rgba(252, 127, 0, 0.3);
  transform: scale(1.05);
}

/* License plates grid - pentru pagina numere-înmatriculare */
.license-plates-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

/* License plate item with delete button */
.license-plate-item {
  position: relative;
  transition: transform 0.2s ease;
}

.license-plate-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Delete button styling */
/* Delete button styling */
.license-plate-actions {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  pointer-events: none;
}

.license-plate-item:hover .license-plate-actions {
  opacity: 1;
  pointer-events: auto;
}

.delete-license-plate,
button.delete-license-plate,
button.delete-license-plate[type="button"],
.license-plate-actions button.delete-license-plate {
  background: rgba(252, 127, 0, 0.95) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px !important;
  width: 100% !important;
  height: 100% !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s ease !important;
  padding: 0 !important;
  line-height: 1 !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  backdrop-filter: blur(2px) !important;
  margin: 0 !important;
  min-width: auto !important;
  max-width: none !important;
  min-height: auto !important;
  max-height: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  outline: none !important;
  text-decoration: none !important;
  text-align: center !important;
  vertical-align: middle !important;
  background-image: none !important;
}

.delete-license-plate:hover,
button.delete-license-plate:hover,
button.delete-license-plate[type="button"]:hover,
.license-plate-actions button.delete-license-plate:hover {
  background: rgba(224, 102, 0, 1) !important;
  transform: scale(1.02) !important;
  color: #fff !important;
  border: none !important;
}

.delete-license-plate:active,
button.delete-license-plate:active,
button.delete-license-plate[type="button"]:active,
.license-plate-actions button.delete-license-plate:active {
  transform: scale(0.98) !important;
  background: rgba(200, 89, 0, 1) !important;
}

.delete-license-plate::before,
button.delete-license-plate::before,
button.delete-license-plate[type="button"]::before,
.license-plate-actions button.delete-license-plate::before {
  content: "ȘTERGE" !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  display: block !important;
  font-family: Arial, sans-serif !important;
}

/* Remove any focus styles */
.delete-license-plate:focus,
button.delete-license-plate:focus,
button.delete-license-plate[type="button"]:focus,
.license-plate-actions button.delete-license-plate:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Hide the license plate number on hover */
.license-plate-item:hover .license-plate-visual {
  opacity: 0.1;
  transition: opacity 0.3s ease;
}

/* Ensure the delete button appears above the faded plate */
.license-plate-item {
  position: relative;
  transition: transform 0.2s ease;
}

.license-plate-item .license-plate-visual {
  transition: opacity 0.3s ease;
  position: relative;
  z-index: 1;
}

.license-plate-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments for delete button */
@media (max-width: 768px) {
  .delete-license-plate::before,
  button.delete-license-plate::before,
  button.delete-license-plate[type="button"]::before,
  .license-plate-actions button.delete-license-plate::before {
    font-size: 12px !important;
  }

  .license-plate-item:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .delete-license-plate::before,
  button.delete-license-plate::before,
  button.delete-license-plate[type="button"]::before,
  .license-plate-actions button.delete-license-plate::before {
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
  }
}

/* Plate type radio selection */
.plate-type-radio-options {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.plate-type-radio-option {
  position: relative;
  cursor: pointer;
  flex: 1;
  min-width: 200px;
}

.plate-type-radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.plate-type-visual {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.plate-type-radio-option input[type="radio"]:checked ~ .plate-type-visual {
  border-color: #fc7f00;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(252, 127, 0, 0.2);
}

.plate-type-radio-option:hover .plate-type-visual {
  border-color: #fc7f00;
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.plate-type-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-top: 10px;
}

/* License plate preview sections */
.license-plate-preview,
.license-preview-section {
  margin: 20px 0;
  text-align: center;
}

.license-plate-preview h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

/* Current license section in popups */
.current-license-section {
  margin-bottom: 20px;
  text-align: center;
}

/* Preview sections in forms and popups - centered */
#license-plate-preview-step4 .license-plate,
#license-preview .license-plate,
#preview-plate-container-step4 .license-plate,
#preview-plate-container .license-plate,
.parking-license-popup .license-plate,
.parking-qr-popup .license-plate,
.parking-edit-popup .license-plate {
  margin: 0 auto;
  width: auto;
}

/* License plates in reservation cards */
.parking-card-vehicle .parking-card-value {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.parking-card-plate {
  flex: 1;
  min-width: 0;
}

/* Fallback text display */
.license-plate-text {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

/* Responsive - DOAR pentru clasa .license-plate */
@media (max-width: 1024px) {
  .license-plates-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .license-plates-grid-mini {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  /* Grid layouts */
  .license-plates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .license-plates-grid-mini {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Plate type options */
  .plate-type-radio-options {
    flex-direction: column;
    gap: 10px;
  }

  .plate-type-radio-option {
    width: 100%;
  }

  /* License plates se micșorează */
  .license-plate {
    height: 45px;
    max-width: 100%;
  }

  .license-plate .license-plate-number strong {
    font-size: 18px !important;
    letter-spacing: 2px !important;
  }

  .license-plate .eu-section {
    width: 40px;
  }

  .license-plate .eu-flag-svg {
    width: 20px;
    height: 20px;
  }

  .license-plate .country-flag-emoji,
  .eu-section .country-flag-emoji {
    font-size: 20px;
  }

  .license-plate .license-plate-number {
    padding-left: 50px;
  }

  /* Card plates rămân la aceeași dimensiune */
  .license-plate-card {
    height: 35px;
  }

  .card-license-plate-wrapper {
    max-width: 160px;
  }

  /* License plate numbers */
  .license-plate-number {
    flex: 1;
    text-align: center;
    padding-left: 52px;
    padding-right: 10px;
  }

  .visual-license-plate .license-plate-number,
  .current-license-plate .license-plate-number,
  .preview-license-plate .license-plate-number {
    padding-left: 52px;
    padding-right: 10px;
  }
}

@media (max-width: 480px) {
  /* Grid layouts - 2 columns on mobile */
  .license-plates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .license-plates-grid-mini {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* License plates se micșorează și mai mult */
  .license-plate {
    height: 40px;
  }

  .license-plate .license-plate-number strong {
    font-size: 14px !important;
    letter-spacing: 1px !important;
  }

  .license-plate .eu-section {
    width: 35px;
  }

  .license-plate .eu-flag-svg {
    width: 18px;
    height: 18px;
  }

  .license-plate .country-flag-emoji,
  .eu-section .country-flag-emoji {
    font-size: 18px;
  }

  .license-plate .country-code {
    font-size: 8px;
  }

  .license-plate .license-plate-number {
    padding-left: 40px;
    padding-right: 5px;
  }

  /* Card plates - micșorare ușoară pe mobile */
  .license-plate-card {
    height: 32px;
  }

  .card-license-plate-wrapper {
    max-width: 140px;
  }

  .license-plate-number-card strong {
    font-size: 15px !important;
  }

  .country-flag-section-card {
    width: 28px;
  }

  .eu-flag-svg-card {
    width: 14px;
    height: 14px;
  }

  .country-flag-emoji-card {
    font-size: 14px;
  }

  .country-code-card {
    font-size: 6px;
  }

  .license-plate-number-card {
    padding-left: 32px;
  }

  /* Delete button smaller on mobile */
  .delete-license-plate {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .delete-license-plate::before {
    font-size: 20px;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .license-plate {
    height: 35px;
  }

  .license-plate .license-plate-number strong {
    font-size: 16px !important;
    letter-spacing: 0.5px !important;
  }

  /* Card plates - dimensiune minimă */
  .license-plate-card {
    height: 30px;
  }

  .card-license-plate-wrapper {
    max-width: 130px;
  }

  .license-plate-number-card strong {
    font-size: 15px !important;
    letter-spacing: 0.5px !important;
  }
}

/* Responsive adjustments for delete button */
@media (max-width: 768px) {
  /* On mobile, tap to show delete button */
  .license-plate-item.show-delete .license-plate-actions {
    opacity: 1;
    pointer-events: auto;
  }

  .license-plate-item.show-delete .license-plate-visual {
    opacity: 0.1;
  }

  .delete-license-plate::before,
  button.delete-license-plate::before,
  button.delete-license-plate[type="button"]::before,
  .license-plate-actions button.delete-license-plate::before {
    font-size: 12px !important;
  }

  .license-plate-item:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .delete-license-plate::before,
  button.delete-license-plate::before,
  button.delete-license-plate[type="button"]::before,
  .license-plate-actions button.delete-license-plate::before {
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
  }
}
