/* Intellicode Modern Branding */

:root {
  --blue-primary: #004aad;
  --blue-secondary: #007bff;
  --accent: #f39c12;
  --bg-gradient: linear-gradient(135deg, #e0f0ff 0%, #ffffff 100%);
  --text-color: #222;
  --text-muted: #555;
  --btn-bg: var(--blue-primary);
  --btn-hover: var(--accent);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-gradient);
  margin: 0;
  padding: 0 15px;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  text-align: center; /* center align all text by default */
}

header {
  max-width: 700px;
  margin: 0 auto;
  padding: 30px 0 15px;
}

h1 {
  font-weight: 700;
  font-size: 2.2rem;
  color: var(--blue-primary);
  margin: 0;
  line-height: 1.2;
}

.tagline {
  font-size: 1rem;
  color: var(--blue-secondary);
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

main {
  flex: 1;
  max-width: 700px;
  margin: 0 auto 50px;
  width: 100%;
  background: white;
  border-radius: 18px;
  padding: 40px 30px;
  box-shadow: 0 8px 30px rgba(0, 74, 173, 0.15);
  text-align: center; /* center content inside main */
}

.container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center; /* center all flex children horizontally */
}

.upload-area {
  border: 3px dashed var(--blue-secondary);
  border-radius: 18px;
  padding: 50px 30px;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  user-select: none;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upload-area:hover,
.upload-area.dragover {
  background-color: #d9eaff;
  border-color: var(--accent);
}

.upload-text p {
  margin: 0;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--blue-primary);
  line-height: 1.3;
}

.sub-text {
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 8px;
}

textarea#extractedText {
  width: 100%;
  max-width: 700px;
  min-height: 200px;
  padding: 20px 25px;
  border-radius: 18px;
  border: 2px solid var(--blue-secondary);
  font-size: 1.1rem;
  font-family: 'Courier New', Courier, monospace;
  resize: vertical;
  color: var(--text-color);
  background: #fefefe;
  box-shadow: inset 0 0 12px rgba(0, 123, 255, 0.15);
  margin: 0 auto;
}

.buttons {
  display: flex;
  gap: 20px;
  justify-content: center; /* center buttons */
  flex-wrap: wrap;
}

button {
  background-color: var(--btn-bg);
  color: white;
  border: none;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 74, 173, 0.3);
  transition: background-color 0.3s ease;
  min-width: 140px;
}

button:disabled {
  background-color: #b0c4de;
  cursor: not-allowed;
  box-shadow: none;
}

button:not(:disabled):hover {
  background-color: var(--btn-hover);
}

.ad-placeholder {
  margin-top: 35px;
  padding: 25px;
  text-align: center;
  border: 2px dashed var(--blue-secondary);
  color: var(--text-muted);
  font-style: italic;
  border-radius: 14px;
  user-select: none;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
}

/* Loader */
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid var(--blue-primary);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  margin: 20px auto 0;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Footer */
footer {
  text-align: center;
  padding: 20px 10px 35px;
  font-size: 1rem;
  color: var(--blue-primary);
  font-weight: 700;
}

/* Responsive */
@media (max-width: 600px) {
  main {
    padding: 30px 20px;
    border-radius: 15px;
  }

  .upload-area {
    padding: 40px 20px;
    max-width: 100%;
  }

  .textarea#extractedText {
    min-height: 180px;
  }

  button {
    min-width: 100%;
    padding: 14px 0;
  }

  .buttons {
    flex-direction: column;
    gap: 15px;
  }
}
.image-preview {
  position: relative;
  margin-top: 15px;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 74, 173, 0.15);
  margin-left: auto;
  margin-right: auto;
}

.image-preview img {
  width: 10%;
  height: 10%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

#removeImageBtn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(243, 156, 18, 0.9);
  border: none;
  color: white;
  font-size: 14px;
  line-height: 1;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background-color 0.3s ease;
}

#removeImageBtn:hover {
  background: var(--accent);
}

/* Optional: Better scaling on very small screens */
@media (max-width: 400px) {
  .image-preview {
    width: 20px;
    height: 20px;
  }

  #removeImageBtn {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
}


