:root {
    --bg-color: #fafafa;
    --text-color: #111;
    --input-bg: #f9f9f9;
    --button-bg: #4CAF50;
    --button-hover-bg: #45a049;
    --border-color: #ccc;
  }
  [data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #f1f1f1;
    --input-bg: #1e1e1e;
    --button-bg: #6c63ff;
    --button-hover-bg: #5850ec;
    --border-color: #444;
  }
  body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: sans-serif;
    margin: 0;
    padding: 20px;
    transition: background 0.3s, color 0.3s;
  }
  #header {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  #themeToggleBtn {
    padding: 8px 16px;
    font-size: 14px;
    background-color: var(--button-bg);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
  }
  #container {
    display: flex;
    gap: 20px;
    align-items: stretch;
  }
  .fileselectors {
    max-height: 150px;
    display: flex;
    flex: 1;
    gap: 10px;
  }
  .containers{
    display: flex;
    gap: 10px;
  }
  #left-panel {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  #right-panel {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
  }
  textarea, input[type="file"], button, canvas, img {
    width: 100%;
    box-sizing: border-box;
  }
  textarea {
    font-size: 18px;
    padding: 12px;
    height: 200px;
    line-height: 1.5;
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
  }
  #camera-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }

  #video {
    max-width: 33%;
  }

  #imageUpload {
    width: 33%;
  }

  input[type="file"] {
    font-size: 18px;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-color);
  }
  input[type="file"]::-webkit-file-upload-button {
    background: var(--button-bg);
    color: white;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
  }
  #button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  button {
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    background-color: var(--button-bg);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
  }
  button:hover {
    background-color: var(--button-hover-bg);
  }
  .genbtn {
    background-color: #00A3D2;
  }
  .genbtn:hover {
    background-color: #00A3D2;
  }
  #inputPreview, video, canvas {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
  }
  #inputPreview {
    width: 33%;
    object-fit: contain;
  }
  canvas#outputCanvas {
    width: 100%;
    height: auto;
    flex: 1;
  }
  #status {
    font-style: italic;
    font-size: 14px;
    color: #888;
  }
  #spinner {
    display: none;
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--button-bg);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
  }
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  @media (max-width: 768px) {
    #container {
      flex-direction: column;
    }
    #left-panel, #right-panel {
      flex: none;
      width: 100%;
    }
    #button-group {
      grid-template-columns: 1fr;
    }
  }