/**
 * Usetra Video Clipper Stylesheet
 * Responsive modern UI matching Usetra Design System.
 */

/* Main Container */
.clipper-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Hero */
.clipper-hero {
  text-align: center;
  margin-bottom: 32px;
}
.clipper-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #2563eb;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 12px;
  border: 1px solid #dbeafe;
}
.clipper-hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
}
.clipper-hero p {
  font-size: 1.05rem;
  color: #64748b;
  max-width: 760px;
  margin: 0 auto;
}

/* Upload Dropzone Screen */
.upload-card {
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  padding: 56px 24px;
  text-align: center;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04);
  transition: all 0.25s ease;
  cursor: pointer;
  margin-bottom: 40px;
}
.upload-card:hover, .upload-card.drag-over {
  border-color: #2563eb;
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -5px rgba(37, 99, 235, 0.08);
}
.upload-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  font-size: 2rem;
}
.upload-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}
.upload-desc {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 24px;
}
.btn-browse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2563eb;
  color: #ffffff;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
}
.btn-browse:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.upload-meta {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: #64748b;
}
.upload-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Editor Workspace Grid */
.editor-workspace {
  display: none;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 40px;
}
@media (min-width: 992px) {
  .editor-workspace {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

/* Video Stage (Left) */
.stage-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04);
}
.video-preview-wrapper {
  position: relative;
  background: #090d16;
  border-radius: 14px;
  overflow: hidden;
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
#videoPlayer {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Crop Overlay */
.crop-overlay {
  position: absolute;
  pointer-events: none;
}
.crop-box {
  position: absolute;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 9999px rgba(9, 13, 22, 0.65);
  cursor: move;
  pointer-events: auto;
  box-sizing: border-box;
}
.crop-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.grid-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.25);
}
.grid-line.horizontal-1 { top: 33.33%; left: 0; right: 0; height: 1px; }
.grid-line.horizontal-2 { top: 66.66%; left: 0; right: 0; height: 1px; }
.grid-line.vertical-1 { left: 33.33%; top: 0; bottom: 0; width: 1px; }
.grid-line.vertical-2 { left: 66.66%; top: 0; bottom: 0; width: 1px; }

.crop-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #2563eb;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 10;
}
.handle-nw { top: -8px; left: -8px; cursor: nwse-resize; }
.handle-ne { top: -8px; right: -8px; cursor: nesw-resize; }
.handle-se { bottom: -8px; right: -8px; cursor: nwse-resize; }
.handle-sw { bottom: -8px; left: -8px; cursor: nesw-resize; }

.crop-size-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  pointer-events: none;
}

/* Custom Playback Bar */
.playback-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 0;
  margin-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.btn-playback {
  background: #f1f5f9;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-playback:hover {
  background: #e2e8f0;
  color: #2563eb;
}
.time-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  color: #475569;
}
.video-meta-tags {
  margin-left: auto;
  display: flex;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}
.meta-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 6px;
  color: #64748b;
}

/* Control Panel (Right) */
.controls-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.panel-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Trim Controls */
.trim-control-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 22px;
}
.trim-timeline {
  position: relative;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  margin: 16px 0 20px;
}
.trim-track-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #2563eb;
  border-radius: 6px;
  opacity: 0.85;
}
.trim-slider {
  position: absolute;
  width: 100%;
  top: -6px;
  left: 0;
  height: 24px;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
}
.trim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 0.1s;
}
.trim-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.trim-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.time-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.time-input-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}
.input-with-action {
  display: flex;
  gap: 6px;
}
.time-box {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  outline: none;
}
.time-box:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.btn-capture-time {
  padding: 6px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-capture-time:hover {
  background: #dbeafe;
}

.clip-duration-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 12px;
  font-size: 0.84rem;
  color: #334155;
}
.clip-duration-val {
  font-weight: 800;
  color: #2563eb;
}

/* Aspect Ratio Presets */
.ratio-presets-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 24px;
}
.presets-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.btn-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-preset:hover {
  border-color: #cbd5e1;
  background: #fafafa;
}
.btn-preset.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #2563eb;
}
.preset-name {
  font-size: 0.82rem;
  font-weight: 700;
}
.preset-sub {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 2px;
}
.btn-preset.active .preset-sub {
  color: #2563eb;
}

/* Export CTA */
.export-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn-export {
  width: 100%;
  padding: 14px 24px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-export:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
}
.btn-export:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-reset-stage {
  background: transparent;
  border: 1.5px solid #e2e8f0;
  color: #64748b;
  padding: 9px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-reset-stage:hover {
  background: #f8fafc;
  color: #0f172a;
}

/* Processing Modal / Overlay */
.processing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.processing-modal {
  background: #ffffff;
  border-radius: 20px;
  padding: 36px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid #eff6ff;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.proc-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}
.proc-status-text {
  font-size: 0.94rem;
  color: #64748b;
  margin-bottom: 20px;
  min-height: 24px;
}
.proc-progress-bar {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.proc-progress-fill {
  height: 100%;
  width: 0%;
  background: #2563eb;
  transition: width 0.2s ease;
}
.proc-privacy-note {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* Result Modal / Screen */
.result-modal {
  display: none;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  padding: 32px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05);
  margin-bottom: 40px;
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.result-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 768px) {
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.result-video-wrapper {
  background: #090d16;
  border-radius: 14px;
  overflow: hidden;
  max-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#resultVideo {
  max-width: 100%;
  max-height: 360px;
}
.result-details-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.result-meta-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.result-meta-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.88rem;
}
.btn-download-mp4 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #10b981;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
  transition: all 0.2s;
}
.btn-download-mp4:hover {
  background: #059669;
}

/* Guide & FAQs */
.guide-section {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  padding: 36px 32px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04);
  margin-bottom: 40px;
}
.guide-section h2 { font-size: 1.5rem; font-weight: 800; color: #0f172a; margin-bottom: 16px; }
.guide-section h3 { font-size: 1.15rem; font-weight: 700; color: #1e293b; margin: 24px 0 10px; }
.guide-section p { color: #475569; margin-bottom: 14px; font-size: 0.98rem; }
.guide-section ul { margin-left: 20px; color: #475569; margin-bottom: 16px; font-size: 0.94rem; }

.faq-section { margin-bottom: 40px; }
.faq-section h2 { font-size: 1.5rem; font-weight: 800; color: #0f172a; margin-bottom: 20px; }
.faq-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  padding: 18px 24px;
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-question:hover { background: #fafafa; }
.faq-arrow { transition: transform 0.2s; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  display: none;
  padding: 0 24px 20px;
  color: #475569;
  font-size: 0.94rem;
  border-top: 1px solid #f8fafc;
}
.faq-item.open .faq-answer { display: block; }

/* License attribution */
.license-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 40px;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.6;
}
.license-box strong { color: #334155; }
