.cursive {
  font-family: cursive;
}

* {
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 96dvh;
  padding: 1% 2%;
  font-family: sans-serif;
  background-color: #f4f4f4;
  color: #333;
  max-width: 1200px;
  margin: auto;
}

h2 {
  margin-bottom: 1rem;
}

hr {
  width: 104%;
  transform: translateX(-2%);
}

main {
  flex-grow: 1;
}

section {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

section.centered {
  text-align: center;
}

section.centered * {
  text-align: center;
}

section .flex {
  display: flex;
  align-items: center;
  gap: 15px;
}

.input-section, .output-section {
    margin-bottom: 2rem;
    border: 1px solid #eee;
    padding: 1.5rem;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.input-section p {
    text-align: center;
    margin: 1rem 0;
    font-weight: bold;
}

input[type="file"],
textarea {
    width: 100%;
    min-height: 64px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    display: flex;
    align-content: center;
    justify-content: center;
}

textarea {
    font-size: .8rem;
    resize: vertical;
}

.image-preview,
.svg-preview {
    color: #ccc;
    border: 1px dashed #ccc;
    min-height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
    background-color: #e9e9e9;
    border-radius: 4px;
    overflow: hidden;
}

.image-preview img,
.svg-preview svg {
    max-width: 80%;
    max-height: 192px;
    height: auto;
    display: block;
    shape-rendering: crispedges; /* Important to draw pixel perfect */
}

.image-size, .svg-size {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #555;
}

button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

button:hover:not(:disabled) {
    background-color: #0056b3;
}

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

.output-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
}

.output-section button {
    width: auto;
    display: inline-block;
    margin: 0;
    padding: 10px 15px;
    font-size: 1rem;
}

.output-section textarea {
    margin-bottom: 1rem;
}

.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  display: none; /* Hidden by default */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}