/* ================================================
   PIMES.AI - Interactive Demo Section Styles
   Inspired by gnosari.com with animations
   ================================================ */

/* Demo Section Container */
.demo-showcase {
  position: relative;
  padding: 6rem 0;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    var(--bg-color) 0%,
    rgba(215, 226, 235, 0.15) 50%,
    var(--bg-color) 100%
  );
}

.demo-showcase::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      ellipse at 20% 50%,
      rgba(5, 49, 255, 0.04) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 50%,
      rgba(152, 188, 240, 0.04) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.demo-header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  z-index: 10;
}

.demo-header h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.demo-header p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Main Demo Grid */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  position: relative;
  z-index: 10;
}

/* ================================================
   CHAT DEMO COMPONENT
   ================================================ */

.chat-demo {
  background: #fefefe;
  border: 1px solid rgba(175, 178, 180, 0.25);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
  height: 600px;
  display: flex;
  flex-direction: column;
}

.chat-demo-header {
  padding: 1rem 1.5rem;
  background: rgba(242, 245, 246, 0.6);
  border-bottom: 1px solid rgba(175, 178, 180, 0.15);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chat-demo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.chat-demo-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.chat-demo-info span {
  font-size: 0.8rem;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.chat-demo-info span::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-green 2s infinite;
}

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

.chat-demo-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.875rem 1.25rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(20px);
  animation: bubbleIn 0.4s ease forwards;
}

@keyframes bubbleIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--gradient-main);
  color: white;
  border-bottom-right-radius: 6px;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--bg-secondary);
  border: 1px solid rgba(175, 178, 180, 0.2);
  color: var(--text-primary);
  border-bottom-left-radius: 6px;
}

.chat-bubble .time {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 0.5rem;
  display: block;
}

/* Typing indicator */
.typing-indicator-demo {
  display: flex;
  gap: 4px;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid rgba(175, 178, 180, 0.2);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  width: fit-content;
  align-self: flex-start;
}

.typing-indicator-demo span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator-demo span:nth-child(1) {
  animation-delay: 0s;
}
.typing-indicator-demo span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator-demo span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

/* Chat scenario indicator */
.scenario-indicator {
  padding: 0.75rem 1.5rem;
  background: rgba(242, 245, 246, 0.6);
  border-top: 1px solid rgba(175, 178, 180, 0.15);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.scenario-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(175, 178, 180, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
}

.scenario-dot.active {
  background: var(--accent-primary);
  width: 24px;
  border-radius: 4px;
}

/* ================================================
   CALENDAR COMPONENT
   ================================================ */

.calendar-demo {
  background: #fefefe;
  border: 1px solid rgba(175, 178, 180, 0.25);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
  height: 600px;
  display: flex;
  flex-direction: column;
}

.calendar-header {
  padding: 1.5rem;
  background: rgba(242, 245, 246, 0.6);
  border-bottom: 1px solid rgba(175, 178, 180, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.calendar-nav {
  display: flex;
  gap: 0.5rem;
}

.calendar-nav button {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(242, 245, 246, 0.5);
  border: 1px solid rgba(175, 178, 180, 0.2);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.calendar-nav button:hover {
  background: rgba(5, 49, 255, 0.08);
}

.calendar-grid {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 0.5rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  flex: 1;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  position: relative;
  transition: all 0.2s ease;
}

.calendar-day.today {
  background: rgba(5, 49, 255, 0.1);
  color: var(--text-primary);
}

.calendar-day.has-appointments {
  color: var(--text-primary);
}

.calendar-day .day-number {
  font-weight: 500;
  margin-bottom: 2px;
}

.appointment-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}

.appointment-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.appointment-dot.new {
  animation: appointmentPop 0.5s ease forwards;
}

@keyframes appointmentPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.5);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Appointments list */
.appointments-list {
  padding: 1rem;
  border-top: 1px solid var(--glass-border);
  max-height: 180px;
  overflow-y: auto;
}

.appointments-list h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.appointment-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(242, 245, 246, 0.5);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideIn 0.4s ease forwards;
}

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

.appointment-item.new {
  background: rgba(5, 49, 255, 0.06);
  border: 1px solid rgba(5, 49, 255, 0.15);
}

.appointment-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary);
  min-width: 50px;
}

.appointment-details {
  flex: 1;
}

.appointment-details .name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.appointment-details .service {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ================================================
   DATA FLOW VISUALIZATION
   ================================================ */

.data-flow-demo {
  background: #fefefe;
  border: 1px solid rgba(175, 178, 180, 0.25);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
  height: 600px;
  display: flex;
  flex-direction: column;
}

.data-flow-header {
  padding: 1.5rem;
  background: rgba(242, 245, 246, 0.6);
  border-bottom: 1px solid rgba(175, 178, 180, 0.15);
}

.data-flow-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.data-flow-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

/* Data extraction step */
.data-step {
  background: rgba(242, 245, 246, 0.5);
  border: 1px solid rgba(175, 178, 180, 0.15);
  border-radius: 14px;
  padding: 1rem;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.4s ease;
}

.data-step.active {
  opacity: 1;
  transform: scale(1);
  border-color: rgba(5, 49, 255, 0.2);
  background: rgba(5, 49, 255, 0.04);
}

.data-step.completed {
  opacity: 0.7;
  transform: scale(1);
}

.data-step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.data-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.data-step-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.data-step-content {
  font-family: "Monaco", "Menlo", monospace;
  font-size: 0.75rem;
  background: rgba(242, 245, 246, 0.8);
  border-radius: 10px;
  padding: 0.75rem;
  color: var(--text-secondary);
  overflow-x: auto;
}

.data-step-content .key {
  color: #056dff;
}

.data-step-content .value {
  color: #22c55e;
}

.data-step-content .string {
  color: #d97706;
}

/* Flow arrows */
.flow-arrow {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

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

.flow-arrow svg {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

/* Database visualization */
.database-visual {
  background: rgba(242, 245, 246, 0.5);
  border: 1px solid rgba(175, 178, 180, 0.15);
  border-radius: 14px;
  padding: 1rem;
  margin-top: auto;
}

.database-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.database-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.database-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 80px;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(242, 245, 246, 0.5);
  border-radius: 8px;
  font-size: 0.7rem;
  opacity: 0;
  transform: translateY(10px);
  animation: rowIn 0.3s ease forwards;
}

@keyframes rowIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.database-row.new {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.database-row span {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.database-row span:first-child {
  color: var(--accent-primary);
}

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

@media (max-width: 1200px) {
  .demo-grid {
    grid-template-columns: 1fr 1fr;
  }

  .data-flow-demo {
    grid-column: span 2;
    height: 400px;
  }
}

@media (max-width: 768px) {
  .demo-grid {
    grid-template-columns: 1fr;
  }

  .chat-demo,
  .calendar-demo,
  .data-flow-demo {
    height: 500px;
  }

  .data-flow-demo {
    grid-column: span 1;
  }

  .demo-header h2 {
    font-size: 2rem;
  }
}

/* ================================================
   FLOATING ELEMENTS ANIMATION
   ================================================ */

.demo-floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
  animation: floatAround 20s infinite ease-in-out;
}

.floating-shape:nth-child(1) {
  width: 300px;
  height: 300px;
  background: var(--accent-primary);
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.floating-shape:nth-child(2) {
  width: 200px;
  height: 200px;
  background: var(--accent-secondary);
  top: 60%;
  right: 10%;
  animation-delay: -5s;
}

.floating-shape:nth-child(3) {
  width: 250px;
  height: 250px;
  background: var(--accent-tertiary);
  bottom: 10%;
  left: 30%;
  animation-delay: -10s;
}

@keyframes floatAround {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -30px) scale(1.1);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.9);
  }
  75% {
    transform: translate(20px, 30px) scale(1.05);
  }
}
