/* BNR Bike Identifier Block Styles */

/* Reset any potential layout issues */
.bnr-bi-container * {
  box-sizing: border-box;
}

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

/* Title and Description */
.bnr-bi-title {
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin: 0 0 16px 0;
  text-align: center;
}

.bnr-bi-description {
  font-size: 16px;
  color: #666;
  text-align: center;
  margin: 0 0 40px 0;
  line-height: 1.5;
}

/* Upload Section */
.bnr-bi-upload-section {
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

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

/* Upload Area */
.bnr-bi-upload-area {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fafafa;
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  float: none;
  clear: both;
}

.bnr-bi-upload-area:hover {
  border-color: #007cba;
  background: #f0f8ff;
}

.bnr-bi-upload-area.bnr-bi-drag-over {
  border-color: #007cba;
  background: #e6f3ff;
  transform: scale(1.02);
}

.bnr-bi-upload-content {
  pointer-events: none;
}

.bnr-bi-upload-icon {
  color: #007cba;
  margin-bottom: 16px;
}

.bnr-bi-upload-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px 0;
}

.bnr-bi-upload-text {
  font-size: 16px;
  color: #666;
  margin: 0 0 8px 0;
}

.bnr-bi-upload-formats,
.bnr-bi-upload-size {
  font-size: 14px;
  color: #999;
  margin: 4px 0;
}

/* Preview Section */
.bnr-bi-preview {
  background: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.bnr-bi-preview-image {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.bnr-bi-preview-image img {
  max-width: 300px;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bnr-bi-remove-image {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dc3545;
  color: white;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.bnr-bi-remove-image:hover {
  background: #c82333;
}

.bnr-bi-preview-info {
  margin-bottom: 20px;
}

.bnr-bi-preview-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 4px 0;
}

.bnr-bi-preview-size {
  font-size: 14px;
  color: #666;
  margin: 0;
}

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

.bnr-bi-submit-btn:hover {
  background: #005a87;
  transform: translateY(-1px);
}

.bnr-bi-submit-btn:active {
  transform: translateY(0);
}

.bnr-bi-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

/* Loading State */
.bnr-bi-loading {
  text-align: center;
  padding: 40px 20px;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 20px 0;
}

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

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

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

.bnr-bi-loading-note {
  font-size: 14px;
  color: #999;
  margin: 0;
}

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

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

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

.bnr-bi-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-bi-clear-btn:hover {
  background: #c82333;
}

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

.bnr-bi-ai-response h4 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 18px;
  font-weight: 600;
}

.bnr-bi-response-text {
  line-height: 1.6;
}

.bnr-bi-result-line {
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #e1e5e9;
}

.bnr-bi-result-line.bnr-bi-highlight {
  background: #e6f3ff;
  border-left-color: #007cba;
  font-weight: 500;
}

.bnr-bi-timestamp {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e1e5e9;
  text-align: center;
}

.bnr-bi-timestamp small {
  color: #666;
  font-size: 12px;
}

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

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

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

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

.bnr-bi-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-bi-retry-btn:hover {
  background: #c82333;
}

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

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

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

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

.bnr-bi-preview-upload {
  margin-bottom: 24px;
}

.bnr-bi-preview-upload-area {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  background: #fafafa;
}

.bnr-bi-preview-upload-icon {
  color: #007cba;
  margin-bottom: 12px;
}

.bnr-bi-preview-upload-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 6px 0;
}

.bnr-bi-preview-upload-text {
  font-size: 14px;
  color: #666;
  margin: 0 0 6px 0;
}

.bnr-bi-preview-upload-formats,
.bnr-bi-preview-upload-size {
  font-size: 12px;
  color: #999;
  margin: 2px 0;
}

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

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

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

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

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

.bnr-bi-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-bi-container {
    padding: 24px 16px;
  }
  
  .bnr-bi-title {
    font-size: 28px;
  }
  
  .bnr-bi-description {
    font-size: 15px;
  }
  
  .bnr-bi-upload-area {
    padding: 30px 16px;
  }
  
  .bnr-bi-upload-title {
    font-size: 18px;
  }
  
  .bnr-bi-upload-text {
    font-size: 15px;
  }
  
  .bnr-bi-preview-image img {
    max-width: 250px;
    max-height: 150px;
  }
  
  .bnr-bi-results-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .bnr-bi-clear-btn {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .bnr-bi-container {
    padding: 20px 12px;
  }
  
  .bnr-bi-title {
    font-size: 24px;
  }
  
  .bnr-bi-description {
    font-size: 14px;
  }
  
  .bnr-bi-upload-area {
    padding: 24px 12px;
  }
  
  .bnr-bi-upload-title {
    font-size: 16px;
  }
  
  .bnr-bi-upload-text {
    font-size: 14px;
  }
  
  .bnr-bi-preview-image img {
    max-width: 200px;
    max-height: 120px;
  }
  
  .bnr-bi-submit-btn {
    padding: 14px 24px;
    font-size: 15px;
  }
  
  .bnr-bi-results {
    padding: 16px;
  }
  
  .bnr-bi-result-content {
    padding: 16px;
  }
}

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

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

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

@media (min-width: 1200px) {
  .bnr-bi-container.alignwide {
    padding: 48px 24px;
  }
}

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