/* Import shared Typeform design system */
@import url('shared-typeform-styles.css');

body {
  background: #000;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Minimal container - content is the focus */
.player-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  position: relative;
}

.player {
  flex: 1;
  background: #000;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Minimal header - only show on hover or at start */
.player-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
  color: white;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
}

.player:hover .player-header,
.player-header.show {
  opacity: 1;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0.9;
}

.logo svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.player-header h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.9;
}

/* Minimal progress bar */
.progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  background: white;
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

/* Content is the star */
.frame-container {
  flex: 1;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Media Frame - clean and focused */
.media-frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.text-overlay {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: min(800px, calc(100% - 4rem));
  text-align: center;
  z-index: 10;
  pointer-events: none;
}

/* Video container */
.video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #000;
}

.frame-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.frame-video-embed {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.admin-edit-button {
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all 0.2s;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .admin-edit-button {
    font-size: 14px;
    padding: 10px 18px;
  }
}

.admin-edit-button:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.change-media-btn {
  position: absolute;
  bottom: 100px;
  right: 20px;
  padding: 14px 28px;
  background: rgba(16, 185, 129, 0.95);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
  z-index: 150;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .change-media-btn {
    bottom: 120px;
    right: 16px;
    padding: 12px 24px;
    font-size: 14px;
  }
}

.change-media-btn:hover {
  background: rgba(16, 185, 129, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.edit-instructions {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.editable-text {
  cursor: text;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  outline: 2px dashed transparent;
}

.editable-text:hover {
  background: rgba(16, 185, 129, 0.1);
  outline-color: rgba(16, 185, 129, 0.3);
}

.editable-text:focus {
  background: rgba(16, 185, 129, 0.15);
  outline-color: #10b981;
}

.media-edit-button {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: rgba(16, 185, 129, 0.9);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s;
  z-index: 10;
}

.media-edit-button:hover {
  background: #059669;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.media-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease-out;
}

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

.media-picker-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.media-picker-content h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 20px;
}

.media-picker-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.media-option {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.media-option label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
}

.media-option input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 8px;
}

.media-option button {
  padding: 8px 16px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.media-option button:hover {
  background: #5568d3;
}

.close-modal {
  margin-top: 16px;
  padding: 10px 20px;
  background: #6b7280;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.close-modal:hover {
  background: #4b5563;
}

.media-frame .media-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.media-frame .text-overlay {
  z-index: 10;
  text-align: center;
  max-width: 800px;
}

.media-frame h2 {
  font-size: 48px;
  font-weight: 700;
  color: white;
  margin-bottom: 24px;
  line-height: 1.2;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.media-frame p {
  font-size: 24px;
  color: white;
  line-height: 1.6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Minimal navigation - only show on hover on desktop, always visible on mobile */
.player-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  color: white;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
}

.player:hover .player-nav,
.player-nav.show {
  opacity: 1;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  color: white;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.mobile-menu.hidden {
  display: none;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-header h2 {
  color: white;
  font-size: 24px;
  margin: 0;
}

.close-menu-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  color: white;
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-reel-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-reel-item {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-reel-item:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.98);
}

.mobile-reel-title {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.mobile-reel-id {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* Always show navigation on mobile/touch devices */
@media (max-width: 768px), (hover: none) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .player-nav {
    opacity: 1;
    padding: 16px;
  }
  
  .nav-btn {
    padding: 14px 20px;
    font-size: 16px;
    min-width: 100px;
    touch-action: manipulation;
  }
  
  #frame-counter {
    font-size: 14px;
  }
  
  .reel-selector {
    display: none !important;
  }
}

.nav-btn {
  padding: 12px 24px;
  border: 2px solid white;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
  background: white;
  color: #000;
  transform: scale(1.05);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#frame-counter {
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Viral Completion Screen - Typeform-esque */
.completion-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
}

.completion-screen.hidden {
  display: none;
}

.completion-content {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.completion-screen h2 {
  font-size: 3rem;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.completion-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  margin-bottom: 3rem;
}

/* Primary Viral CTAs */
.completion-primary-ctas {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.cta-share,
.cta-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem 2rem;
  font-size: 1.125rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

.cta-share {
  background: var(--color-accent);
  color: white;
}

.cta-share:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.cta-create {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 2px solid var(--color-border);
}

.cta-create:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cta-icon {
  font-size: 1.5rem;
}

.cta-text {
  font-size: 1.125rem;
}

/* Optional NPS Survey */
.completion-survey {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.survey-question {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-bottom: 1rem;
}

.survey-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.survey-btn {
  padding: 0.75rem 1.5rem;
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

.survey-btn:hover {
  border-color: var(--color-border-hover);
  background: var(--color-bg-primary);
  transform: translateY(-1px);
}

.survey-btn.selected {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* Secondary actions */
.completion-secondary {
  display: flex;
  justify-content: center;
}

.btn-restart {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--color-text-tertiary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}

.btn-restart:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .completion-screen h2 {
    font-size: 2rem;
  }
  
  .completion-subtitle {
    font-size: 1rem;
  }
  
  .cta-text {
    font-size: 1rem;
  }
}

/* Simple thumbs up/down rating */
.rating-buttons {
  display: flex;
  gap: 32px;
  margin-bottom: 48px;
  justify-content: center;
}

.rating-btn {
  width: 100px;
  height: 100px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 48px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.rating-btn:hover {
  background: white;
  transform: scale(1.15);
}

.rating-btn.thumbs-up:hover {
  color: #10b981;
}

.rating-btn.thumbs-down:hover {
  color: #ef4444;
}

.rating-btn.selected {
  background: white;
  transform: scale(1.15);
}

.rating-btn.thumbs-up.selected {
  color: #10b981;
}

.rating-btn.thumbs-down.selected {
  color: #ef4444;
}

/* Share section on completion screen */
.completion-share-section {
  margin-bottom: 40px;
}

.share-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
  font-weight: 500;
}

.completion-share-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.completion-share-buttons .share-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.completion-share-buttons .share-btn:hover {
  background: white;
  transform: scale(1.1);
}

.completion-share-buttons .share-btn.twitter:hover {
  color: #1DA1F2;
}

.completion-share-buttons .share-btn.facebook:hover {
  color: #4267B2;
}

.completion-share-buttons .share-btn.linkedin:hover {
  color: #0077B5;
}

.completion-share-buttons .share-btn.whatsapp:hover {
  color: #25D366;
}

.completion-share-buttons .share-btn.copy:hover {
  color: #667eea;
}

/* Primary CTA button */
.cta-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 20px 48px;
  background: white;
  color: #667eea;
  border: none;
  border-radius: 16px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  margin-bottom: 32px;
}

.cta-btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  background: #f0f0f0;
}

.cta-icon {
  font-size: 28px;
}

.cta-text {
  letter-spacing: 0.3px;
}

/* Restart button - secondary style */
.restart-btn {
  padding: 12px 24px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  background: transparent;
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.restart-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
  transform: translateY(-2px);
}

/* Hide reel selector on mobile - content is focus */
.reel-selector {
  display: none;
}

@media (min-width: 1024px) {
  .reel-selector {
    display: block;
    width: 300px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    padding: 24px;
    overflow-y: auto;
  }

  .reel-selector h3 {
    color: white;
    font-size: 18px;
    margin-bottom: 16px;
  }

  .reel-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .reel-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
  }

  .reel-item-title {
    color: white;
    font-weight: 600;
    margin-bottom: 4px;
  }

  .reel-item-id {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
  }
}

/* Quiz, Ack, Survey frames - keep existing styles but cleaner */
.quiz-frame, .ack-frame, .survey-frame {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.quiz-frame h2, .ack-frame h2, .survey-frame h2 {
  font-size: 36px;
  color: white;
  margin-bottom: 24px;
  text-align: center;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 500px;
}

.quiz-option {
  padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.quiz-option:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
  transform: translateX(8px);
}

.quiz-option.selected {
  background: white;
  color: #667eea;
  border-color: white;
}

.quiz-option.correct {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.quiz-option.incorrect {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.quiz-rationale {
  margin-top: 24px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border: 2px solid #10b981;
  border-radius: 12px;
  color: #065f46;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  position: relative;
  padding-left: 52px;
}

.quiz-rationale::before {
  content: '✓';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.ack-checkbox {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  margin: 24px 0;
}

.ack-checkbox:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
}

.ack-checkbox.checked {
  background: white;
  color: #667eea;
  border-color: white;
}

/* Subtitles - positioned near bottom */
.subtitles {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, calc(100% - 4rem));
  text-align: center;
  z-index: 50;
}

.subtitle-text {
  display: inline-block;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  color: white;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.5;
  max-width: 85%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

/* Hidden utility */
.hidden {
  display: none !important;
}
