/* ============================================================
   PDF to TIFF Converter — stylesheet
   Theme: clean light, professional
   ============================================================ */

/* ---------- Reset / Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  background: #f4f6f9;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Header ---------- */
header {
  width: 100%;
  background: #16213e;
  color: #e8eaf0;
  padding: 2rem 1rem;
  text-align: center;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

header .subtitle {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  color: #9ba3b8;
}

/* ---------- Main ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* ---------- Drop Zone ---------- */
#drop-zone {
  width: 100%;
  min-height: 280px;
  border: 2px dashed #7c8db5;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-align: center;
}

#drop-zone:hover,
#drop-zone.dragover {
  background: #eef2ff;
  border-color: #3a5bd9;
}

.drop-icon {
  color: #7c8db5;
  transition: color 0.2s ease;
}

#drop-zone.dragover .drop-icon {
  color: #3a5bd9;
}

.drop-text {
  font-size: 1.05rem;
  font-weight: 500;
  color: #3a3f5c;
}

.drop-sub {
  font-size: 0.85rem;
  color: #9ba3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #3a5bd9;
  color: #ffffff;
}

.btn-primary:hover {
  background: #2d4cc8;
}

.btn-success {
  background: #1a8a4a;
  color: #ffffff;
  margin-top: 0.5rem;
}

.btn-success:hover {
  background: #156e3b;
}

/* ---------- Visually hidden (accessibility) ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Progress Bar ---------- */
#progress-container {
  width: 100%;
  text-align: center;
}

.progress-label {
  font-size: 0.9rem;
  color: #3a3f5c;
  margin-bottom: 0.5rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #dde3f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #3a5bd9;
  border-radius: 999px;
  transition: width 0.3s ease;
  animation: indeterminate 1.4s ease-in-out infinite;
  transform-origin: left;
}

@keyframes indeterminate {
  0%   { width: 0%;   margin-left: 0%; }
  50%  { width: 60%;  margin-left: 20%; }
  100% { width: 0%;   margin-left: 100%; }
}

/* ---------- Messages ---------- */
.message {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.message--error {
  background: #fff0f0;
  border: 1px solid #f5c2c2;
  color: #cc0000;
}

.message--success {
  background: #f0fff5;
  border: 1px solid #b2f0cc;
  color: #007a2a;
}

/* ---------- Conversion Stats ---------- */
.success-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.success-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #007a2a;
  margin: 0;
}

.conversion-stats {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  background: #ffffff;
  border-radius: 8px;
  margin: 0.5rem 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  background: #f9fafc;
  border-radius: 6px;
  border-left: 3px solid #3a5bd9;
}

.stat-label {
  font-size: 0.8rem;
  color: #7c8db5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* ---------- File List ---------- */
#file-list-container {
  width: 100%;
  padding: 1rem;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #dde3f0;
}

.file-list-label {
  font-size: 0.9rem;
  color: #3a3f5c;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  max-height: 200px;
  overflow-y: auto;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem;
  background: #f9fafc;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.file-list-name {
  flex: 1;
  color: #1a1a2e;
  word-break: break-word;
}

.file-list-size {
  color: #7c8db5;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.file-list-remove {
  background: #f5c2c2;
  color: #cc0000;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  transition: background 0.15s;
}

.file-list-remove:hover {
  background: #f0a0a0;
}

.btn-secondary {
  background: #7c8db5;
  color: #ffffff;
  margin-top: 0.5rem;
}

.btn-secondary:hover {
  background: #6a7aa0;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.button-group .btn {
  flex: 1;
  min-width: 150px;
}

/* ---------- Utility ---------- */
.hidden {
  display: none !important;
}

/* ---------- Footer ---------- */
footer {
  width: 100%;
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #9ba3b8;
  border-top: 1px solid #dde3f0;
  background: #ffffff;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  header h1 {
    font-size: 1.35rem;
  }

  main {
    padding: 1.5rem 0.75rem;
  }

  #drop-zone {
    min-height: 220px;
  }
}

@media (min-width: 320px) {
  body {
    min-width: 320px;
  }
}
