/* ==========================================================================
   YT Convert — Premium Interface Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --ytc-primary: #4f46e5;
  --ytc-primary-hover: #4338ca;
  --ytc-primary-light: #eef2ff;
  --ytc-primary-50: #f5f3ff;
  --ytc-primary-ring: rgba(79, 70, 229, 0.2);

  --ytc-green: #059669;
  --ytc-green-hover: #047857;
  --ytc-green-light: #ecfdf5;

  --ytc-red: #dc2626;
  --ytc-red-hover: #b91c1c;
  --ytc-red-light: #fef2f2;

  --ytc-amber: #d97706;
  --ytc-amber-light: #fffbeb;

  --ytc-gray-50: #fafafa;
  --ytc-gray-100: #f5f5f5;
  --ytc-gray-200: #e5e5e5;
  --ytc-gray-300: #d4d4d4;
  --ytc-gray-400: #a3a3a3;
  --ytc-gray-500: #737373;
  --ytc-gray-600: #525252;
  --ytc-gray-700: #404040;
  --ytc-gray-800: #262626;
  --ytc-gray-900: #171717;

  --ytc-tree-section: #4f46e5;
  --ytc-tree-row: #737373;
  --ytc-tree-column: #059669;
  --ytc-tree-element: #9333ea;

  --ytc-radius: 10px;
  --ytc-radius-sm: 6px;
  --ytc-radius-lg: 16px;
  --ytc-radius-xl: 20px;

  --ytc-shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --ytc-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --ytc-shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.05);
  --ytc-shadow-md: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.05);
  --ytc-shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --ytc-shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);

  --ytc-transition: 180ms ease;
  --ytc-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --ytc-transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
.ytc-app {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ytc-gray-800);
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.ytc-app *,
.ytc-app *::before,
.ytc-app *::after {
  box-sizing: border-box;
}


/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.ytc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.ytc-header__logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--ytc-primary), #7c3aed);
  border-radius: var(--ytc-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  letter-spacing: -0.5px;
}

.ytc-header__title {
  font-size: 24px;
  font-weight: 800;
  color: var(--ytc-gray-900);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.ytc-header__subtitle {
  font-size: 13px;
  color: var(--ytc-gray-500);
  margin: 3px 0 0;
  font-weight: 400;
}

.ytc-header__nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.ytc-header__nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ytc-gray-500);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--ytc-radius);
  cursor: pointer;
  transition: all var(--ytc-transition);
}

.ytc-header__nav-btn:hover {
  color: var(--ytc-gray-800);
  background: var(--ytc-gray-100);
}

.ytc-header__nav-btn--active {
  color: var(--ytc-primary);
  background: var(--ytc-primary-light);
  border-color: rgba(79, 70, 229, 0.15);
}

.ytc-header__nav-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.ytc-card {
  background: #fff;
  border: 1px solid var(--ytc-gray-200);
  border-radius: var(--ytc-radius-xl);
  box-shadow: var(--ytc-shadow-sm);
  padding: 28px;
  margin-bottom: 20px;
  transition: box-shadow var(--ytc-transition-slow);
}

.ytc-card:hover {
  box-shadow: var(--ytc-shadow);
}

.ytc-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ytc-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ytc-gray-800);
  margin: 0;
  letter-spacing: -0.2px;
}


/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.ytc-tabs {
  display: flex;
  background: var(--ytc-gray-100);
  border-radius: var(--ytc-radius);
  padding: 4px;
  gap: 4px;
  margin-bottom: 24px;
}

.ytc-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--ytc-gray-500);
  background: transparent;
  border: none;
  border-radius: var(--ytc-radius-sm);
  cursor: pointer;
  transition: all var(--ytc-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.ytc-tab:hover {
  color: var(--ytc-gray-700);
  background: rgba(255,255,255,0.5);
}

.ytc-tab--active {
  color: var(--ytc-primary);
  background: #fff;
  box-shadow: var(--ytc-shadow-xs);
}

.ytc-tab__icon {
  display: flex;
  align-items: center;
  line-height: 1;
}

.ytc-tab__icon svg {
  width: 16px;
  height: 16px;
}

.ytc-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 700;
  background: var(--ytc-green);
  color: #fff;
  border-radius: 50%;
  position: absolute;
  top: 4px;
  right: 4px;
}

.ytc-tab__badge svg {
  width: 10px;
  height: 10px;
}


/* --------------------------------------------------------------------------
   Tab Panels
   -------------------------------------------------------------------------- */
.ytc-tab-panel {
  display: none;
}

.ytc-tab-panel--active {
  display: block;
  animation: ytcSlideUp 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ytcSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ytcFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ytcScaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}


/* --------------------------------------------------------------------------
   URL Input
   -------------------------------------------------------------------------- */
.ytc-url-group {
  display: flex;
  gap: 8px;
}

.ytc-url-input {
  flex: 1;
  padding: 11px 16px;
  font-size: 14px;
  border: 1.5px solid var(--ytc-gray-200);
  border-radius: var(--ytc-radius);
  background: var(--ytc-gray-50);
  color: var(--ytc-gray-800);
  transition: all var(--ytc-transition);
  outline: none;
}

.ytc-url-input:focus {
  border-color: var(--ytc-primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--ytc-primary-ring);
}

.ytc-url-input::placeholder {
  color: var(--ytc-gray-400);
}


/* --------------------------------------------------------------------------
   Drop Zone
   -------------------------------------------------------------------------- */
.ytc-dropzone {
  border: 2px dashed var(--ytc-gray-300);
  border-radius: var(--ytc-radius-lg);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--ytc-transition);
  position: relative;
  background: var(--ytc-gray-50);
}

.ytc-dropzone:hover {
  border-color: var(--ytc-primary);
  background: var(--ytc-primary-50);
}

.ytc-dropzone--dragover {
  border-color: var(--ytc-primary);
  background: var(--ytc-primary-light);
  border-style: solid;
  box-shadow: var(--ytc-shadow-glow);
}

.ytc-dropzone--has-file {
  border-color: var(--ytc-green);
  border-style: solid;
  background: var(--ytc-green-light);
  cursor: default;
}

.ytc-dropzone__icon {
  margin-bottom: 8px;
  color: var(--ytc-gray-400);
  transition: color var(--ytc-transition);
  display: flex;
  justify-content: center;
}

.ytc-dropzone__icon svg {
  width: 36px;
  height: 36px;
}

.ytc-dropzone:hover .ytc-dropzone__icon {
  color: var(--ytc-primary);
}

.ytc-dropzone--has-file .ytc-dropzone__icon {
  color: var(--ytc-green);
}

.ytc-dropzone__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ytc-gray-600);
  margin: 0 0 4px;
}

.ytc-dropzone__hint {
  font-size: 12px;
  color: var(--ytc-gray-400);
  margin: 0;
}

.ytc-dropzone__input {
  display: none;
}

.ytc-dropzone__browse {
  color: var(--ytc-primary);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--ytc-transition);
}

.ytc-dropzone__browse:hover {
  color: var(--ytc-primary-hover);
  text-decoration: underline;
}

/* File info */
.ytc-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ytc-gray-50);
  border-radius: var(--ytc-radius);
  border: 1px solid var(--ytc-gray-200);
}

.ytc-file-info__icon {
  color: var(--ytc-primary);
  display: flex;
}

.ytc-file-info__icon svg {
  width: 22px;
  height: 22px;
}

.ytc-file-info__details {
  flex: 1;
  text-align: left;
}

.ytc-file-info__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ytc-gray-800);
  word-break: break-all;
}

.ytc-file-info__meta {
  font-size: 12px;
  color: var(--ytc-gray-500);
  margin-top: 1px;
}

.ytc-file-info__remove {
  background: none;
  border: none;
  color: var(--ytc-gray-400);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--ytc-radius-sm);
  transition: all var(--ytc-transition);
  display: flex;
}

.ytc-file-info__remove svg {
  width: 16px;
  height: 16px;
}

.ytc-file-info__remove:hover {
  color: var(--ytc-red);
  background: var(--ytc-red-light);
}

.ytc-screenshot-thumb {
  max-width: 200px;
  max-height: 140px;
  border-radius: var(--ytc-radius);
  border: 1px solid var(--ytc-gray-200);
  object-fit: contain;
  margin-bottom: 8px;
}


/* --------------------------------------------------------------------------
   Options Panel
   -------------------------------------------------------------------------- */
.ytc-options-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ytc-gray-600);
  cursor: pointer;
  padding: 8px 0;
  transition: color var(--ytc-transition);
}

.ytc-options-toggle:hover {
  color: var(--ytc-gray-800);
}

.ytc-options-toggle__chevron {
  display: flex;
  transition: transform var(--ytc-transition);
}

.ytc-options-toggle__chevron svg {
  width: 14px;
  height: 14px;
}

.ytc-options-toggle--open .ytc-options-toggle__chevron {
  transform: rotate(90deg);
}

.ytc-options-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--ytc-transition-slow);
}

.ytc-options-panel--open {
  max-height: 600px;
}

.ytc-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 0 8px;
}

.ytc-options-grid--full {
  grid-template-columns: 1fr;
}

.ytc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ytc-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ytc-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.ytc-input,
.ytc-select {
  padding: 9px 14px;
  font-size: 13px;
  border: 1.5px solid var(--ytc-gray-200);
  border-radius: var(--ytc-radius-sm);
  background: var(--ytc-gray-50);
  color: var(--ytc-gray-800);
  outline: none;
  transition: all var(--ytc-transition);
}

.ytc-input:focus,
.ytc-select:focus {
  border-color: var(--ytc-primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--ytc-primary-ring);
}

.ytc-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23737373' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.ytc-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.ytc-checkbox-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ytc-primary);
  cursor: pointer;
}

.ytc-checkbox-label {
  font-size: 13px;
  color: var(--ytc-gray-700);
}

.ytc-checkbox-note {
  font-size: 11px;
  color: var(--ytc-gray-400);
  margin-left: 24px;
  margin-top: -2px;
}

.ytc-range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ytc-range {
  flex: 1;
  appearance: none;
  height: 4px;
  background: var(--ytc-gray-200);
  border-radius: 2px;
  outline: none;
}

.ytc-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ytc-primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform var(--ytc-transition);
}

.ytc-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.ytc-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ytc-primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.ytc-range-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--ytc-gray-600);
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}


/* --------------------------------------------------------------------------
   Preview Card
   -------------------------------------------------------------------------- */
.ytc-preview {
  display: none;
}

.ytc-preview--visible {
  display: block;
  animation: ytcScaleIn 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ytc-preview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.ytc-preview__stat {
  background: var(--ytc-gray-50);
  border: 1px solid var(--ytc-gray-200);
  border-radius: var(--ytc-radius);
  padding: 14px;
  text-align: center;
}

.ytc-preview__stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--ytc-gray-800);
  line-height: 1.2;
}

.ytc-preview__stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ytc-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.ytc-preview__content {
  margin-top: 12px;
  padding: 14px;
  background: var(--ytc-gray-50);
  border-radius: var(--ytc-radius);
  font-size: 13px;
  color: var(--ytc-gray-600);
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--ytc-gray-200);
}

.ytc-preview__screenshot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}


/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.ytc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--ytc-radius);
  cursor: pointer;
  transition: all var(--ytc-transition);
  outline: none;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}

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

.ytc-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.ytc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ytc-btn--primary {
  background: linear-gradient(135deg, var(--ytc-primary), #6366f1);
  color: #fff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.ytc-btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--ytc-primary-hover), #4f46e5);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transform: translateY(-1px);
}

.ytc-btn--success {
  background: linear-gradient(135deg, var(--ytc-green), #10b981);
  color: #fff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

.ytc-btn--success:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--ytc-green-hover), #059669);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
  transform: translateY(-1px);
}

.ytc-btn--secondary {
  background: #fff;
  color: var(--ytc-gray-700);
  border: 1.5px solid var(--ytc-gray-200);
}

.ytc-btn--secondary:hover:not(:disabled) {
  background: var(--ytc-gray-50);
  border-color: var(--ytc-gray-300);
  box-shadow: var(--ytc-shadow-xs);
}

.ytc-btn--ghost {
  background: transparent;
  color: var(--ytc-primary);
  padding: 8px 14px;
}

.ytc-btn--ghost:hover:not(:disabled) {
  background: var(--ytc-primary-50);
}

.ytc-btn--sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: var(--ytc-radius-sm);
}

.ytc-btn--lg {
  padding: 14px 36px;
  font-size: 15px;
  border-radius: var(--ytc-radius);
  letter-spacing: -0.1px;
}

.ytc-btn--full {
  width: 100%;
}


/* --------------------------------------------------------------------------
   Convert Button
   -------------------------------------------------------------------------- */
.ytc-convert-section {
  text-align: center;
  padding: 8px 0;
}


/* --------------------------------------------------------------------------
   Progress
   -------------------------------------------------------------------------- */
.ytc-progress {
  display: none;
}

.ytc-progress--visible {
  display: block;
  animation: ytcScaleIn 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ytc-progress__bar-track {
  height: 6px;
  background: var(--ytc-gray-100);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 24px;
}

.ytc-progress__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ytc-primary), #7c3aed);
  border-radius: 3px;
  transition: width var(--ytc-transition-slow);
  width: 0%;
  position: relative;
}

.ytc-progress__bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: ytcShimmer 2s ease-in-out infinite;
}

@keyframes ytcShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.ytc-progress__steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ytc-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  transition: opacity var(--ytc-transition);
}

.ytc-step--pending {
  opacity: 0.35;
}

.ytc-step--active {
  opacity: 1;
}

.ytc-step--done {
  opacity: 0.65;
}

.ytc-step__indicator {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  transition: all var(--ytc-transition);
}

.ytc-step__indicator svg {
  width: 12px;
  height: 12px;
}

.ytc-step--pending .ytc-step__indicator {
  background: var(--ytc-gray-100);
  color: var(--ytc-gray-400);
  border: 1.5px solid var(--ytc-gray-200);
}

.ytc-step--active .ytc-step__indicator {
  background: var(--ytc-primary);
  color: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.ytc-step--done .ytc-step__indicator {
  background: var(--ytc-green-light);
  color: var(--ytc-green);
  border: 1.5px solid rgba(5, 150, 105, 0.2);
}

.ytc-step__label {
  font-size: 13px;
  color: var(--ytc-gray-600);
  padding-top: 4px;
}

.ytc-step--active .ytc-step__label {
  font-weight: 600;
  color: var(--ytc-gray-900);
}

.ytc-step--done .ytc-step__label {
  color: var(--ytc-gray-400);
  text-decoration: line-through;
}


/* --------------------------------------------------------------------------
   Spinner
   -------------------------------------------------------------------------- */
@keyframes ytcSpin {
  to { transform: rotate(360deg); }
}

.ytc-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ytcSpin 0.6s linear infinite;
  vertical-align: middle;
}

.ytc-spinner--lg {
  width: 24px;
  height: 24px;
  border-width: 3px;
}


/* --------------------------------------------------------------------------
   Results
   -------------------------------------------------------------------------- */
.ytc-results {
  display: none;
}

.ytc-results--visible {
  display: block;
  animation: ytcScaleIn 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ytc-results__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.ytc-stat {
  background: var(--ytc-gray-50);
  border: 1px solid var(--ytc-gray-200);
  border-radius: var(--ytc-radius-lg);
  padding: 20px 16px;
  text-align: center;
  transition: border-color var(--ytc-transition), box-shadow var(--ytc-transition);
}

.ytc-stat:hover {
  border-color: var(--ytc-primary-ring);
  box-shadow: var(--ytc-shadow-xs);
}

.ytc-stat__value {
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ytc-primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.ytc-stat__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ytc-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

.ytc-results__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}


/* --------------------------------------------------------------------------
   Layout Tree
   -------------------------------------------------------------------------- */
.ytc-tree {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  background: var(--ytc-gray-50);
  border: 1px solid var(--ytc-gray-200);
  border-radius: var(--ytc-radius-lg);
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
}

.ytc-tree ul {
  list-style: none;
  padding-left: 20px;
  margin: 0;
}

.ytc-tree > ul {
  padding-left: 0;
}

.ytc-tree li {
  position: relative;
}

.ytc-tree-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--ytc-radius-sm);
  cursor: default;
  transition: background var(--ytc-transition);
  user-select: none;
}

.ytc-tree-node:hover {
  background: var(--ytc-gray-200);
}

.ytc-tree-node--collapsible {
  cursor: pointer;
}

.ytc-tree-node__toggle {
  display: inline-block;
  width: 14px;
  font-size: 10px;
  text-align: center;
  color: var(--ytc-gray-400);
  transition: transform var(--ytc-transition);
}

.ytc-tree-node__toggle--collapsed {
  transform: rotate(-90deg);
}

.ytc-tree-node__icon {
  font-size: 13px;
}

.ytc-tree-node__type {
  font-weight: 600;
}

.ytc-tree-node--section .ytc-tree-node__type { color: var(--ytc-tree-section); }
.ytc-tree-node--row .ytc-tree-node__type { color: var(--ytc-tree-row); }
.ytc-tree-node--column .ytc-tree-node__type { color: var(--ytc-tree-column); }
.ytc-tree-node--element .ytc-tree-node__type { color: var(--ytc-tree-element); }

.ytc-tree-node__cls {
  font-size: 11px;
  color: var(--ytc-gray-400);
  font-weight: 400;
}

.ytc-tree-node__count {
  font-size: 10px;
  color: var(--ytc-gray-400);
  background: var(--ytc-gray-200);
  padding: 1px 6px;
  border-radius: 8px;
}

.ytc-tree li.ytc-tree--collapsed > ul {
  display: none;
}


/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.ytc-alert {
  padding: 12px 16px;
  border-radius: var(--ytc-radius);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  animation: ytcSlideUp 250ms ease;
}

.ytc-alert--error {
  background: var(--ytc-red-light);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--ytc-red);
}

.ytc-alert--success {
  background: var(--ytc-green-light);
  border: 1px solid rgba(5, 150, 105, 0.2);
  color: var(--ytc-green);
}

.ytc-alert--info {
  background: var(--ytc-primary-light);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--ytc-primary);
}

.ytc-alert__icon {
  flex-shrink: 0;
  display: flex;
  padding-top: 1px;
}

.ytc-alert__icon svg {
  width: 16px;
  height: 16px;
}

.ytc-alert__message {
  flex: 1;
  line-height: 1.5;
}

.ytc-alert__close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.5;
  padding: 0;
  line-height: 1;
  font-size: 16px;
  transition: opacity var(--ytc-transition);
}

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


/* --------------------------------------------------------------------------
   Validation
   -------------------------------------------------------------------------- */
.ytc-validation {
  font-size: 12px;
  color: var(--ytc-red);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}


/* --------------------------------------------------------------------------
   Password Gate
   -------------------------------------------------------------------------- */
.ytc-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 24px;
}

.ytc-gate__card {
  background: #fff;
  border-radius: var(--ytc-radius-xl);
  box-shadow: var(--ytc-shadow-lg);
  padding: 48px 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: ytcScaleIn 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ytc-gate__logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--ytc-primary), #7c3aed);
  border-radius: var(--ytc-radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  letter-spacing: -0.5px;
}

.ytc-gate__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ytc-gray-900);
  margin: 0 0 4px;
  letter-spacing: -0.5px;
}

.ytc-gate__subtitle {
  font-size: 13px;
  color: var(--ytc-gray-500);
  margin: 0 0 28px;
}

.ytc-gate__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ytc-gate__input {
  padding: 12px 16px;
  font-size: 14px;
  border: 1.5px solid var(--ytc-gray-200);
  border-radius: var(--ytc-radius);
  background: var(--ytc-gray-50);
  color: var(--ytc-gray-800);
  outline: none;
  text-align: center;
  letter-spacing: 2px;
  transition: all var(--ytc-transition);
}

.ytc-gate__input:focus {
  border-color: var(--ytc-primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--ytc-primary-ring);
}

.ytc-gate__input::placeholder {
  letter-spacing: 0;
  color: var(--ytc-gray-400);
}

.ytc-gate__error {
  font-size: 13px;
  color: var(--ytc-red);
  min-height: 20px;
}

@keyframes ytcShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.ytc-gate__card--shake {
  animation: ytcShake 400ms ease;
}


/* --------------------------------------------------------------------------
   Admin / Settings Page
   -------------------------------------------------------------------------- */
.ytc-admin {
  animation: ytcSlideUp 300ms ease;
}

.ytc-admin__section {
  margin-bottom: 24px;
}

.ytc-admin__section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ytc-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ytc-gray-200);
}

.ytc-admin__field {
  margin-bottom: 16px;
}

.ytc-admin__field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ytc-gray-700);
  margin-bottom: 4px;
}

.ytc-admin__field-hint {
  font-size: 11px;
  color: var(--ytc-gray-400);
  margin-top: 3px;
}

.ytc-admin__field-input {
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  border: 1.5px solid var(--ytc-gray-200);
  border-radius: var(--ytc-radius-sm);
  background: var(--ytc-gray-50);
  color: var(--ytc-gray-800);
  outline: none;
  transition: all var(--ytc-transition);
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
}

.ytc-admin__field-input:focus {
  border-color: var(--ytc-primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--ytc-primary-ring);
}

.ytc-admin__field-input--text {
  font-family: inherit;
}

.ytc-admin__actions {
  display: flex;
  gap: 12px;
  padding-top: 8px;
}

.ytc-admin__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  min-height: 20px;
  margin-top: 8px;
}

.ytc-admin__status--success {
  color: var(--ytc-green);
}

.ytc-admin__status--error {
  color: var(--ytc-red);
}


/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.ytc-hidden {
  display: none !important;
}

.ytc-view-hidden {
  display: none;
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .ytc-app {
    padding: 20px 16px 40px;
  }

  .ytc-card {
    padding: 20px;
    border-radius: var(--ytc-radius-lg);
  }

  .ytc-options-grid {
    grid-template-columns: 1fr;
  }

  .ytc-url-group {
    flex-direction: column;
  }

  .ytc-results__actions {
    flex-direction: column;
  }

  .ytc-results__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .ytc-tabs {
    gap: 2px;
  }

  .ytc-tab {
    padding: 8px 10px;
    font-size: 12px;
    gap: 5px;
  }

  .ytc-header__nav {
    gap: 2px;
  }

  .ytc-header__nav-btn span {
    display: none;
  }

  .ytc-gate__card {
    padding: 36px 24px;
  }
}


/* --------------------------------------------------------------------------
   WordPress Admin Overrides
   -------------------------------------------------------------------------- */
body.wp-admin .ytc-app {
  margin-left: 0;
  padding-top: 20px;
}

body.wp-admin .ytc-card {
  box-shadow: var(--ytc-shadow-xs);
}
