.container {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  border-radius: 20px;
  padding: 15px;
}

h1 {
  color: #333;
  margin-bottom: 30px;
  text-align: center;
  font-size: 2.5em;
}

.upload-section {
  display: flex;
  margin-bottom: 30px;
}

.upload-box {
  border: 3px dashed #667eea;
  border-radius: 10px;
  width: 100%;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #f8f9ff;
}

.upload-box:hover {
  border-color: #764ba2;
  background: #f0f1ff;
}

.upload-box input {
  display: none;
}

.upload-icon {
  font-size: 3em;
  color: #667eea;
  margin-bottom: 10px;
}

.upload-text {
  color: #667eea;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.preview-section {
  margin: 30px 0;
  text-align: center;
}

#preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  display: none;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.control-group.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 600;
  margin-bottom: 8px;
  color: #555;
  font-size: 0.95em;
}

input[type="number"] {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input[type="number"]:focus {
  outline: none;
  border-color: #667eea;
}

.resize-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 10px;
}

.resize-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.resize-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.result-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 2px solid #eee;
  display: none;
}

.result-section.show {
  display: block;
}

.result-info {
  background: #f8f9ff;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  text-align: center;
}

.info-item {
  padding: 15px;
  background: white;
  border-radius: 8px;
}

.info-label {
  color: #888;
  font-size: 0.9em;
  margin-bottom: 5px;
}

.info-value {
  color: #333;
  font-size: 1.3em;
  font-weight: 700;
}

#resizedImage {
  max-width: 100%;
  max-height: 400px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  margin: 20px auto;
  display: block;
}

.download-btn {
  width: 100%;
  padding: 15px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 20px;
}

.download-btn:hover {
  background: #059669;
}

.loading {
  text-align: center;
  color: #667eea;
  font-weight: 600;
  margin-top: 20px;
}

.help-section {
  background-color: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-left: 5px solid #0d6efd;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 100px;
  margin: 10px;
}

.drop-zone {
  border-radius: 10px;
  text-align: center;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
  padding: 32px;
}

.drop-zone.dragover {
  background-color: #f0f8ff;
  border: 1px dotted #007bff;
  border-color: #007bff;
  color: #007bff;
}

.fileNameHeading {
  font-weight: bolder;
  font-size: 18px;
}

#selectedFileName {
  color: #007bff;
}

.back-svg-btn {
  align-items: center;
  gap: 6px;
  background: #ff0000;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0px 50px;
  cursor: pointer;
  color: #ffffff;
  font-size: 20px;
  transition: all 0.2s ease;
  width: 180px;
  height: 50px;
}

.back-svg-btn:hover {
  background: #960303;
  color: white;
  border-color: #007bff;
}

.hidden {
  display: none !important;
}

.show {
  display: block !important;
}

#preview {
  display: none;
}

#preview.show {
  display: block;
  margin: 0 auto;
}

.upload-box.hidden {
  display: none;
}

.backButton.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.backButton.show {
  display: inline-block;
  opacity: 1;
  pointer-events: all;
  transition: opacity 0.3s ease;
}

#loading {
  display: none;
}

#loading.show {
  display: flex;
}

#result {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#result.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dragover {
  border-color: #4caf50;
  background-color: #f0f8ff;
  transform: scale(1.02);
  transition: all 0.3s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.upload-box,
.backButton,
#preview {
  transition: all 0.3s ease;
}

.backButton {
  display: flex !important;
  justify-content: space-evenly;
  margin: 20px;
}

.help-section h3 {
  font-size: 22px;
  color: #0d6efd;
  margin-bottom: 15px;
}

.help-section p {
  color: #333;
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.help-section ul {
  padding-left: 20px;
  margin: 0;
}

.help-section li {
  margin-bottom: 10px;
  font-size: 1rem;
  line-height: 1.6;
}

.help-section hr {
  margin: 20px 0;
  border: none;
  border-top: 1px solid #ccc;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
    border-radius: 15px;
  }

  h1 {
    font-size: 1.8em;
    margin-bottom: 20px;
  }

  .upload-section {
    flex-direction: column;
  }

  .upload-box {
    padding: 20px;
    width: 90%;
  }

  #preview {
    max-height: 220px;
  }

  .controls {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }

  .control-group {
    width: 100%;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  #resizedImage {
    max-height: 300px;
  }

  .download-btn {
    font-size: 16px;
    padding: 12px;
  }

  .backButton {
    margin: 10px auto;
    width: 140px;
    height: 45px;
    font-size: 16px;
  }

  .help-section {
    padding: 20px !important;
  }

  .help-section h3 {
    font-size: 20px;
  }

  .help-section p,
  .help-section li {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.6em;
  }

  .upload-box {
    padding: 15px;
    width: 90%;
  }

  #preview {
    max-height: 180px;
  }

  .resize-btn {
    font-size: 16px;
    padding: 12px;
  }

  #resizedImage {
    max-height: 250px;
  }

  .download-btn {
    font-size: 16px;
  }
}
