* {
  margin: 0;
  padding: 0;

}

body {
  background: linear-gradient(135deg, #f1f2f3 0%, #e5e7eb 100%);
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1560px;
  min-width: 1240px;
  color: #333;
  margin: 20px auto;
  position: relative;
}

.container *{
  box-sizing: border-box;
}

header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-top: 20px;
}

h1 {
  font-size: 2.1rem;
  margin-bottom: 5px;
}

.subtitle {
  font-size: 1rem;
  color: #5a6268;
  max-width: 95%;
  margin: 0 auto;
}

.content {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.upload-section {
  flex: 1;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #ced4da;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
}

.upload-section.active {
  border-color: #3498db;
  background-color: #e3f2fd;
  box-shadow: inset 0 0 20px rgba(52, 152, 219, 0.2);
}

.upload-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  color: #3498db;
  filter: drop-shadow(0 4px 6px rgba(52, 152, 219, 0.3));
}

.file-input {
  display: none;
}

.upload-btn {
  background: linear-gradient(to right, #3498db, #2c80b8);
  color: white;
  padding: 10px 20px;
  font-size: 1.1rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.file-info {
  margin-top: 15px;
  font-size: 0.95rem;
  color: #6c757d;
  text-align: center;
  line-height: 1.6;
  background: #e9ecef;
  padding: 10px 20px;
  border-radius: 8px;
  width: 100%;
  max-width: 400px;
}

.controls-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-group {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #eaeaea;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f1f2f3;
}

.control-icon {
  font-size: 1.5rem;
}

.direction-options {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.direction-option {
  flex: 1;
  border: 2px solid #e0e6ed;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.direction-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  border-color: #3498db;
}

.direction-option.selected {
  border-color: #3498db;
  background: #e3f2fd;
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.2);
  transform: scale(1.02);
}

.direction-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  transition: transform 0.3s;
}

.direction-option.selected .direction-icon {
  transform: scale(1.1);
}

.direction-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 8px;
}

.direction-desc {
  font-size: 0.9rem;
  color: #6c757d;
  line-height: 1.4;
}

.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.btn {
  flex: 1;
  padding: 16px;
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-2px);
}

.flip-btn {
  background: linear-gradient(to right, #2ecc71, #27ae60);
  color: white;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.flip-btn:hover {
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.flip-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.download-btn {
  background: linear-gradient(to right, #9b59b6, #8e44ad);
  color: white;
  box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.download-btn:hover {
  box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}

.download-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.reset-btn {
  background: linear-gradient(to right, #e74c3c, #c0392b);
  color: white;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.reset-btn:hover {
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

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

.preview-box {
  flex: 1;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #eaeaea;
  transition: all 0.3s;
}

.preview-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.preview-header {
  padding: 18px 25px;
  background: linear-gradient(to right, #f8f9fa, #e9ecef);
  border-bottom: 1px solid #eaeaea;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
}

.preview-content {
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #fcfcfc;
  position: relative;
  overflow: hidden;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s;
}

.preview-placeholder {
  color: #95a5a6;
  text-align: center;
  font-size: 1.1rem;
  padding: 20px;
}

.instructions {
  background: linear-gradient(to right, #fff8e1, #fff3cd);
  border-left: 4px solid #ffc107;
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.instructions h3 {
  margin-bottom: 20px;
  color: #e67e22;
  display: flex;
  align-items: center;
  gap: 10px;
}

.instructions ul {
  padding-left: 25px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
}

.instructions li {
  margin-bottom: 10px;
  padding-left: 10px;
}

footer {
  text-align: center;
  margin-top: 20px;
  color: #6c757d;
  font-size: 0.95rem;
  width: 100%;
}

.file-error {
  color: #e74c3c;
  margin-top: 15px;
  text-align: center;
  font-weight: 500;
  padding: 10px 20px;
  background: #fdecea;
  border-radius: 8px;
  border: 1px solid #fadbd8;
}

.image-info {
  position: absolute;
  bottom: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.tool-description {
  background: #e8f4fd;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  border-left: 4px solid #3498db;
}

.tool-description h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  color: #2c3e50;
}

.tool-description p {
  line-height: 1.7;
  color: #5a6268;
}
