/*
    impress.js
    
    Styles for impress.js presentations
    
    Copyright 2011-2012 Bartek Szopka (@bartaz)
    
    Released under the MIT and GPL Licenses.
    
    Modernized design for CREstimate.ai presentation (2025)
*/

/* Loading Screen Styles */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease-out;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-title {
  font-family: "Playfair Display", serif;
  font-size: 3.5em;
  font-weight: 700;
  margin-bottom: 30px;
  animation: fadeInUp 0.8s ease-out;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 30px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-family: "Kalam", cursive;
  font-size: 1.1em;
  color: rgba(255, 255, 255, 0.8);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

:root {
  /* Typography colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --text-lighter: #e2e8f0;
  --text-lightest: #f8fafc;
  --text-dark: #0a0a0a;
  --text-link: #1e3a8a;

  /* Monochrome/background colors */
  --mono-white: #ffffff;
  --mono-lightest: #f8fafc;
  --mono-lighter: #f0f4f8;
  --mono-light: #e2e8f0;
  --mono-medium: #94a3b8;
  --mono-dark: #505050;
  --mono-darker: #334155;
  --mono-darkest: #1e293b;

  /* Accent/brand colors */
  --accent-primary: #1e3a8a;
  --accent-primary-hover: #1e40af;
  --accent-secondary: #3b82f6;
  --accent-tertiary: #4f46e5;

  /* Additional accent colors */
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
}

.fallback-message {
  font-family: "Kalam", cursive;
  line-height: 1.3;
  width: 780px;
  padding: 16px;
  margin: 20px auto;
  border: 1px solid var(--mono-light);
  border-radius: 8px;
  background: var(--mono-lightest);
  color: var(--text-secondary);
}
.fallback-message p {
  margin-bottom: 12px;
}
.impress-supported .fallback-message {
  display: none;
}

body {
  font-family: "Kalam", cursive;
  min-height: 100vh;
  color: var(--text-primary);
  background: #e8e8e8;
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
}

/* Blueprint grid background effect */
#blueprint-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -100;
  pointer-events: none;
  overflow: hidden;
}

.blueprint-svg {
  width: 150%;
  height: 150%;
  position: absolute;
  top: -25%;
  left: -25%;
  animation: drift 60s linear infinite;
}

@keyframes drift {
  0% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(-10%, -10%);
  }
  66% {
    transform: translate(5%, -5%);
  }
  100% {
    transform: translate(0, 0);
  }
}

.blueprint-annotations {
  position: absolute;
  width: 100%;
  height: 100%;
}

.blueprint-annotation {
  position: absolute;
  font-family: monospace;
  font-size: 11px;
  color: rgba(30, 58, 138, 0.25);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.step {
  position: relative;
  width: 900px;
  margin: 20px auto;
  box-sizing: border-box;
  font-family: "Patrick Hand", cursive;
  font-size: 32px;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  background-color: var(--mono-white);
  border-radius: 14px;
  padding: 20px 40px 40px 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: #dfdfdf 1px solid;
  color: var(--text-primary);
}

.impress-enabled .step {
  margin: 0;
  opacity: 0.1;
  filter: blur(2px);
  transform: scale(0.95);
  -webkit-transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
  -moz-transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
  -ms-transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
  -o-transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active slide with enhanced entrance */
.impress-enabled .step.active {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

/* Add subtle glow to active slide */
.impress-enabled .step.active::after {
  content: "";
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(
    circle,
    rgba(30, 58, 138, 0.05) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Caveat", cursive;
  margin-top: 15px;
  margin-bottom: 24px;
  font-weight: 600;
  color: var(--accent-primary);
  line-height: 1.2;
}
h1 {
  font-size: 2.2em;
  margin-bottom: 30px;
}
h2 {
  font-size: 1.7em;
  color: var(--accent-primary);
}
h3 {
  font-size: 1.4em;
  color: var(--accent-primary);
}
h4,
h5 {
  font-size: 1.2em;
  color: var(--accent-primary);
}

p {
  color: var(--text-primary);
  font-size: 0.85em;
  margin-bottom: 20px;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

b,
strong {
  font-weight: 600;
  color: var(--accent-primary);
}

ul {
  list-style-type: none;
  padding-left: 10px;
}

li {
  margin-bottom: 18px;
  position: relative;
  padding-left: 35px;
  font-size: 0.85em;
  color: var(--text-primary);
  line-height: 1.9;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  width: 10px;
  height: 10px;
  background-color: var(--accent-primary);
  border-radius: 50%;
}

#learning {
  font-size: 32px;
}

/* Navigation controls container */
#navigation-controls {
  width: 300px;
  margin: 0 auto;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px 20px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

.progress-indicator {
  font-family: "Patrick Hand", cursive;
  color: var(--accent-primary);
  font-size: 18px;
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}

.progress-bar-container {
  height: 4px;
  background-color: rgba(30, 58, 138, 0.1);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #3b82f6);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
  width: 7.7%; /* 1/13 slides */
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  cursor: pointer;
  background-color: var(--accent-primary);
  color: var(--mono-white);
  border: none;
  border-radius: 50%;
  margin: 0 15px;
  transition: transform 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
  background-color: var(--accent-primary-hover);
  transform: scale(1.1);
}

.branding {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  color: var(--accent-primary);
  margin-right: 20px;
  font-size: 1.2em;
}

.presentation-progress {
  width: 150px;
  height: 4px;
  background-color: var(--mono-light);
  border-radius: 2px;
  margin-left: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent-primary);
  transition: width 0.3s ease;
}

/* Special slide styles */
#title {
  text-align: center;
  padding: 60px;
  padding-top: 200px; /* Extra padding to account for image */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: auto !important;
  max-width: none !important;
}

#title h1 {
  /* Uses same Caveat font and accent-primary color as other headers */
  font-size: 3em;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

#title p {
  font-family: "Caveat", cursive;
  color: var(--accent-primary);
  font-size: 1.4em;
  font-weight: 600;
  white-space: nowrap;
}

/* Reveal animation for elements like "The Appraisal" */
.reveal-element {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.reveal-element.active {
  visibility: visible;
  opacity: 1;
}

/* No text animations - all text is visible immediately */

/* Illustrations and graphics */
.illustration {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 30px;
  position: relative;
}

.illustration svg {
  color: var(--accent-primary);
  margin: 0 10px;
  transform-origin: center;
  transition: transform 0.5s ease, color 0.5s ease;
}

.illustration svg:hover {
  transform: scale(1.1);
  color: var(--accent-secondary);
}

.illustration::after {
  content: "";
  position: absolute;
  width: 90%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-primary),
    transparent
  );
  bottom: -15px;
}

/* Pendulum graphics */
.pendulum-container {
  width: 100%;
  height: 200px;
  position: relative;
  margin-top: 40px;
}

.pendulum-labels {
  display: flex;
  justify-content: space-between;
  width: 80%;
  margin: 0 auto;
  position: absolute;
  bottom: 0;
  left: 10%;
}

.art-label,
.science-label {
  font-size: 1.2em;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 20px;
}

.art-label {
  color: var(--accent-red);
  background-color: rgba(239, 68, 68, 0.1);
}

.science-label {
  color: var(--accent-green);
  background-color: rgba(16, 185, 129, 0.1);
}

.pendulum-arm {
  width: 6px;
  height: 150px;
  background-color: var(--mono-dark);
  position: absolute;
  left: 20%;
  top: 0;
  transform-origin: top;
  transform: rotate(30deg);
  transition: transform 1.5s ease-in-out;
}

.pendulum-balanced {
  transform: rotate(0deg);
}

.pendulum-weight {
  width: 30px;
  height: 30px;
  background-color: var(--accent-secondary);
  border-radius: 50%;
  position: absolute;
  bottom: -15px;
  left: -12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.pendulum-people {
  width: 50px;
  height: 50px;
  position: absolute;
  bottom: 20px;
  left: 20%;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%231e3a8a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Adam Smith graphic */
.adam-smith-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
}

.adam-smith-graphic svg {
  color: var(--accent-primary);
  margin-bottom: 20px;
  animation: scale-pulse 2s infinite alternate;
}

@keyframes scale-pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

/* AI Comparison */
.ai-comparison {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  gap: 20px;
}

.ai-type {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ai-type svg {
  margin-top: 15px;
  color: var(--accent-primary);
}

.ai-type p {
  text-align: center;
  margin-bottom: 10px;
}

/* Sentiment Scale */
.sentiment-scale {
  margin-top: 30px;
  text-align: center;
}

.scale-container {
  width: 100%;
  height: 60px;
  position: relative;
  background: linear-gradient(
    90deg,
    var(--accent-red),
    var(--accent-yellow),
    var(--accent-green)
  );
  border-radius: 30px;
  overflow: hidden;
}

.scale-marker.negative {
  left: 0%;
}

.scale-marker.neutral {
  left: 50%;
}

.scale-marker.positive {
  left: 100%;
}

.scale-labels {
  display: flex;
  justify-content: space-around;
  width: 100%;
  text-align: center;
  position: relative;
  padding: 0;
}

.scale-labels span {
  font-size: 0.8em;
  font-weight: 600;
  flex: 1;
  text-align: center;
  display: inline-block;
  position: relative;
}

/* Contact Info styling */
#contact {
  text-align: center;
}

#contact p {
  font-size: 0.9em;
  margin-bottom: 15px;
}

#contact a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

#contact a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

/* Enhanced step styling */
.step {
  transition: opacity 1s ease;
}

.impress-enabled .step.active {
  opacity: 1;
}

/* =====================================================
   DEALT CARD EFFECT STYLES
   ===================================================== */

.step.has-card {
  position: relative;
  overflow: visible;
  z-index: 1;
}

.card-behind {
  position: absolute;
  width: 400px;
  height: 300px;
  z-index: -10;
  pointer-events: none;
}

.card-behind img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ensure content stays on top */
.step.has-card > *:not(.card-behind) {
  position: relative;
  z-index: 10;
}

/* Position variations for dealt cards - all at bottom, farther out */
.card-bottom-right {
  bottom: -220px;
  right: -350px;
  transform: rotate(-4deg);
}

.card-bottom-left {
  bottom: -150px;
  left: -290px;
  transform: rotate(5deg);
}

.card-bottom-center {
  bottom: -250px;
  left: 50%;
  transform: translateX(-50%) rotate(3deg);
}

.card-top-center {
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 375px;
}

/* Top positioning classes */
.card-top-right {
  top: -210px;
  right: -360px;
  transform: rotate(-3deg);
}

.card-top-left {
  top: -145px;
  left: -290px;
  transform: rotate(6deg);
}

/* Removed hover effects for cleaner presentation */

/* Animation when slide becomes active */
.impress-enabled .step.has-card:not(.active) .card-behind {
  opacity: 0;
  transform: rotate(0deg) scale(0.9);
}

.impress-enabled .step.has-card.active .card-behind {
  opacity: 1;
  animation: dealCard 0.8s ease-out;
}

@keyframes dealCard {
  0% {
    transform: translateY(-100px) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  50% {
    transform: translateY(20px) rotate(15deg) scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: translateY(0) rotate(var(--final-rotation, 8deg)) scale(1);
    opacity: 1;
  }
}

/* Set final rotation for each position */
.card-top-right {
  --final-rotation: 8deg;
}

.card-top-left {
  --final-rotation: -8deg;
}

.card-bottom-right {
  --final-rotation: -6deg;
}

.card-bottom-left {
  --final-rotation: 6deg;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1400px) {
  .card-behind {
    width: 250px;
    height: 187px;
  }

  .card-bottom-right {
    bottom: -100px;
    right: -220px;
    transform: rotate(-3deg);
  }

  .card-bottom-left {
    bottom: -90px;
    left: -230px;
    transform: rotate(4deg);
  }

  .card-top-right {
    top: -100px;
    right: -220px;
    transform: rotate(-3deg);
  }

  .card-top-left {
    top: -90px;
    left: -230px;
    transform: rotate(4deg);
  }

  .card-bottom-center {
    bottom: -75px;
    left: 50%;
    transform: translateX(-50%) rotate(3deg);
  }

  .card-top-center {
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 300px;
  }
}

@media (max-width: 1024px) {
  #title {
    padding-top: 150px;
  }

  .card-behind {
    width: 180px;
    height: 135px;
    position: absolute;
    opacity: 0.1;
    z-index: -1;
  }

  /* Position cards farther out on smaller screens too */
  .card-bottom-right {
    bottom: -10px;
    right: -100px;
    transform: rotate(-2deg);
  }

  .card-bottom-left {
    bottom: -5px;
    left: -105px;
    transform: rotate(3deg);
  }

  .card-top-right {
    top: -10px;
    right: -100px;
    transform: rotate(-2deg);
  }

  .card-top-left {
    top: -5px;
    left: -105px;
    transform: rotate(3deg);
  }

  .card-bottom-center {
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) rotate(2deg);
  }

  .card-top-center {
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 225px;
  }
}

@media (max-width: 768px) {
  /* On very small screens, position cards as background overlay */
  .card-behind {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.08;
    transform: none !important;
    border-radius: 8px;
  }

  .card-top-right,
  .card-top-left,
  .card-bottom-right,
  .card-bottom-left,
  .card-bottom-center,
  .card-top-center {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none !important;
  }

  /* Ensure text remains readable */
  .step.has-card > *:not(.card-behind) {
    position: relative;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 4px;
  }
}

.market-users-list {
  display: flex;
  align-items: center;
  opacity: 0.9;
}

.market-users-list p {
  padding-right: 12px;
  margin: 0;
}
