*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  padding: 20px;
  background-color: #f9f9f9;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}

.description {
  text-align: center;
  margin-bottom: 30px;
  color: #666;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #555;
}

input[type="text"], 
input[type="color"], 
input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  border-color: #4CAF50;
  outline: none;
}

input[type="file"] {
  padding: 5px;
}

.color-picker-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.color-picker {
  width: 60px;
  height: 40px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

.color-input {
  flex: 1;
  font-family: monospace;
  text-transform: uppercase;
}

.color-info {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin: 15px 0;
  transition: background-color 0.3s;
  display: block;
  width: 100%;
}

button:hover {
  background-color: #45a049;
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.preview-section {
  margin: 30px 0;
  padding: 20px;
  border: 1px dashed #ddd;
  border-radius: 4px;
  background-color: #fafafa;
}

.preview-section h3 {
  margin-top: 0;
  color: #555;
  margin-bottom: 15px;
}

.banner-preview {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  margin: 10px auto;
}

.banner-size {
  text-align: center;
  margin-bottom: 10px;
}

.banner-small {
  width: 88px;
  height: 31px;
  display: inline-block;
  position: relative;
  overflow: hidden;
  background-color: #fff;
}

.banner-large {
  width: 234px;
  height: 60px;
  display: inline-block;
  position: relative;
  overflow: hidden;
  background-color: #fff;
}

.banner-content {
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
}

.banner-image-small {
  width: 31px;
  height: 31px;
  object-fit: cover;
  flex-shrink: 0;
}

.banner-image-large {
  width: 60px;
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
}

.banner-text-small {
  flex: 1;
  padding: 2px;
  font-size: 8px;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  line-height: 1;
}

.banner-text-large {
  flex: 1;
  padding: 5px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  line-height: 1.2;
}

.banner-text-only-small {
  width: 88px;
  height: 31px;
  padding: 2px;
  font-size: 8px;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  line-height: 1;
}

.banner-text-only-large {
  width: 234px;
  height: 60px;
  padding: 5px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  line-height: 1.2;
}

.crop-container {
  position: relative;
  max-width: 400px;
  margin: 20px 0;
}

.crop-area {
  position: relative;
  width: 300px;
  height: 300px;
  border: 2px solid #4CAF50;
  margin: 0 auto;
  overflow: hidden;
  cursor: move;
}

.crop-image {
  position: absolute;
  max-width: none;
  max-height: none;
}

.crop-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.crop-controls label {
  font-size: 14px;
  margin-bottom: 5px;
}

.crop-controls input[type="range"] {
  width: 200px;
  margin-bottom: 10px;
}

.crop-controls .crop-btn {
  display: inline-block;
  margin: 0 5px;
}

.crop-btn {
  padding: 5px 10px;
  font-size: 12px;
  width: auto;
  margin: 0;
}

.download-section {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.download-btn {
  background-color: #2196F3;
  flex: 1;
}

.download-btn:hover {
  background-color: #0b7dda;
}

.hidden {
  display: none;
}

.error-message {
  color: #d32f2f;
  background-color: #ffebee;
  padding: 10px;
  border-radius: 4px;
  margin: 15px 0;
  border-left: 4px solid #f44336;
}

.section-divider {
  margin: 30px 0;
  border: 0;
  height: 1px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
}

.size-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.size-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.size-control label {
  font-size: 14px;
  margin-bottom: 5px;
}

.size-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
}

.size-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4CAF50;
  cursor: pointer;
  border: none;
}

.position-controls {
  display: flex;
  gap: 20px;
  align-items: center;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
  margin-bottom: 0;
}

.radio-label input[type="radio"] {
  width: auto;
  margin: 0;
}

.banner-content-right {
  flex-direction: row-reverse;
}

.border-settings {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.border-width-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.border-width-control label {
  font-size: 14px;
  margin-bottom: 5px;
}


.banner-setting-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.banner-preview-section {
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f9f9f9;
  text-align: center;
}

.banner-preview-section h5 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 14px;
  font-weight: bold;
}

.banner-preview-individual {
  margin: 15px 0;
  padding: 10px;
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-btn-individual {
  width: 100%;
  background-color: #2196F3;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin: 10px 0 0 0;
  transition: background-color 0.3s;
}

.download-btn-individual:hover {
  background-color: #0b7dda;
}

.banner-setting-group {
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fafafa;
}

.banner-setting-group h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
  font-weight: bold;
}

.banner-settings-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .banner-setting-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .banner-preview-section {
    flex: none;
    max-width: none;
    width: 100%;
  }
  
  .banner-setting-group {
    max-width: none;
    width: 100%;
  }
}

@media (min-width: 769px) {
  .banner-setting-row {
    flex-direction: row;
    gap: 20px;
  }
  
  .banner-setting-group {
    flex: 1;
    min-width: 0;
  }
  
  .banner-preview-section {
    flex: 0 0 300px;
  }
}