* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 30px;
  background: linear-gradient(135deg, #0056b3 0%, #00bfff 50%, #ffa500 100%);
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 40px;
}

h2 {
  color: #333;
  margin-bottom: 30px;
  font-size: 32px;
  text-align: center;
  background: linear-gradient(135deg, #0056b3 0%, #00bfff 50%, #ffa500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.controls-section {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 30px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  align-items: end;
}

@media (max-width: 1200px) {
  .controls-section {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .controls-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.control-group input[type="file"] {
  padding: 10px;
  border: 2px dashed #0056b3;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.control-group input[type="file"]:hover {
  border-color: #ffa500;
  background: #fff8e1;
}

.sample-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  transition: all 0.3s;
  background: linear-gradient(135deg, #0056b3 0%, #00bfff 100%);
  border: none;
  cursor: pointer;
  min-width: 40px;
  height: 42px;
  box-shadow: 0 2px 4px rgba(0, 86, 179, 0.2);
}

.sample-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 86, 179, 0.4);
  background: linear-gradient(135deg, #004494 0%, #0099cc 100%);
}

.control-group select {
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.control-group select:focus {
  outline: none;
  border-color: #0056b3;
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.button-group {
  display: flex;
  gap: 15px;
  grid-column: 1 / -1;
  justify-content: center;
  margin-top: 10px;
}

button {
  padding: 14px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #0056b3 0%, #00bfff 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 86, 179, 0.4);
  background: linear-gradient(135deg, #004494 0%, #0099cc 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, #ffa500 0%, #ffff00 100%);
  color: #333;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(255, 165, 0, 0.4);
  background: linear-gradient(135deg, #e69400 0%, #e6e600 100%);
}

.products-section {
  margin-bottom: 30px;
}

.products-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.products-table thead {
  background: linear-gradient(135deg, #0056b3 0%, #00bfff 50%, #ffa500 100%);
  color: white;
}

.products-table th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.products-table td {
  padding: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.products-table tbody tr:hover {
  background: #f0f8ff;
}

.products-table tbody tr:last-child td {
  border-bottom: none;
}

.quantity-input {
  width: 80px;
  padding: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  transition: all 0.3s;
}

.quantity-input:focus {
  outline: none;
  border-color: #0056b3;
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

#barcodeArea {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  min-height: 200px;
}

.barcode-box {
  text-align: center;
  padding: 2px 8px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.barcode-box:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2);
}

.barcode-box div {
  margin: 2px 0;
  font-weight: 500;
  color: #333;
}

.barcode-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.small {
  width: 38mm;
  height: 25mm;
}

.medium {
  width: 50mm;
  height: 30mm;
}

.large {
  width: 70mm;
  height: 40mm;
}

@media print {
  body {
    background: white;
    padding: 0;
  }
  
  .container {
    box-shadow: none;
    padding: 0;
  }
  
  .controls-section,
  .products-section,
  .button-group {
    display: none;
  }
  
  body * {
    visibility: hidden;
  }
  
  #barcodeArea,
  #barcodeArea * {
    visibility: visible;
  }
  
  #barcodeArea {
    position: absolute;
    left: 0;
    top: 0;
    background: white;
    padding: 0;
  }
}

.hidden {
  display: none;
}
