* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* App container */
.app-container {
  display: flex;
  width: 90%;
  max-width: 90vw;
  height: 80vh;
  background-color: white;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  border-radius: 10px;
  overflow: hidden;
}

/* Input section */
.input-section {
  width: 50%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border-right: solid 1px #ddd;
}

.file-controls {
  display: flex;
  gap: 10px;
}

#imageUpload {
  flex-grow: 1;
}

#codeData {
  flex-grow: 1;
  width: 100%;
  resize: none;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

/* Output section */
.output-section {
  width: 50%;
  background-color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  gap: 15px;
}

.invert-checkbox {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Buttons and inputs */
button, input[type="file"] {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f8f8f8;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #e8e8e8;
}

/* Spinner */
.spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner-inner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
  .app-container {
    width: 95%;
    flex-direction: column;
    height: auto;
  }
  
  .input-section, .output-section {
    width: 100%;
    height: 50vh;
  }
}