* {
  box-sizing: border-box;
}

:root {
  --accent: #ff3b3b;
  --accent-dark: #d92c2c;
  --bg-0: #0b0b0d;
  --bg-1: #17171b;
  --bg-2: #1f1f24;
  --border: #2a2a30;
  --text: #f4f4f5;
  --text-dim: #9a9aa4;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 59, 59, 0.12), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(255, 59, 59, 0.08), transparent 40%),
    var(--bg-0);
}

.card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 59, 59, 0.35);
}

h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

#lookup-form {
  display: flex;
  gap: 10px;
}

.input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

input[type="url"] {
  width: 100%;
  padding: 13px 14px 13px 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-0);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.15s ease;
}

input[type="url"]::placeholder {
  color: #5c5c66;
}

input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
}

button,
.btn {
  padding: 13px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

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

#fetch-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  position: relative;
}

#fetch-btn:hover {
  background: linear-gradient(135deg, #ff5252, var(--accent));
}

#fetch-btn:disabled {
  cursor: default;
  opacity: 0.85;
}

.spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
}

#fetch-btn.loading .btn-label {
  display: none;
}

#fetch-btn.loading .spinner {
  display: inline-block;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  flex: 1;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff5252, var(--accent));
}

.btn-secondary {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  flex: 1;
}

.btn-secondary:hover {
  background: #28282f;
}

.error {
  color: #ff8080;
  background: rgba(255, 59, 59, 0.08);
  border: 1px solid rgba(255, 59, 59, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 16px 0 0;
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

.result {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
}

.thumb-wrap {
  position: relative;
  flex-shrink: 0;
}

.thumb-wrap img {
  width: 150px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg-2);
  display: block;
}

.duration-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.details h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.details p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.footnote {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-align: center;
  max-width: 460px;
  margin: 0;
}
