/* Barcode Generator Styles */

.barcode-container {
  padding: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.barcode-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 30px;
}

@media (max-width: 1400px) and (min-width: 1201px) {
  .barcode-layout {
    zoom: 0.9;
  }
}

@media (max-width: 1200px) {
  .barcode-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Sections */
.control-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid #3B82F6;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.05);
}
.control-section:nth-child(even) {
  border-top-color: #8B5CF6;
}
.section-title {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i {
  color: #3B82F6;
  font-size: 18px;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Inputs */
.input-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.styled-input, .styled-select {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 10px;
  outline: none;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.styled-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
}

.styled-input:focus, .styled-select:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: var(--bg-card-hover);
}

/* Design Grid */
.design-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.design-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  gap: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.color-input-wrapper input[type="color"] {
  appearance: none;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}
.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input-wrapper input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.color-input-wrapper span { font-size: 13px; color: var(--text-primary); font-family: monospace; }


/* Sliders */
.slider-group {
  margin-bottom: 16px;
}
.slider-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.slider-group span {
  color: var(--text-primary);
  font-weight: 600;
}

.styled-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
  border: 2px solid white;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider.round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(128, 128, 128, 0.3);
  transition: .4s;
  border-radius: 24px;
}
.slider.round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider.round { background-color: #10b981; }
input:checked + .slider.round:before { transform: translateX(20px); }

/* Preview Side */
.barcode-preview-side {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: inset 0 0 40px rgba(255,255,255,0.5);
}

.preview-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.barcode-canvas-container {
  background: white; /* Forced background for barcodes */
  padding: 24px 16px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 200px;
  margin-bottom: 24px;
  overflow: hidden;
}

#barcode-canvas {
  max-width: 100%;
  height: auto;
}
