/* BNR VIN Decoder Block Styles */

.bnr-vd-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
}

/* Background overlay */
.bnr-vd-container::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 200px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100'%3E%3Cpath d='M20 20h160v60H20z' fill='none' stroke='%23e0e0e0' stroke-width='1' opacity='0.3'/%3E%3Cpath d='M30 30h140v40H30z' fill='none' stroke='%23e0e0e0' stroke-width='1' opacity='0.2'/%3E%3C/svg%3E") no-repeat;
  background-size: contain;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

/* Title */
.bnr-vd-title {
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin: 0 0 16px 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Description */
.bnr-vd-description {
  font-size: 16px;
  color: #666;
  text-align: center;
  margin: 0 0 40px 0;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* Form Section */
.bnr-vd-form-section {
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

.bnr-vd-form {
  max-width: 600px;
  margin: 0 auto;
}

.bnr-vd-input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.bnr-vd-input-group input {
  flex: 1;
  padding: 16px 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bnr-vd-input-group input:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.bnr-vd-input-group input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  color: #999;
}

.bnr-vd-button {
  padding: 16px 32px;
  background: #007cba;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
}

.bnr-vd-button:hover {
  background: #005a87;
  transform: translateY(-1px);
}

.bnr-vd-button:active {
  transform: translateY(0);
}

.bnr-vd-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Example */
.bnr-vd-example {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.bnr-vd-example-text {
  font-size: 14px;
  color: #333;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
}

.bnr-vd-help-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007cba;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
  transition: background-color 0.3s ease;
}

.bnr-vd-help-icon:hover {
  background: #005a87;
}

/* Loading State */
.bnr-vd-loading {
  text-align: center;
  padding: 40px 20px;
}

.bnr-vd-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007cba;
  border-radius: 50%;
  animation: bnr-vd-spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes bnr-vd-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.bnr-vd-loading p {
  color: #666;
  margin: 0;
  font-size: 16px;
}

/* Results Section */
.bnr-vd-results {
  background: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-radius: 12px;
  padding: 24px;
  margin-top: 32px;
}

.bnr-vd-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e1e5e9;
}

.bnr-vd-results-header h2 {
  margin: 0;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.bnr-vd-clear-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.bnr-vd-clear-btn:hover {
  background: #c82333;
}

.bnr-vd-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.bnr-vd-result-section {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bnr-vd-result-section h3 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 18px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 2px solid #007cba;
}

.bnr-vd-result-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bnr-vd-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f3f4;
}

.bnr-vd-result-item:last-child {
  border-bottom: none;
}

.bnr-vd-result-label {
  font-weight: 500;
  color: #666;
  font-size: 14px;
}

.bnr-vd-result-value {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

/* Error Section */
.bnr-vd-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 20px;
  margin-top: 32px;
}

.bnr-vd-error-content {
  text-align: center;
}

.bnr-vd-error-content h3 {
  margin: 0 0 12px 0;
  color: #721c24;
  font-size: 18px;
}

.bnr-vd-error-content p {
  margin: 0 0 16px 0;
  color: #721c24;
  font-size: 14px;
}

.bnr-vd-retry-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.bnr-vd-retry-btn:hover {
  background: #c82333;
}

/* Editor Styles */
.bnr-vd-editor-placeholder {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  background: #f9f9f9;
  min-height: 400px;
}

.bnr-vd-editor-preview {
  max-width: 100%;
  background: white;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #ddd;
}

.bnr-vd-preview-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin: 0 0 12px 0;
  text-align: center;
}

.bnr-vd-preview-description {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin: 0 0 24px 0;
  line-height: 1.4;
}

.bnr-vd-preview-form {
  max-width: 500px;
  margin: 0 auto 24px;
}

.bnr-vd-preview-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.bnr-vd-preview-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f8f9fa;
  font-size: 14px;
  color: #999;
}

.bnr-vd-preview-button {
  padding: 12px 24px;
  background: #007cba;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: default;
}

.bnr-vd-preview-example {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.bnr-vd-preview-example-text {
  font-size: 12px;
  color: #333;
  text-decoration: underline;
  text-decoration-style: dashed;
}

.bnr-vd-preview-help-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #007cba;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
}

.bnr-vd-preview-results {
  background: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
}

.bnr-vd-preview-results h3 {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.bnr-vd-preview-result-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid #e1e5e9;
}

.bnr-vd-preview-result-item:last-child {
  border-bottom: none;
}

.bnr-vd-preview-result-item strong {
  color: #666;
}

.bnr-vd-preview-note {
  text-align: center;
  color: #666;
  font-size: 12px;
  margin: 16px 0 0 0;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  .bnr-vd-container {
    padding: 24px 16px;
  }
  
  .bnr-vd-title {
    font-size: 28px;
  }
  
  .bnr-vd-description {
    font-size: 15px;
  }
  
  .bnr-vd-input-group {
    flex-direction: column;
    gap: 12px;
  }
  
  .bnr-vd-button {
    width: 100%;
    padding: 16px;
  }
  
  .bnr-vd-results-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .bnr-vd-result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .bnr-vd-result-value {
    text-align: left;
    max-width: 100%;
  }
  
  .bnr-vd-results-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .bnr-vd-clear-btn {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .bnr-vd-container {
    padding: 20px 12px;
  }
  
  .bnr-vd-title {
    font-size: 24px;
  }
  
  .bnr-vd-description {
    font-size: 14px;
  }
  
  .bnr-vd-input-group input {
    padding: 14px 16px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .bnr-vd-button {
    padding: 14px 16px;
    font-size: 16px;
  }
  
  .bnr-vd-results {
    padding: 16px;
  }
  
  .bnr-vd-result-section {
    padding: 16px;
  }
}

/* Wide and Full Width Support */
.bnr-vd-container.alignwide {
  max-width: 1200px;
}

.bnr-vd-container.alignfull {
  max-width: 100%;
  margin: 0;
  border-radius: 0;
}

.bnr-vd-container.alignfull {
  padding: 48px 24px;
}

@media (min-width: 1200px) {
  .bnr-vd-container.alignwide {
    padding: 48px 24px;
  }
  
  .bnr-vd-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Print Styles */
@media print {
  .bnr-vd-container {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .bnr-vd-button,
  .bnr-vd-clear-btn,
  .bnr-vd-retry-btn {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
  }
  
  .bnr-vd-loading,
  .bnr-vd-error {
    display: none !important;
  }
}
