/* TEXT REVEAL ANIMATIONS */
.reveal-text {
  overflow: hidden;
  position: relative;
}

.reveal-text .word {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  animation: revealWord 1s ease forwards;
}

.reveal-text-delay {
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 1s ease 0.5s forwards;
}

@keyframes revealWord {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

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

/* TYPING ANIMATION */
#animated-text::after {
  content: "|";
  animation: blink 1.2s infinite;
  color: var(--color-text);
}

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

/* SCROLL ANIMATIONS */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal-on-scroll.scrolled {
  opacity: 1;
  transform: translateY(0);
}

/* NEUMORPHIC HOVER ANIMATIONS */
.neu-float {
  transition: all var(--transition-medium);
}

.neu-float:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-soft-large);
}

.neu-press {
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-medium);
}

.neu-press:hover {
  box-shadow: var(--shadow-inset);
}

/* NEUMORPHIC PULSE ANIMATION */
.neu-pulse {
  animation: neuPulse 3s infinite;
}

@keyframes neuPulse {
  0% {
    box-shadow: var(--shadow-soft);
  }
  50% {
    box-shadow: var(--shadow-soft-large);
  }
  100% {
    box-shadow: var(--shadow-soft);
  }
}

/* SUBTLE BACKGROUND ANIMATION */
.subtle-bg-animation {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  overflow: hidden;
  z-index: -1;
}

.subtle-bg-shape {
  position: absolute;
  background: linear-gradient(45deg, var(--color-shadow-dark), transparent);
  border-radius: 50%;
  opacity: 0.05;
  filter: blur(30px);
  transition: all 5s ease-in-out;
}

.subtle-bg-shape.shape-1 {
  width: 600px;
  height: 600px;
  top: -300px;
  left: -200px;
  animation: subtleFloat 15s infinite alternate;
}

.subtle-bg-shape.shape-2 {
  width: 450px;
  height: 450px;
  bottom: -200px;
  right: -100px;
  animation: subtleFloat 20s infinite alternate-reverse;
}

@keyframes subtleFloat {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* CODE EDITOR NEUMORPHIC EFFECTS */
.code-editor {
  transition: all var(--transition-medium);
}

.code-editor:hover {
  transform: translateY(-8px);
}

/* EDITOR OUTPUT ANIMATIONS - SOFT TRANSITIONS */
.output-device {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-background);
  z-index: 10;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98);
  transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-inset);
}

.output-device.show {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.close-output {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-medium);
  box-shadow: var(--shadow-soft-small);
  color: var(--color-text);
  z-index: 20;
  background-color: var(--color-background);
}

.close-output:hover {
  box-shadow: var(--shadow-inset-small);
}

/* MOBILE APP ANIMATIONS - NEUMORPHIC STYLE */
.device-frame {
  width: 240px;
  height: 480px;
  background: var(--color-background);
  border-radius: 36px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  box-shadow: var(--shadow-soft-large);
  padding: 8px;
}

.device-screen {
  width: 100%;
  height: 100%;
  background: var(--color-background);
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-inset);
}

.loading-app {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-background);
}

.app-icon {
  width: 80px;
  height: 80px;
  background: var(--color-background);
  border-radius: 20px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: var(--color-text);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  opacity: 0.8;
}

.loading-bar {
  width: 180px;
  height: 6px;
  background: var(--color-background);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: var(--shadow-inset-small);
}

.loading-progress {
  width: 0%;
  height: 100%;
  background: var(--color-text-light);
  border-radius: 3px;
  transition: width 3s ease;
}

.loading-progress.animate {
  width: 100%;
}

.loading-text {
  color: var(--color-text-light);
  font-size: 14px;
}

.app-interface {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-background);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.app-interface.show {
  opacity: 1;
  transform: translateY(0);
}

.app-header {
  padding: 15px;
  background: var(--color-background);
  color: var(--color-text);
  box-shadow: var(--shadow-soft-small);
  border-radius: 0 0 15px 15px;
}

.status-bar {
  height: 20px;
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 10px;
}

.app-title {
  font-weight: 600;
  text-align: center;
  margin-top: 5px;
}

.app-content {
  padding: 20px;
}

.data-card {
  background: var(--color-background);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
}

.card-metrics {
  display: flex;
  justify-content: space-around;
}

.metric {
  text-align: center;
}

.value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.label {
  font-size: 12px;
  color: var(--color-text-light);
}

.data-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.list-item {
  display: flex;
  background: var(--color-background);
  border-radius: 12px;
  padding: 12px;
  align-items: center;
  box-shadow: var(--shadow-soft-small);
}

.item-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--color-background);
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-inset-small);
}

.item-title {
  font-size: 14px;
  color: var(--color-text-light);
}

.item-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
}

.app-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--color-background);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: var(--shadow-soft-small);
  border-radius: 15px 15px 0 0;
}

.nav-item {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-background);
  box-shadow: var(--shadow-soft-small);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.active {
  box-shadow: var(--shadow-inset-small);
}

/* WEB BROWSER ANIMATIONS - NEUMORPHIC STYLE */
.browser-frame {
  width: 90%;
  height: 90%;
  background: var(--color-background);
  border-radius: var(--border-radius-lg);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  box-shadow: var(--shadow-soft-large);
}

.browser-header {
  height: 50px;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-shadow-dark);
  display: flex;
  align-items: center;
  padding: 0 15px;
}

.browser-controls {
  display: flex;
  gap: 10px;
  margin-right: 15px;
}

.browser-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-background);
  box-shadow: var(--shadow-inset-small);
}

.browser-address {
  flex: 1;
  height: 30px;
  background: var(--color-background);
  border-radius: 15px;
  position: relative;
  box-shadow: var(--shadow-inset-small);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 0.85rem;
}

.loading-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--color-text-light);
  animation: loadingIndicator 2.5s ease infinite;
}

@keyframes loadingIndicator {
  0% { width: 0%; left: 0; }
  50% { width: 100%; left: 0; }
  100% { width: 0%; left: 100%; }
}

.browser-viewport {
  height: calc(100% - 50px);
  position: relative;
  overflow: hidden;
}

.loading-website {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-background);
}

.loader {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-bottom: 20px;
  background: var(--color-background);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.loader::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: conic-gradient(transparent, var(--color-text-light), transparent 60%);
  animation: rotate 2s linear infinite;
}

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

.website-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-background);
  padding: 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  overflow-y: auto;
}

.website-content.show {
  opacity: 1;
  transform: translateY(0);
}

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

.website-logo {
  width: 140px;
  height: 40px;
  background: var(--color-background);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-weight: 600;
}

.website-nav {
  display: flex;
  gap: 20px;
}

.website-nav .nav-item {
  width: 80px;
  height: 30px;
  border-radius: var(--border-radius-md);
  background: var(--color-background);
  box-shadow: var(--shadow-soft-small);
  display: flex;
  align-items: center;
  justify-content: center;
}

.website-nav .nav-item.active {
  box-shadow: var(--shadow-inset-small);
}

.dashboard-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dashboard-card {
  background: var(--color-background);
  border-radius: var(--border-radius-md);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  grid-column: span 2;
}

.card-title {
  margin-bottom: 20px;
  font-size: 16px;
  color: var(--color-text);
}

.chart-container {
  height: 150px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 16px;
}

.chart-bar {
  flex: 1;
  background: var(--color-background);
  border-radius: 6px 6px 0 0;
  box-shadow: var(--shadow-inset-small);
  transition: height 1s ease;
}

.dashboard-stats {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stat-card {
  background: var(--color-background);
  border-radius: var(--border-radius-md);
  padding: 15px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-soft);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--border-radius-md);
  background: var(--color-background);
  margin-right: 15px;
  box-shadow: var(--shadow-inset-small);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-data {
  flex: 1;
}

.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-light);
}

/* IOT DEVICE ANIMATIONS - NEUMORPHIC STYLE */
.circuit-board {
  width: 90%;
  height: 90%;
  background: var(--color-background);
  border-radius: var(--border-radius-lg);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  box-shadow: var(--shadow-soft-large);
  padding: 30px;
}

.loading-circuit {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-background);
}

.circuit-animation {
  width: 120px;
  height: 120px;
  position: relative;
  margin-bottom: 20px;
}

.pulse-dot {
  width: 15px;
  height: 15px;
  background: var(--color-background);
  border-radius: 50%;
  position: absolute;
  box-shadow: var(--shadow-soft-small);
}

.pulse-line {
  background: var(--color-shadow-dark);
  position: absolute;
  box-shadow: var(--shadow-inset-small);
  border-radius: 4px;
}

.dot-1 { top: 0; left: 50%; transform: translateX(-50%); }
.dot-2 { bottom: 0; left: 50%; transform: translateX(-50%); }
.dot-3 { left: 0; top: 50%; transform: translateY(-50%); }
.dot-4 { right: 0; top: 50%; transform: translateY(-50%); }

.line-1 { top: 15px; left: 50%; transform: translateX(-50%); width: 4px; height: 90px; }
.line-2 { top: 50%; left: 15px; transform: translateY(-50%); width: 90px; height: 4px; }

.pulse-dot {
  animation: pulseShadow 2s ease infinite;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: var(--color-text-light);
  border-radius: 50%;
  opacity: 0;
  animation: pulseRing 2s ease infinite;
}

@keyframes pulseShadow {
  0%, 100% { box-shadow: var(--shadow-soft-small); }
  50% { box-shadow: var(--shadow-inset-small); }
}

@keyframes pulseRing {
  0% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; }
  50% { opacity: 0.2; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.board-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  padding: 30px;
}

.board-content.show {
  opacity: 1;
  transform: translateY(0);
}

.microcontroller {
  width: 120px;
  height: 80px;
  background: var(--color-background);
  border-radius: var(--border-radius-md);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-soft);
}

.chip-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--color-text);
  font-size: 12px;
  font-family: var(--font-code);
}

.led {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  background: var(--color-background);
  box-shadow: var(--shadow-inset-small);
}

.led-red {
  top: 30%;
  right: 30%;
}

.led-green {
  top: 30%;
  left: 30%;
}

.led-blue {
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
}

.led-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.led.active {
  box-shadow: var(--shadow-soft-small);
}

.led-red.active .led-glow {
  background: rgba(255, 0, 0, 0.1);
  width: 30px;
  height: 30px;
}

.led-green.active .led-glow {
  background: rgba(0, 255, 0, 0.1);
  width: 30px;
  height: 30px;
}

.led-blue.active .led-glow {
  background: rgba(0, 0, 255, 0.1);
  width: 30px;
  height: 30px;
}

.sensor-module {
  width: 50px;
  height: 30px;
  background: var(--color-background);
  border-radius: var(--border-radius-sm);
  position: absolute;
  bottom: 30%;
  right: 30%;
  box-shadow: var(--shadow-soft);
}

.sensor-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text-light);
  font-size: 10px;
  font-family: var(--font-code);
  white-space: nowrap;
}

.trace-line {
  background: var(--color-shadow-dark);
  position: absolute;
  height: 3px;
  border-radius: 1.5px;
}

.horizontal-1 {
  top: calc(30% + 10px);
  left: 30%;
  width: calc(40% - 60px);
}

.horizontal-2 {
  bottom: calc(30% + 15px);
  left: 50%;
  width: calc(20% - 25px);
}

.vertical-1 {
  top: 30%;
  left: 30%;
  width: 3px;
  height: calc(40% - 15px);
}

.vertical-2 {
  top: calc(30% + 10px);
  right: 30%;
  width: 3px;
  height: calc(40% - 25px);
}

.trace-line.active {
  background: var(--color-text-light);
  box-shadow: 0 0 5px var(--color-text-light);
}

/* Portfolio Page Animations */
.project-showcase {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.project-showcase.scrolled {
  opacity: 1;
  transform: translateY(0);
}

.media-carousel .carousel-slide {
  transform: scale(1.05);
  transition: transform 0.7s ease, opacity 0.5s ease;
}

.media-carousel .carousel-slide.active {
  transform: scale(1);
}

.category-tab {
  position: relative;
  overflow: hidden;
}

.category-tab::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.category-tab:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.category-tab.active::after {
  transform: scaleX(1);
}

.tech-badge {
  transition: all 0.3s ease;
}

.tech-badge:hover {
  transform: translateY(-3px);
  box-shadow: 
    5px 5px 10px rgba(0, 0, 0, 0.15),
    -5px -5px 10px rgba(255, 255, 255, 0.08);
}

/* Project tag pulse animation */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(117, 16, 247, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(117, 16, 247, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(117, 16, 247, 0);
  }
}

.project-tag {
  animation: pulse 2s infinite;
}

/* Carousel dots animation */
.dot {
  position: relative;
}

.dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  transition: all 0.3s ease;
}

.dot:hover::after {
  width: 20px;
  height: 20px;
  opacity: 0;
}

.dot.active::after {
  width: 20px;
  height: 20px;
  opacity: 0;
}

/* Portfolio hero section text reveal */
.portfolio-hero .reveal-text {
  overflow: hidden;
  position: relative;
}

.portfolio-hero .reveal-text::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--surface-color);
  animation: text-reveal 1.5s cubic-bezier(0.77, 0, 0.18, 1) forwards;
}

.portfolio-hero .reveal-text-delay::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: var(--surface-color);
  animation: text-reveal 1.5s 0.5s cubic-bezier(0.77, 0, 0.18, 1) forwards;
}

@keyframes text-reveal {
  0% {
    transform: translateX(0%);
  }
  50% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(200%);
  }
} 