/* ============================================================
   ReelCraft – Frontend Styles
   YouTube to Shorts Generator Plugin
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  --rc-bg: #0d0f1a;
  --rc-surface: #151828;
  --rc-surface-2: #1e2238;
  --rc-surface-3: #252b45;
  --rc-border: rgba(255, 255, 255, 0.08);
  --rc-border-light: rgba(255, 255, 255, 0.14);

  --rc-primary: #7c3aed;
  --rc-primary-h: #9b5ff4;
  --rc-primary-glow: rgba(124, 58, 237, 0.35);
  --rc-secondary: #0ea5e9;
  --rc-secondary-h: #38bdf8;

  --rc-accent: #f59e0b;

  --rc-success: #10b981;
  --rc-success-bg: rgba(16, 185, 129, 0.12);
  --rc-error: #ef4444;
  --rc-error-bg: rgba(239, 68, 68, 0.12);
  --rc-warning: #f59e0b;
  --rc-warning-bg: rgba(245, 158, 11, 0.12);

  --rc-text: #e8eaf6;
  --rc-text-muted: #9094ac;
  --rc-text-dim: #5a5f7e;

  --rc-radius-sm: 8px;
  --rc-radius: 14px;
  --rc-radius-lg: 20px;
  --rc-radius-xl: 28px;

  --rc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --rc-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --rc-shadow-glow: 0 0 40px var(--rc-primary-glow);

  --rc-transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --rc-font: 'Inter', system-ui, sans-serif;
}

/* ── Reset & Base ──────────────────────────────────────── */
.reelcraft-wrap,
.reelcraft-wrap * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.reelcraft-wrap {
  font-family: var(--rc-font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--rc-text);
  background: var(--rc-bg);
  border-radius: var(--rc-radius-xl);
  padding: 48px 40px;
  max-width: 760px;
  margin: 32px auto;
  position: relative;
  overflow: hidden;
}

/* Ambient glow background */
.reelcraft-wrap::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, var(--rc-primary-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.reelcraft-wrap>* {
  position: relative;
  z-index: 1;
}

/* ── Header ────────────────────────────────────────────── */
.rc-header {
  text-align: center;
  margin-bottom: 36px;
}

.rc-header__icon {
  font-size: 52px;
  display: block;
  margin-bottom: 14px;
  animation: rc-float 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px var(--rc-primary-glow));
}

@keyframes rc-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.rc-header__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 30%, var(--rc-primary-h) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.rc-header__subtitle {
  color: var(--rc-text-muted);
  font-size: 14px;
}

/* ── Disclaimer ────────────────────────────────────────── */
.rc-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--rc-warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--rc-radius);
  padding: 14px 18px;
  margin-bottom: 32px;
  font-size: 13px;
  color: #e6b44f;
  line-height: 1.5;
}

.rc-disclaimer__icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Form ──────────────────────────────────────────────── */
.rc-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Field ─────────────────────────────────────────────── */
.rc-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rc-field-row {
  display: flex;
  gap: 16px;
}

.rc-field--half {
  flex: 1;
}

/* ── Label ─────────────────────────────────────────────── */
.rc-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.rc-label__icon {
  font-size: 15px;
}

/* ── Inputs ────────────────────────────────────────────── */
.rc-input-wrapper {
  position: relative;
}

.rc-input {
  width: 100%;
  background: var(--rc-surface);
  border: 1.5px solid var(--rc-border);
  border-radius: var(--rc-radius);
  color: var(--rc-text);
  font-family: var(--rc-font);
  font-size: 15px;
  padding: 14px 18px;
  transition: var(--rc-transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.rc-input:focus {
  border-color: var(--rc-primary);
  box-shadow: 0 0 0 3px var(--rc-primary-glow);
  background: var(--rc-surface-2);
}

.rc-input::placeholder {
  color: var(--rc-text-dim);
}

.rc-input--url {
  padding-right: 50px;
}

.rc-input--number {
  text-align: center;
  width: 60px;
  padding: 12px 10px;
  border-radius: var(--rc-radius-sm);
  font-weight: 700;
  font-size: 18px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.rc-input--time {
  font-family: monospace;
  letter-spacing: 2px;
  font-size: 16px;
}

/* URL status indicator */
.rc-url-indicator {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  transition: var(--rc-transition);
}

.rc-url-indicator--valid::after {
  content: '✅';
}

.rc-url-indicator--invalid::after {
  content: '❌';
}

.rc-field-error {
  font-size: 12px;
  color: var(--rc-error);
  display: none;
}

.rc-field-error.is-visible {
  display: block;
}

/* ── Mode Toggle ───────────────────────────────────────── */
.rc-mode-toggle {
  display: flex;
  gap: 8px;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius);
  padding: 5px;
}

.rc-mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: var(--rc-radius-sm);
  color: var(--rc-text-muted);
  cursor: pointer;
  font-family: var(--rc-font);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 16px;
  transition: var(--rc-transition);
}

.rc-mode-btn--active {
  background: var(--rc-primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--rc-primary-glow);
}

.rc-mode-btn:not(.rc-mode-btn--active):hover {
  background: var(--rc-surface-2);
  color: var(--rc-text);
}

/* ── Options Panels ────────────────────────────────────── */
.rc-options-panel {
  animation: rc-slidedown 0.22s ease forwards;
}

@keyframes rc-slidedown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Duration Pills ────────────────────────────────────── */
.rc-duration-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rc-pill {
  background: var(--rc-surface);
  border: 1.5px solid var(--rc-border);
  border-radius: 50px;
  color: var(--rc-text-muted);
  cursor: pointer;
  font-family: var(--rc-font);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 20px;
  transition: var(--rc-transition);
  min-width: 60px;
  text-align: center;
}

.rc-pill:hover {
  border-color: var(--rc-primary);
  color: var(--rc-primary-h);
}

.rc-pill--active {
  background: var(--rc-primary);
  border-color: var(--rc-primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--rc-primary-glow);
}

/* ── Number Input ──────────────────────────────────────── */
.rc-number-input {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rc-number-btn {
  width: 40px;
  height: 40px;
  background: var(--rc-surface-2);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-sm);
  color: var(--rc-text);
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transition: var(--rc-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rc-number-btn:hover {
  background: var(--rc-primary);
  border-color: var(--rc-primary);
  box-shadow: 0 4px 12px var(--rc-primary-glow);
}

/* ── Hint ──────────────────────────────────────────────── */
.rc-hint {
  font-size: 12px;
  color: var(--rc-text-dim);
  margin-top: 6px;
}

/* ── Buttons ───────────────────────────────────────────── */
.rc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--rc-radius);
  cursor: pointer;
  font-family: var(--rc-font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 14px 28px;
  transition: var(--rc-transition);
  text-decoration: none;
  white-space: nowrap;
}

.rc-btn--primary {
  background: linear-gradient(135deg, var(--rc-primary), #5b21b6);
  color: #fff;
  box-shadow: 0 6px 24px var(--rc-primary-glow);
}

.rc-btn--primary:hover {
  background: linear-gradient(135deg, var(--rc-primary-h), var(--rc-primary));
  box-shadow: 0 8px 32px var(--rc-primary-glow);
  transform: translateY(-2px);
}

.rc-btn--primary:active {
  transform: translateY(0);
}

.rc-btn--secondary {
  background: var(--rc-secondary);
  color: #fff;
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.3);
}

.rc-btn--secondary:hover {
  background: var(--rc-secondary-h);
  transform: translateY(-2px);
}

.rc-btn--ghost {
  background: var(--rc-surface-2);
  border: 1px solid var(--rc-border);
  color: var(--rc-text-muted);
}

.rc-btn--ghost:hover {
  background: var(--rc-surface-3);
  border-color: var(--rc-border-light);
  color: var(--rc-text);
}

/* Generate button full-width with pulse */
.rc-btn--pulse {
  width: 100%;
  padding: 18px 28px;
  font-size: 17px;
  position: relative;
  overflow: hidden;
}

.rc-btn--pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 var(--rc-primary-glow);
  animation: rc-pulse 2.5s infinite;
}

@keyframes rc-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--rc-primary-glow);
  }

  60% {
    box-shadow: 0 0 0 14px rgba(124, 58, 237, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
  }
}

.rc-btn[disabled],
.rc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Progress Section ──────────────────────────────────── */
.rc-progress {
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-lg);
  margin-top: 28px;
  overflow: hidden;
  animation: rc-slidedown 0.3s ease;
}

.rc-progress__header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 28px;
}

.rc-progress__spinner {
  flex-shrink: 0;
}

.rc-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid var(--rc-surface-3);
  border-top: 4px solid var(--rc-primary);
  border-radius: 50%;
  animation: rc-spin 0.8s linear infinite;
}

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

.rc-progress__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rc-progress__text strong {
  font-size: 16px;
  color: var(--rc-text);
}

.rc-progress__text span {
  font-size: 13px;
  color: var(--rc-text-muted);
}

/* Progress bar */
.rc-progress-bar-wrap {
  height: 6px;
  background: var(--rc-surface-3);
  overflow: hidden;
}

.rc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--rc-primary), var(--rc-secondary));
  width: 0%;
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

.rc-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: rc-shimmer 1.5s infinite;
}

@keyframes rc-shimmer {
  to {
    left: 100%;
  }
}

/* Steps */
.rc-progress__steps {
  display: flex;
  justify-content: space-around;
  padding: 20px 24px;
  border-top: 1px solid var(--rc-border);
}

.rc-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--rc-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--rc-transition);
}

.rc-step--active {
  color: var(--rc-primary-h);
}

.rc-step--done {
  color: var(--rc-success);
}

.rc-step__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rc-surface-3);
  border: 2px solid var(--rc-border);
  transition: var(--rc-transition);
}

.rc-step--active .rc-step__dot {
  background: var(--rc-primary);
  border-color: var(--rc-primary);
  box-shadow: 0 0 10px var(--rc-primary-glow);
  animation: rc-dot-pulse 1.2s ease-in-out infinite;
}

.rc-step--done .rc-step__dot {
  background: var(--rc-success);
  border-color: var(--rc-success);
}

@keyframes rc-dot-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
  }
}

/* ── Alerts ────────────────────────────────────────────── */
.rc-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: var(--rc-radius);
  padding: 16px 20px;
  margin-top: 20px;
  font-size: 14px;
  animation: rc-slidedown 0.2s ease;
}

.rc-alert--error {
  background: var(--rc-error-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.rc-alert__icon {
  flex-shrink: 0;
}

.rc-alert__close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  margin-left: auto;
  opacity: 0.7;
  transition: var(--rc-transition);
}

.rc-alert__close:hover {
  opacity: 1;
}

/* ── Results Section ───────────────────────────────────── */
.rc-results {
  margin-top: 36px;
  animation: rc-slidedown 0.3s ease;
}

.rc-results__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.rc-results__title {
  font-size: 20px;
  font-weight: 800;
  color: var(--rc-text);
}

.rc-results__actions {
  display: flex;
  gap: 10px;
}

/* Expiry Notice */
.rc-expiry-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--rc-warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--rc-radius-sm);
  font-size: 13px;
  color: #e6b44f;
  margin-bottom: 24px;
}

/* ── Clips Grid ────────────────────────────────────────── */
.rc-clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ── Clip Card ─────────────────────────────────────────── */
.rc-clip-card {
  background: var(--rc-surface);
  border: 1px solid var(--rc-border);
  border-radius: var(--rc-radius-lg);
  overflow: hidden;
  transition: var(--rc-transition);
  animation: rc-fadeup 0.4s ease both;
}

@keyframes rc-fadeup {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rc-clip-card:hover {
  border-color: var(--rc-primary);
  box-shadow: 0 12px 40px var(--rc-primary-glow);
  transform: translateY(-4px);
}

.rc-clip-card__preview {
  position: relative;
  aspect-ratio: 9/16;
  background: #000;
  overflow: hidden;
}

.rc-clip-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rc-clip-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--rc-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 50px;
  box-shadow: 0 2px 8px var(--rc-primary-glow);
}

.rc-clip-card__info {
  padding: 16px;
}

.rc-clip-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.rc-clip-index {
  font-size: 13px;
  font-weight: 700;
  color: var(--rc-text);
}

.rc-clip-time {
  font-size: 12px;
  color: var(--rc-text-muted);
  font-family: monospace;
}

.rc-clip-actions {
  display: flex;
  gap: 8px;
}

.rc-clip-download {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
}

/* ── Login Notice ──────────────────────────────────────── */
.reelcraft-login-notice {
  text-align: center;
  padding: 60px 40px;
  background: var(--rc-surface);
  border-radius: var(--rc-radius-xl);
  color: var(--rc-text-muted);
}

.reelcraft-login-notice p {
  margin-bottom: 24px;
  font-size: 16px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .reelcraft-wrap {
    padding: 32px 20px;
    margin: 16px;
    border-radius: var(--rc-radius-lg);
  }

  .rc-header__icon {
    font-size: 40px;
  }

  .rc-header__title {
    font-size: 22px;
  }

  .rc-field-row {
    flex-direction: column;
  }

  .rc-results__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .rc-results__actions {
    width: 100%;
    flex-direction: column;
  }

  .rc-results__actions .rc-btn {
    width: 100%;
  }

  .rc-clips-grid {
    grid-template-columns: 1fr;
  }
}