/* Base layout */
.image-crop-rotate-page {
  padding: 1rem;
  color: #fff;
  background-color: #121212;
  max-width: 960px;
  margin: 0 auto;
  font-family: sans-serif;
}

.image-crop-rotate-page h1 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* Upload Section */
.upload-section {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.2rem;
}

/* Workspace */
.image-workspace {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}




.canvas-container {
  flex: 1 1 60%;
  background: #222;
  padding: 0.5rem;
  border: 1px solid #333;
  border-radius: 4px;
  position: relative;
}
.canvas-container canvas {
  width: 100%;
  height: auto;
  display: block;
}
.preview-container {
  flex: 1 1 35%;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Preview Canvas */
#previewCanvas {
  width: 100%;
  height: auto;
  max-height: 300px;
  background-color: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px;
  display: block;
  margin-bottom: 0.5rem;
}


/* Controls Panel */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 1rem;
  justify-content: space-between;
}

.control-group {
  flex: 1 1 300px;
  background: #1b1b1b;
  border: 1px solid #333;
  padding: 1rem;
  border-radius: 6px;
}
.control-group2 {
  flex: 1 1 50px;
  padding: 5px;
}

.control-group legend {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.control-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

.crop-preset-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.crop-preset-buttons button {
  padding: 0.4rem;
  font-size: 0.9rem;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.crop-preset-buttons button small {
  display: block;
  font-size: 0.7rem;
  color: #aaa;
}

.custom-crop-inputs {
  margin-top: 0.5rem;
}

.custom-crop-inputs input[type="number"] {
  width: 60px;
  padding: 0.3rem;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  margin-top: 0.5rem;
  gap: 0.3rem;
}

.rotate-buttons,
.flip-buttons,
.reset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

button {
  padding: 0.4rem 0.7rem;
  border: none;
  background-color: #333;
  color: white;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

button:hover {
  background-color: #444;
}

input[type="range"] {
  width: 100%;
}

#zoomValue {
  margin-left: 0.5rem;
  font-weight: bold;
}

/* Export controls */
.export-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.export-controls .control-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.export-controls input[type="text"],
.export-controls select,
.export-controls input[type="range"] {
  width: 100%;
  padding: 0.3rem;
  border-radius: 4px;
  border: 1px solid #555;
  background-color: #1e1e1e;
  color: #fff;
}

/* How-to-Use Section */
.tool-section.how-to-use {
  background: #1a1a1a;
  border-top: 2px solid #333;
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 6px;
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.tool-section.how-to-use h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  border-bottom: 1px solid #333;
  padding-bottom: 0.3rem;
}
.tool-section.how-to-use ul {
  list-style: disc;
  padding-left: 1.75rem;
}
.tool-section.how-to-use ul ul {
  list-style: circle;
  margin-top: 0.3rem;
}
.tool-section.how-to-use li {
  margin-bottom: 0.6rem;
}
.tool-section.how-to-use code {
  background: #2c2c2c;
  color: #ffc66d;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: Consolas, monospace;
  font-size: 0.9em;
}
.tool-section.how-to-use li:hover {
  color: #fff;
  transition: color 0.2s;
}




/* Upload Section */
.upload-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}
.upload-section input[type="file"] {
  background-color: #1e1e1e;
  color: #fff;
  padding: 0.4rem 0.6rem;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  max-width: 250px;
}
.upload-section button {
  padding: 0.4rem 1rem;
  background-color: #333;
  border: 1px solid #555;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}
.upload-section button:disabled {
  background-color: #222;
  color: #777;
  cursor: not-allowed;
}
.upload-section button:hover:not(:disabled) {
  background-color: #444;
}
