:root {
  --primary-color: #4a6cf7;
  --primary-dark: #3a56d4;
  --secondary-color: #10b981;
  --light-color: #f8fafc;
  --dark-color: #1e293b;
  --gray-color: #64748b;
  --light-gray: #e2e8f0;
  --error-color: #ef4444;
  --success-color: #10b981;
  --transition: all 0.3s ease;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  color: var(--dark-color);
  line-height: 1.6;
  /* min-height: 100vh; */
  display: flex;
  flex-direction: column;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Styles */

/* Main Content Styles */
main {
  flex: 1;
  padding: 3rem 0;
}

.tool-container {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 800px;
  margin: 0 auto;
  margin-top: 100px;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--dark-color);
  text-align: center;
}

/* Input Section */
.input-section {
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--dark-color);
}

.input-field {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  font-size: 1rem;
  transition: var(--transition);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.input-hint {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-color);
}

/* Barcode Type Selection */
.barcode-type-section {
  margin-bottom: 2rem;
}

.type-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.type-option {
  border: 2px solid var(--light-gray);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.type-option:hover {
  border-color: var(--primary-color);
  background: rgba(74, 108, 247, 0.05);
}

.type-option.active {
  border-color: var(--primary-color);
  background: rgba(74, 108, 247, 0.1);
}

.type-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 5px;
}

.type-label {
  font-size: 0.9rem;
  color: var(--gray-color);
}

/* Customization Options */
.customization-section {
  margin-bottom: 2rem;
  border-top: 1px solid var(--light-gray);
  padding-top: 1.5rem;
}

.customization-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 1rem;
}

.customization-toggle i {
  transition: var(--transition);
}

.customization-toggle.active i {
  transform: rotate(90deg);
}

.customization-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.customization-content.active {
  max-height: 500px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 1rem;
}

.slider-container input {
  flex: 1;
}

.slider-value {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.color-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.color-preview {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.color-preview:hover {
  transform: scale(1.1);
}

.color-preview.active {
  border-color: var(--dark-color);
  transform: scale(1.1);
}

.color-label {
  font-size: 0.8rem;
  color: var(--gray-color);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.generate-btn,
.download-btn,
.clear-btn {
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  flex: 1;
  min-width: 150px;
  justify-content: center;
}

.generate-btn {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.3);
}

.generate-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.generate-btn:disabled {
  background: var(--light-gray);
  color: var(--gray-color);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.download-btn {
  background: var(--secondary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.download-btn:hover {
  background: #0da271;
  transform: translateY(-2px);
}

.download-btn:disabled {
  background: var(--light-gray);
  color: var(--gray-color);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.clear-btn {
  background: transparent;
  color: var(--gray-color);
  border: 2px solid var(--light-gray);
}

.clear-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border-color: var(--error-color);
}

/* Preview Section */
.preview-section {
  margin-top: 2rem;
}

.preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  min-height: 200px;
  padding: 2rem;
  border: 2px dashed var(--light-gray);
  border-radius: 12px;
  background: #f8fafc;
  transition: var(--transition);
}

.preview-container.has-barcode {
  border-color: var(--primary-color);
  background: rgba(74, 108, 247, 0.05);
}

#barcode {
  max-width: 100%;
  max-height: 150px;
  display: none;
}

.preview-placeholder {
  text-align: center;
  color: var(--gray-color);
}

.preview-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--light-gray);
}

.preview-info {
  text-align: center;
  margin-top: 1rem;
}

.preview-info h4 {
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.preview-info p {
  color: var(--gray-color);
  font-size: 0.9rem;
}

/* Alert Messages */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: none;
  align-items: center;
  gap: 10px;
}

.alert.error {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid var(--error-color);
  color: var(--error-color);
}

.alert.success {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success-color);
  color: var(--success-color);
}

/* Features Section */
.features-section {
  padding: 4rem 0;
  background: white;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--light-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.feature-card p {
  color: var(--gray-color);
}

/* Responsive Design */
@media (max-width: 768px) {
  .tool-container {
    padding: 1.5rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .generate-btn,
  .download-btn,
  .clear-btn {
    width: 100%;
  }

  .type-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    width: 95%;
    padding: 0 15px;
  }

  .tool-container {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 200px;
  background-color: var(--dark-color);
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85rem;
  font-weight: normal;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Range slider styling */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(74, 108, 247, 0.2);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
