/**
 * Gryffi Instant Preview — Standalone Styles
 * Uses same brand tokens as the main Gryffi app.
 */

[hidden] { display: none !important; }

:root {
  --ip-primary: #0b4b34;
  --ip-primary-light: #0d5c40;
  --ip-primary-dark: #093d2a;
  --ip-accent: #78c503;
  --ip-bg: #ecf2eb;
  --ip-card-bg: #ffffff;
  --ip-text: #1f2937;
  --ip-text-muted: #6b7280;
  --ip-border: #e5e7eb;
  --ip-radius: 16px;
  --ip-font: 'Inter', system-ui, -apple-system, sans-serif;
  --ip-font-display: 'Outfit', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--ip-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ip-text);
  background: var(--ip-bg);
  min-height: 100vh;
}

/* ============================================
   LAYOUT
   ============================================ */

.ip-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

.ip-main {
  padding: 140px 0 40px;
  min-height: calc(100vh - 120px);
}

/* ============================================
   HEADER
   ============================================ */

.ip-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  height: 56px;
}

.ip-header .ip-container {
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.ip-logo img {
  height: 28px;
  width: auto;
}

.ip-lang-nav {
  display: flex;
  gap: 4px;
}

.ip-lang-link {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ip-text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.ip-lang-link:hover {
  color: var(--ip-primary);
  background: rgba(11, 75, 52, 0.06);
}

.ip-lang-link.active {
  color: var(--ip-primary);
  background: rgba(11, 75, 52, 0.08);
}

/* ============================================
   HERO
   ============================================ */

.ip-hero {
  text-align: center;
  margin-bottom: 32px;
}

.ip-heading {
  font-family: var(--ip-font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--ip-primary);
  line-height: 1.2;
  margin-bottom: 12px;
}

.ip-subheading {
  font-size: 17px;
  color: var(--ip-text-muted);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ============================================
   UPLOAD CARD
   ============================================ */

.ip-upload-card {
  background: var(--ip-card-bg);
  border-radius: var(--ip-radius);
  box-shadow: 0 4px 24px rgba(11, 75, 52, 0.08);
  overflow: hidden;
}

.ip-dropzone {
  padding: 48px 32px;
  text-align: center;
  transition: all 0.2s ease;
  border: 2px dashed transparent;
  border-radius: var(--ip-radius);
  margin: 8px;
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ip-dropzone.dragover {
  border-color: var(--ip-accent);
  background: rgba(120, 197, 3, 0.04);
}

.ip-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ip-dropzone-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(11, 75, 52, 0.06), rgba(120, 197, 3, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: var(--ip-primary);
}

.ip-dropzone-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--ip-text);
}

.ip-dropzone-or {
  font-size: 13px;
  color: var(--ip-text-muted);
}

.ip-dropzone-btn {
  display: inline-flex;
  padding: 12px 28px;
  background: var(--ip-primary);
  color: white;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.ip-dropzone-btn:hover {
  background: var(--ip-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 75, 52, 0.2);
}

.ip-dropzone-hint {
  font-size: 13px;
  color: var(--ip-text-muted);
  margin-top: 4px;
}

/* ============================================
   LOADING STATE
   ============================================ */

.ip-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px 20px;
}

.ip-loading-icon {
  position: relative;
  width: 56px;
  height: 56px;
}

.ip-loading-svg {
  animation: ipSpin 1.4s linear infinite;
}

.ip-loading-track {
  stroke: var(--ip-border);
}

.ip-loading-arc {
  stroke: var(--ip-primary);
  stroke-dasharray: 150.8;
  stroke-dashoffset: 100;
  animation: ipArc 1.4s ease-in-out infinite;
}

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

@keyframes ipArc {
  0%   { stroke-dashoffset: 100; }
  50%  { stroke-dashoffset: 30; }
  100% { stroke-dashoffset: 100; }
}

.ip-loading-text {
  font-family: var(--ip-font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ip-primary);
  text-align: center;
  min-height: 28px;
  transition: opacity 0.25s ease;
}

.ip-loading-text.ip-text-fade {
  opacity: 0;
}

.ip-progress-bar {
  width: 100%;
  max-width: 320px;
  height: 6px;
  background: var(--ip-border);
  border-radius: 3px;
  overflow: hidden;
}

.ip-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ip-primary), var(--ip-accent));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ip-loading-detail {
  font-size: 13px;
  color: var(--ip-text-muted);
  text-align: center;
}

/* ============================================
   ERROR & ALERT
   ============================================ */

.ip-error {
  padding: 14px 20px;
  margin: 0 20px 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #dc2626;
  font-size: 14px;
  font-weight: 500;
}

.ip-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  color: #92400e;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
}

/* ============================================
   PRIVACY BADGE
   ============================================ */

.ip-privacy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 20px;
  background: rgba(11, 75, 52, 0.04);
  border-radius: 12px;
  color: var(--ip-primary);
}

.ip-privacy svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.ip-privacy strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.ip-privacy span {
  font-size: 13px;
  color: var(--ip-text-muted);
  line-height: 1.5;
}

.ip-privacy-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ip-primary);
  text-decoration: none;
}

.ip-privacy-link:hover {
  text-decoration: underline;
}

/* ============================================
   FOOTER
   ============================================ */

.ip-footer {
  padding: 24px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ip-footer .ip-container {
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ip-text-muted);
}

.ip-footer a {
  color: var(--ip-primary);
  text-decoration: none;
  font-weight: 500;
}

.ip-footer a:hover {
  text-decoration: underline;
}

.ip-footer-links {
  display: flex;
  gap: 16px;
}

/* ============================================
   GUIDE STEP
   ============================================ */

.ip-guide-profile {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 14px;
  margin-bottom: 4px;
}

.ip-guide-profile > .journey-guide-avatar {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  flex-shrink: 0;
}

.ip-guide-profile > div:last-child {
  flex: 1;
  min-width: 0;
}

.ip-guide-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 24px 0;
}

.ip-guide-chat {
  margin-bottom: 20px;
}

.ip-guide-hint {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 36px;
  font-style: italic;
  line-height: 1.5;
}

/* ============================================
   PREVIEW PAGE — Player Header
   ============================================ */

.preview-body {
  background: var(--ip-bg);
}

.player-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.player-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-header-badge {
  font-size: 13px;
  font-weight: 500;
  color: var(--ip-primary);
  background: rgba(11, 75, 52, 0.06);
  padding: 4px 12px;
  border-radius: 999px;
}

.player-header-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--ip-primary);
  color: white;
  text-decoration: none;
  transition: all 0.15s ease;
}

.player-header-close:hover {
  background: var(--ip-primary-dark);
}

.player-progress {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  z-index: 99;
}

.player-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ip-accent), #8fd41a);
  transition: width 0.3s ease;
}

.preview-body .journey-experience-container {
  padding-top: 80px;
}

/* ============================================
   CTA SECTION
   ============================================ */

.ip-cta-section {
  background: var(--ip-bg);
  padding: 60px 0 80px;
}

.ip-cta-card {
  background: var(--ip-card-bg);
  border-radius: var(--ip-radius);
  box-shadow: 0 4px 24px rgba(11, 75, 52, 0.08);
  padding: 48px 32px;
  text-align: center;
}

.ip-cta-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, rgba(120, 197, 3, 0.15), rgba(11, 75, 52, 0.08));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ip-accent);
}

.ip-cta-heading {
  font-family: var(--ip-font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ip-primary);
  margin-bottom: 12px;
}

.ip-cta-subheading {
  font-size: 16px;
  color: var(--ip-text-muted);
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto 16px;
}

.ip-cta-builder-note {
  font-size: 15px;
  color: var(--ip-text);
  font-weight: 500;
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto 28px;
}

.ip-cta-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  max-width: 340px;
  margin: 0 auto 32px;
}

.ip-cta-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--ip-text);
  font-weight: 500;
}

.ip-cta-features li svg {
  flex-shrink: 0;
  color: var(--ip-accent);
}

.ip-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--ip-primary);
  color: white;
  font-size: 17px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.ip-cta-btn:hover {
  background: var(--ip-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(11, 75, 52, 0.25);
}

.ip-cta-retry {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--ip-text-muted);
  text-decoration: none;
}

.ip-cta-retry:hover {
  color: var(--ip-primary);
  text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .ip-main {
    padding-top: 120px;
  }

  .ip-heading {
    font-size: 28px;
  }

  .ip-subheading {
    font-size: 15px;
  }

  .ip-dropzone {
    padding: 32px 20px;
    min-height: 240px;
  }

  .ip-cta-card {
    padding: 36px 24px;
  }

  .ip-cta-heading {
    font-size: 24px;
  }

  .ip-footer .ip-container {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
