/* Enhanced styles for Barcode Labels Plugin v2.0 */

/* Batch Generator Modal */
.blcw-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.blcw-modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.blcw-modal-content h3 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 24px;
}

.blcw-modal-content label {
  display: block;
  margin-bottom: 15px;
  font-weight: 600;
  color: #34495e;
}

.blcw-modal-content input,
.blcw-modal-content select,
.blcw-modal-content textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  margin-top: 5px;
}

.blcw-modal-content textarea {
  font-family: monospace;
  resize: vertical;
}

.blcw-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* EAN-13 Validation Helpers */
.blcw-helper {
  margin-top: 5px;
  padding: 5px;
  background: #f8f9fa;
  border-radius: 3px;
}

.blcw-helper small {
  color: #6c757d;
  font-size: 12px;
}

.blcw-btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  margin-top: 5px;
  margin-right: 5px;
}

/* Validation Error Styles */
.blcw-data-grid tr.has-error {
  background-color: #ffe6e6;
}

.blcw-data-grid td.error {
  border: 2px solid #e74c3c;
  background-color: #ffebee;
}

/* Enhanced Format Selector */
.blcw-properties optgroup {
  font-weight: bold;
  font-style: normal;
  color: #2c3e50;
}

.blcw-properties optgroup option {
  font-weight: normal;
  padding-left: 10px;
}

/* Barcode Format Badge */
.blcw-format-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #3498db;
  color: white;
  border-radius: 3px;
  font-size: 11px;
  margin-left: 5px;
}

/* Improved Quick Fields */
.blcw-quick-add {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.blcw-quick-add h3 {
  margin-top: 0;
  color: #2c3e50;
}

#blcw-quick-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

#blcw-quick-fields label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  color: #34495e;
}

#blcw-quick-fields input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* Enhanced Data Table */
.blcw-data-grid-wrap {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.blcw-grid-toolbar {
  padding: 15px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  gap: 10px;
  align-items: center;
}

.blcw-data-grid {
  overflow-x: auto;
}

.blcw-data-grid table {
  width: 100%;
  border-collapse: collapse;
}

.blcw-data-grid th {
  background: #34495e;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.blcw-data-grid td {
  padding: 10px;
  border-bottom: 1px solid #e9ecef;
}

.blcw-data-grid td[contenteditable] {
  cursor: text;
  transition: background 0.2s;
}

.blcw-data-grid td[contenteditable]:hover {
  background: #f8f9fa;
}

.blcw-data-grid td[contenteditable]:focus {
  outline: 2px solid #3498db;
  background: #fff;
}

.blcw-data-grid button {
  padding: 5px 10px;
  margin: 0 2px;
  border: none;
  background: #6c757d;
  color: white;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
}

.blcw-data-grid button:hover {
  background: #5a6268;
}

/* Success/Error States */
.blcw-success {
  color: #27ae60;
  padding: 15px;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  margin: 15px 0;
}

/* Toast Notifications */
.blcw-toast.is-warning {
  background: #f39c12;
}

.blcw-toast.is-info {
  background: #3498db;
}

/* Responsive Improvements */
@media (max-width: 768px) {
  .blcw-modal-content {
    padding: 20px;
    max-width: 95%;
  }
  
  #blcw-quick-fields {
    grid-template-columns: 1fr;
  }
  
  .blcw-grid-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Loading States */
.blcw-loading {
  position: relative;
}

.blcw-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Enhanced Button Styles */
.blcw-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.blcw-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.blcw-btn-secondary {
  background: #6c757d;
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.blcw-btn-secondary:hover {
  background: #5a6268;
}

.blcw-btn-ghost {
  background: transparent;
  border: 2px solid #e74c3c;
  color: #e74c3c;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.blcw-btn-ghost:hover {
  background: #e74c3c;
  color: white;
}

/* Barcode Preview Enhancement */
.blcw-el {
  transition: box-shadow 0.2s;
}

.blcw-el.is-selected {
  box-shadow: 0 0 0 3px #3498db;
}

/* Property Panel Enhancements */
.blcw-properties {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 10px;
}

.blcw-properties::-webkit-scrollbar {
  width: 8px;
}

.blcw-properties::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.blcw-properties::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.blcw-properties::-webkit-scrollbar-thumb:hover {
  background: #555;
}


/* ===== PRO UI Upgrade ===== */
.blcw-app-wrapper{
    border-radius:18px;
    padding:20px;
    background:#fff;
    box-shadow:0 10px 30px rgba(0,0,0,.08);
}
.blcw-toolbar{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-bottom:20px;
}
.blcw-btn{
    border:none;
    border-radius:12px;
    padding:12px 18px;
    cursor:pointer;
    font-weight:600;
}
.rtl .blcw-app-wrapper{
    direction:rtl;
}
