/* Tweeloads WordPress Plugin — matches tweeloads.com design */

.tweeloads-root {
  --tl-background: #F1F5F9;
  --tl-surface: #FFFFFF;
  --tl-surface-2: #F8FAFC;
  --tl-foreground: #0F172A;
  --tl-muted-foreground: #64748B;
  --tl-primary: #2563EB;
  --tl-primary-hover: #1D4ED8;
  --tl-primary-foreground: #FFFFFF;
  --tl-destructive: #DC2626;
  --tl-success: #16A34A;
  --tl-border: #CBD5E1;
  --tl-shadow-card: 0 1px 2px rgba(15,23,42,0.04), 0 8px 24px -12px rgba(15,23,42,0.08);
  --tl-shadow-elevated: 0 2px 4px rgba(15,23,42,0.04), 0 24px 48px -20px rgba(15,23,42,0.12);
  --tl-shadow-button: 0 1px 0 0 rgba(255,255,255,0.25) inset, 0 6px 18px -6px rgba(37,99,235,0.45);
  --tl-shadow-glow: 0 12px 40px -12px rgba(37,99,235,0.35);
  --tl-font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --tl-font-display: "Sora", "Inter", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--tl-font-sans);
  color: var(--tl-foreground);
  -webkit-font-smoothing: antialiased;
  max-width: 42rem;
  margin: 0 auto;
}

.tweeloads-privacy {
  text-align: center;
  font-size: 12px;
  color: var(--tl-muted-foreground);
  margin: 12px auto 0;
  max-width: 42rem;
}

/* Glass card input */
.tl-glass-card {
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--tl-border);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--tl-shadow-card);
  border-radius: 20px;
  padding: 10px 12px;
}

.tl-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 640px) {
  .tl-form { flex-direction: row; }
}

.tl-input-wrap {
  position: relative;
  flex: 1;
}

.tl-input {
  height: 56px;
  width: 100%;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.7);
  padding: 0 96px 0 20px;
  font-size: 15px;
  color: var(--tl-foreground);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}

.tl-input::placeholder { color: rgba(100,116,139,0.7); }

.tl-input:focus {
  background: #fff;
  border-color: rgba(37,99,235,0.5);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}

.tl-input.tl-input-error {
  border-color: rgba(220,38,38,0.6);
  box-shadow: 0 0 0 4px rgba(220,38,38,0.15);
}

.tl-input-actions {
  position: absolute;
  inset-block: 0;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tl-icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--tl-muted-foreground);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tl-icon-btn:hover {
  background: var(--tl-surface-2);
  color: var(--tl-foreground);
}

.tl-paste-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--tl-border);
  background: rgba(255,255,255,0.7);
  font-size: 11px;
  font-weight: 500;
  color: var(--tl-muted-foreground);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.tl-paste-btn:hover {
  color: var(--tl-foreground);
  border-color: rgba(255,255,255,0.15);
}

.tl-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 28px;
  border: none;
  border-radius: 16px;
  background: var(--tl-primary);
  color: var(--tl-primary-foreground);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--tl-shadow-button);
  transition: background 0.2s, transform 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.tl-submit:hover:not(:disabled) {
  background: var(--tl-primary-hover);
  transform: translateY(-2px);
}

.tl-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.tl-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tl-spin 0.7s linear infinite;
}

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

/* Error */
.tl-error {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 20px;
  border-radius: 16px;
  border: 1px solid rgba(220,38,38,0.4);
  background: rgba(220,38,38,0.1);
  color: var(--tl-destructive);
  font-size: 14px;
  text-align: left;
  animation: tl-fade-up 0.7s cubic-bezier(0.16,1,0.3,1) both;
}

/* Result card */
.tl-result {
  margin-top: 32px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--tl-border);
  background: var(--tl-surface);
  text-align: left;
  box-shadow: var(--tl-shadow-elevated);
  animation: tl-result-in 0.35s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes tl-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tl-result-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tl-result-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 28px;
}

@media (min-width: 768px) {
  .tl-result-body.tl-result-split { flex-direction: row; }
}

.tl-preview {
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  flex: none;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--tl-border);
  background: var(--tl-surface-2);
}

@media (min-width: 768px) {
  .tl-preview.tl-preview-sm { width: 288px; }
}

.tl-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tl-play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15,23,42,0.25);
}

.tl-play-btn {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}

.tl-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  font-size: 11px;
  font-weight: 500;
}

.tl-meta { min-width: 0; flex: 1; }

.tl-badge-ready {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22,163,74,0.15);
  font-size: 11px;
  font-weight: 500;
  color: var(--tl-success);
}

.tl-author {
  font-size: 12px;
  color: var(--tl-muted-foreground);
  margin-left: 8px;
}

.tl-title {
  font-family: var(--tl-font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 12px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tl-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 16px;
  font-size: 12px;
}

.tl-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--tl-muted-foreground);
}

.tl-stat span { color: rgba(15,23,42,0.8); }

.tl-hairline {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(15,23,42,0.10), transparent);
}

.tl-downloads {
  padding: 24px 28px;
}

.tl-downloads-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tl-downloads-header h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.tl-downloads-header span {
  font-size: 12px;
  color: var(--tl-muted-foreground);
}

.tl-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .tl-cards { grid-template-columns: 1fr 1fr; }
}

.tl-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--tl-border);
  background: rgba(248,250,252,0.6);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.tl-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.15);
  background: var(--tl-surface-2);
}

.tl-card.tl-card-best {
  border-color: rgba(37,99,235,0.4);
  background: rgba(37,99,235,0.1);
}

.tl-card.tl-card-best:hover {
  background: rgba(37,99,235,0.15);
  box-shadow: var(--tl-shadow-glow);
}

.tl-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tl-card-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  background: var(--tl-surface);
  color: var(--tl-muted-foreground);
  box-shadow: 0 0 0 1px var(--tl-border);
}

.tl-card-best .tl-card-icon {
  background: rgba(37,99,235,0.15);
  color: var(--tl-primary);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.25);
}

.tl-card-label {
  font-family: var(--tl-font-display);
  font-size: 14px;
  font-weight: 600;
}

.tl-card-tag {
  font-size: 12px;
  color: var(--tl-muted-foreground);
  margin-top: 2px;
}

.tl-best-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37,99,235,0.2);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tl-primary);
}

.tl-card-dl {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  background: var(--tl-surface);
  color: var(--tl-muted-foreground);
  transition: background 0.2s, color 0.2s;
}

.tl-card:hover .tl-card-dl {
  background: var(--tl-primary);
  color: var(--tl-primary-foreground);
  box-shadow: var(--tl-shadow-button);
}

.tl-card-best .tl-card-dl {
  background: var(--tl-primary);
  color: var(--tl-primary-foreground);
  box-shadow: var(--tl-shadow-button);
}

.tl-reset-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.tl-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--tl-border);
  background: rgba(248,250,252,0.6);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.tl-reset-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.15);
  background: var(--tl-surface-2);
}

/* Compact mode (gif, mp4, image, thumbnail) */
.tl-compact { padding: 24px 28px; }

.tl-compact-preview {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--tl-border);
  background: var(--tl-surface-2);
}

.tl-compact-preview img { width: 100%; display: block; object-fit: cover; }

.tl-dl-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

@media (min-width: 640px) {
  .tl-dl-row { flex-direction: row; }
}

.tl-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  flex: 1;
  padding: 0 24px;
  border-radius: 14px;
  border: none;
  background: var(--tl-primary);
  color: var(--tl-primary-foreground);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--tl-shadow-button);
  transition: background 0.2s;
}

.tl-btn-primary:hover {
  background: var(--tl-primary-hover);
  color: var(--tl-primary-foreground);
}

.tl-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 14px;
  border: 1px solid var(--tl-border);
  background: var(--tl-surface-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
}

.tl-btn-secondary:hover { border-color: rgba(255,255,255,0.15); }

.tl-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
  font-size: 12px;
}

.tl-info-grid dt { color: var(--tl-muted-foreground); }
.tl-info-grid dd { margin: 2px 0 0; font-weight: 500; }

.tl-mp4-grid {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .tl-mp4-grid { grid-template-columns: repeat(3, 1fr); }
}

.tl-mp4-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--tl-border);
  background: var(--tl-surface-2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
}

.tl-mp4-item:hover { border-color: rgba(37,99,235,0.4); }

.tl-mp4-item .tl-dl-hint {
  font-size: 12px;
  color: var(--tl-primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.tl-mp4-item:hover .tl-dl-hint { opacity: 1; }

.tl-image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .tl-image-grid { grid-template-columns: 1fr 1fr; }
}

.tl-image-item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--tl-border);
  background: var(--tl-surface-2);
}

.tl-image-item img { width: 100%; display: block; object-fit: cover; }

.tl-image-item .tl-hover-dl {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 0 12px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1);
}

.tl-image-item:hover .tl-hover-dl { opacity: 1; }

.tl-image-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tl-image-btns a {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--tl-border);
  background: var(--tl-surface-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
}

.tl-image-btns a:hover { border-color: rgba(255,255,255,0.15); }

.tl-svg { width: 16px; height: 16px; flex-shrink: 0; }
