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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
  line-height: 1.5;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  background: #c8102e;
  color: #fff;
  padding: 1.25rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Cards */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #374151;
}

/* Form */
.form-row {
  display: flex;
  gap: 0.75rem;
}

#url-input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

#url-input:focus {
  border-color: #c8102e;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

#start-btn {
  padding: 0.6rem 1.4rem;
  background: #c8102e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

#start-btn:hover {
  background: #a50d25;
}

#start-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* Error */
.error {
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* Progress */
#progress-area {
  margin-top: 1rem;
}

.progress-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.pulse {
  width: 8px;
  height: 8px;
  background: #c8102e;
  border-radius: 50%;
  animation: pulse-anim 1.2s ease-in-out infinite;
}

@keyframes pulse-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #c8102e;
  width: 30%;
  border-radius: 3px;
  animation: progress-stripe 1.5s linear infinite;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%
  );
  background-size: 20px 20px;
}

@keyframes progress-stripe {
  from { background-position: 0 0; }
  to { background-position: 20px 0; }
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

tbody tr:hover {
  background: #f9fafb;
}

.empty {
  text-align: center;
  color: #9ca3af;
  padding: 2rem 0.75rem !important;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 500;
}

.badge-completed {
  background: #d1fae5;
  color: #065f46;
}

.badge-running {
  background: #fef3c7;
  color: #92400e;
}

.badge-failed {
  background: #fef2f2;
  color: #991b1b;
}

.badge-pending {
  background: #f3f4f6;
  color: #6b7280;
}

/* Action buttons */
.actions {
  display: flex;
  gap: 0.4rem;
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}

.btn-download {
  background: #dbeafe;
  color: #1e40af;
}

.btn-download:hover {
  background: #bfdbfe;
}

.btn-delete {
  background: #fef2f2;
  color: #991b1b;
}

.btn-delete:hover {
  background: #fecaca;
}

.url-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }

  #start-btn {
    width: 100%;
  }
}
