body {
    background: #111;
    color: #eee;
    font-family: monospace;
    text-align: center;
    padding: 20px;
}

.container {
    background-color: #1a1a1a;
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 600px;
    width: 90vw;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
}

h1 {
    font-size: 28px;
    margin-bottom: 16px;
}

h2 {
    font-size: 22px;
    margin-bottom: 16px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: center;
}

.grid-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

button, input, label {
    margin: 8px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    font-family: Consolas, monospace;
    border-radius: 6px;
    border: none;
    background: #333;
    color: #eee;
    transition: background 0.2s ease;
}

button:hover {
    background-color: #444;
}

button.active {
    background-color: #555;
}

.image-container {
    margin-top: 20px;
    text-align: center;
    max-width: 100%;
}

#originalImage {
    max-width: 100%;
    max-height: 500px;
    display: none;
    width: auto;
    height: auto;
    border-radius: 8px;
}

.results {
    margin-top: 30px;
}

.grid-pieces-container {
    margin-top: 20px;
    text-align: center;
    justify-content: center;
    align-items: center;
}

.grid-pieces {
    display: inline-grid;
    gap: 1px;
    background-color: #333;
    border: 1px solid #666;
    border-radius: 8px;
    margin: 10px 0;
    max-width: 100%;
    padding: 10px;
    justify-content: center;
}

.grid-pieces img {
    display: block;
    background-color: #1a1a1a;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    margin: auto;
}

.download-all {
    margin-top: 20px;
    text-align: center;
}

.file-input {
    display: none;
}

.file-label {
    padding: 8px 16px;
    background-color: #333;
    color: #eee;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: Consolas, monospace;
    transition: background 0.2s ease;
}

.file-label:hover {
    background-color: #444;
}

p {
    font-size: 16px;
    color: #ccc;
    margin-bottom: 28px;
}

/* Container that holds the whole shortening tool */
.editor-container {
  background-color: #1a1a1a;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  margin: 30px auto;
  text-align: left;
}

.output {
  background-color: #1a1a1a;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  max-width: 650px;
  margin: 30px auto;
  text-align: left;
}

.output-section {
    margin: 8px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    font-family: Consolas, monospace;
    border-radius: 6px;
    border: none;
    background: #333;
    color: #eee;
    transition: background 0.2s ease;
}

/* Large text areas for input/output */
.code-box {
  width: 90vw;        /* width: 90% of the viewport width */
  height: 400px;      /* you can increase/decrease this */
  background-color: #1a1a1a;
  color: #eee;
  font-family: Consolas, monospace;
  font-size: 14px;
  padding: 12px;
  border: 1px solid #444;
  border-radius: 8px;
  resize: vertical;   /* allows user to resize vertically */
  overflow: auto;
  margin-bottom: 10px;
}


/* Button container below output */
.button-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}


.editor-container {
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 1000px;
}

textarea {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  padding: 15px;
  margin-bottom: 20px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.05);
  font-family: Consolas, monospace;
  background-color: white;
  box-sizing: border-box;
}

.button-row {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
