/* Animation styles for the portfolio terminal website */

/* ID Card Pendulum Animation */
.id-card-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 50px;
  height: 100vh;
}

.id-card-chain {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 80px;
  background: linear-gradient(to bottom, #666, #999, #666);
  transform-origin: top center;
  animation: chainSway 4s ease-in-out infinite;
  z-index: 1;
  border-radius: 2px;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.id-card {
  width: 200px;
  height: 300px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 12px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 20px 40px rgba(0, 0, 0, 0.1);
  transform-origin: top center;
  animation: pendulumSwing 4s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}

.id-card:hover {
  animation-play-state: paused;
  transform: rotate(0deg) scale(1.05);
}

.id-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.id-card::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 20px;
  background: linear-gradient(45deg, #ffd700, #ffed4e);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
  z-index: 3;
}

.id-card-content {
  padding: 70px 20px 20px;
  text-align: center;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.id-card-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    0 0 0 2px rgba(0, 123, 255, 0.1);
  object-fit: cover;
  margin-bottom: 15px;
  background: #f8f9fa;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.id-card-photo:hover {
  transform: scale(1.1);
  box-shadow: 
    0 6px 16px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(0, 123, 255, 0.2);
}

.id-card-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

.id-card-title {
  font-size: 12px;
  color: #666;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.id-card-company {
  font-size: 14px;
  color: #007bff;
  font-weight: 500;
  margin-bottom: 10px;
}

.id-card-location {
  font-size: 11px;
  color: #777;
  margin-bottom: 10px;
}

.id-card-id {
  font-size: 10px;
  color: #999;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  margin-bottom: 15px;
}

.id-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #51cf66;
  animation: statusPulse 2s infinite;
  box-shadow: 0 0 8px rgba(81, 207, 102, 0.5);
}

.status-text {
  font-size: 10px;
  color: #51cf66;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.id-card-hologram {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  animation: hologram 3s ease-in-out infinite;
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

/* Pendulum Animation Keyframes */
@keyframes pendulumSwing {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(15deg); }
}

@keyframes chainSway {
  0%, 100% { transform: translateX(-50%) rotate(-15deg); }
  50% { transform: translateX(-50%) rotate(15deg); }
}

@keyframes statusPulse {
  0%, 100% { 
    opacity: 1; 
    transform: scale(1);
  }
  50% { 
    opacity: 0.6; 
    transform: scale(1.2);
  }
}

@keyframes hologram {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Subtle floating animation for elements */
.floating {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Fade in animation for terminal output */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing animation for terminal */
.typing {
  border-right: 2px solid #00ff00;
  animation: typing 2s steps(40) 1s forwards, blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #00ff00; }
}

/* Glitch effect for special occasions */
.glitch {
  position: relative;
  color: #00ff00;
  animation: glitch 2s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  animation: glitch-1 0.5s infinite;
  color: #ff0000;
  z-index: -1;
}

.glitch::after {
  animation: glitch-2 0.5s infinite;
  color: #0000ff;
  z-index: -2;
}

@keyframes glitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

@keyframes glitch-1 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-1px, 1px); }
  40% { transform: translate(-1px, -1px); }
  60% { transform: translate(1px, 1px); }
  80% { transform: translate(1px, -1px); }
}

@keyframes glitch-2 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(1px, -1px); }
  40% { transform: translate(1px, 1px); }
  60% { transform: translate(-1px, -1px); }
  80% { transform: translate(-1px, 1px); }
}

/* Pulse animation for interactive elements */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Matrix rain effect background */
.matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.1;
  overflow: hidden;
}

.matrix-char {
  position: absolute;
  color: #00ff00;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  animation: matrixFall linear infinite;
}

@keyframes matrixFall {
  from { transform: translateY(-100vh); }
  to { transform: translateY(100vh); }
}

/* Responsive animations */
@media (max-width: 768px) {
  .id-card {
    width: 160px;
    height: 240px;
  }
  
  .id-card-photo {
    width: 60px;
    height: 60px;
  }
  
  .id-card-name {
    font-size: 16px;
  }
  
  .id-card-title {
    font-size: 10px;
  }
  
  .id-card-company {
    font-size: 12px;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .id-card,
  .id-card-chain,
  .floating,
  .pulse,
  .glitch,
  .matrix-char {
    animation: none;
  }
  
  .terminal-cursor {
    animation: none;
    opacity: 1;
  }
}
