:root {
  --gradient-bg: #1e1e1e;
  --gradient-btn: linear-gradient(135deg, #3a3f51, #2c2f3a);
  --gradient-btn-hover: linear-gradient(135deg, #4b5168, #343845);
  --text: #f5f5f5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  margin: 0;
  background: var(--gradient-bg);
  color: var(--text);
  padding: 20px;
  box-sizing: border-box;
}

canvas#background-stars {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.container {
  text-align: center;
  padding: 30px;
  background: linear-gradient(
    145deg, rgba(20,20,20,0.7) 0%, rgba(30,30,30,0.6) 40%,
    rgba(40,40,40,0.5) 70%, rgba(60,60,60,0.4) 100%
  );
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: 100%;
  transition: max-width 0.4s ease-in-out;
}

.container.expanded {
  max-width: 600px;
}

h1 {
  font-size: 2em;
  margin-bottom: 20px;
  color: var(--text);
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.6);
}

input[type="file"], select {
  margin-bottom: 20px;
  padding: 10px;
  border: 2px solid #ccc;
  border-radius: 10px;
  background: #444;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  color: var(--text);
}

input[type="file"] {
  border-style: dashed;
  transition: border-color 0.3s, transform 0.3s;
}

input[type="file"]:hover {
  border-color: #00c8ff;
  transform: scale(1.05);
}

select {
  border-style: solid;
}

button {
  padding: 10px 20px;
  background: var(--gradient-btn);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  margin: 5px;
}

button:hover {
  background: var(--gradient-btn-hover);
  transform: scale(1.05);
}

#resetButton {
  background: linear-gradient(135deg, #dc3545, #c82333);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

#resetButton:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
}

#loading, #result {
  margin-top: 20px;
}

#result h2 {
  margin-bottom: 10px;
}

#extractedText {
  white-space: pre-wrap;
  background: #111;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid #555;
  text-align: left;
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
  box-sizing: border-box;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #333; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
* { scrollbar-width: thin; scrollbar-color: #888 #333; }

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #00c8ff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.dots::after {
  content: '.';
  animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .container { padding: 20px; }
  h1 { font-size: 1.5em; }
  button, select, input[type="file"] { width: 100%; margin: 8px 0; }
}:root {
  --gradient-bg: #1e1e1e;
  --gradient-btn: linear-gradient(135deg, #3a3f51, #2c2f3a);
  --gradient-btn-hover: linear-gradient(135deg, #4b5168, #343845);
  --text: #f5f5f5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  margin: 0;
  background: var(--gradient-bg);
  color: #b6b7b8;
  padding: 20px;
  box-sizing: border-box;
}

canvas#background-stars {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.container {
  text-align: center;
  padding: 30px;
  background: linear-gradient(
    145deg, rgba(20,20,20,0.7) 0%, rgba(30,30,30,0.6) 40%,
    rgba(40,40,40,0.5) 70%, rgba(60,60,60,0.4) 100%
  );
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 420px;
  width: 100%;
  transition: max-width 0.4s ease-in-out;
}

.container.expanded {
  max-width: 640px;
}

h1 {
  font-size: 2em;
  margin-bottom: 16px;
  color: var(--text);
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.6);
}

.hint {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: -10px;
  margin-bottom: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

input[type="file"], select {
  margin-bottom: 16px;
  padding: 10px;
  border: 2px dashed #777;
  border-radius: 10px;
  background: #444;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  color: var(--text);
  transition: border-color 0.3s, transform 0.3s;
}

select {
  border-style: solid;
}

.dropzone.dragover {
  outline: 2px dashed #00c8ff;
  outline-offset: 6px;
}

button {
  padding: 10px 20px;
  background: var(--gradient-btn);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
  margin: 5px;
}

button:hover {
  background: var(--gradient-btn-hover);
  transform: scale(1.05);
}

#resetButton {
  background: linear-gradient(135deg, #dc3545, #c82333);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

#resetButton:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
}

#loading, #result {
  margin-top: 20px;
}

#result h2 {
  margin-bottom: 10px;
}

#extractedText {
  white-space: pre-wrap;
  background: #111;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid #555;
  text-align: left;
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
  box-sizing: border-box;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #333; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
* { scrollbar-width: thin; scrollbar-color: #888 #333; }

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top: 4px solid #00c8ff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.progress {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00c8ff, #6ee7ff);
  transition: width 0.2s ease;
}

.progress-text {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: 8px;
}

.disclaimer {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 18px;
}

@media (max-width: 480px) {
  .container { padding: 20px; }
  h1 { font-size: 1.5em; }
  button, select, input[type="file"] { width: 100%; margin: 8px 0; }
}
