/* ===== CSS VARIABLES ===== */
:root {
  --primary: #f43f5e;
  --dark: #0f172a;
  --light: #f8fafc;
  --accent: #38bdf8;
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== BASE STYLES ===== */
body {
  font-family: 'JetBrains Mono', monospace;
  background: var(--dark);
  color: var(--light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

/* ===== HEADER STYLES ===== */
header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1rem;
  color: var(--accent);
}

/* ===== MAIN CARD STYLES ===== */
.card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 1rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 900px;
  width: 100%;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.card::before {
  content: "✦";
  position: absolute;
  top: -15px;
  left: -15px;
  background: var(--primary);
  color: white;
  font-size: 1.2rem;
  padding: 0.3rem 0.6rem;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.7);
}

/* ===== IMAGE SECTION ===== */
.image-section {
  flex: 0 0 300px;
  max-width: 300px;
  position: relative;
}

.image-container {
  position: relative;
  width: 100%;
  min-height: 400px; /* Ensure container has height */
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
}

.card img,
.profile-image {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  transition: transform 0.4s ease-in-out, box-shadow 0.4s ease, opacity 0.8s ease;
  display: block;
}

/* Positioning for multiple images */
.profile-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensure image covers container */
}

.profile-image.active {
  opacity: 1;
  z-index: 2;
}

.profile-image.inactive {
  opacity: 0;
  z-index: 1;
}

.card img:hover,
.profile-image:hover {
  transform: scale(1.03) rotate(-0.5deg);
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.8);
}

/* Morphing animation */
@keyframes morphIn {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(5deg);
    filter: blur(10px);
  }
  50% {
    transform: scale(1.1) rotate(-2deg);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0px);
  }
}

@keyframes morphOut {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0px);
  }
  50% {
    transform: scale(0.9) rotate(2deg);
    filter: blur(5px);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
    filter: blur(10px);
  }
}

.card img.morph-in {
  animation: morphIn 1.5s ease-in-out forwards;
}

.card img.morph-out {
  animation: morphOut 1.5s ease-in-out forwards;
}

/* ===== CONTENT SECTION ===== */
.content-section {
  flex: 1;
}

.card h2 {
  color: var(--light);
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
  padding-left: 0.5rem;
}

.card p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--light);
}

/* ===== QUOTE STYLES ===== */
.quote {
  text-align: center;
  margin-bottom: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 0.80rem;
  letter-spacing: 0.5px;
  color: #ffffff;
  animation: fadeIn 1s ease-in forwards 0.5s, neonFlicker 2s linear infinite 2s;
  opacity: 0;
}

.quote-divider {
  color: var(--primary);
  font-size: 1.5rem;
  margin: 0 0.5rem;
  text-shadow: 
    0 0 5px var(--primary),
    0 0 10px var(--primary);
}

/* ===== ANIMATIONS ===== */
@keyframes neonFlicker {
  0% {
    opacity: 1;
    text-shadow: 
      0 0 5px var(--accent),
      0 0 10px var(--accent),
      0 0 15px var(--accent),
      0 0 20px var(--accent);
  }
  5% {
    opacity: 0.1;
    text-shadow: none;
  }
  6% {
    opacity: 1;
    text-shadow: 
      0 0 8px var(--accent),
      0 0 16px var(--accent),
      0 0 24px var(--accent);
  }
  15% {
    opacity: 0.2;
    text-shadow: 
      0 0 2px var(--accent);
  }
  16% {
    opacity: 1;
    text-shadow: 
      0 0 5px var(--accent),
      0 0 10px var(--accent),
      0 0 15px var(--accent),
      0 0 20px var(--accent);
  }
  25% {
    opacity: 0.05;
    text-shadow: none;
  }
  27% {
    opacity: 1;
    text-shadow: 
      0 0 10px var(--accent),
      0 0 20px var(--accent),
      0 0 30px var(--accent);
  }
  35% {
    opacity: 0.3;
    text-shadow: 
      0 0 3px var(--accent);
  }
  37% {
    opacity: 1;
    text-shadow: 
      0 0 5px var(--accent),
      0 0 10px var(--accent),
      0 0 15px var(--accent),
      0 0 20px var(--accent);
  }
  100% {
    opacity: 1;
    text-shadow: 
      0 0 5px var(--accent),
      0 0 10px var(--accent),
      0 0 15px var(--accent),
      0 0 20px var(--accent);
  }
}

/* ===== TYPEWRITER EFFECT ===== */
.typewriter {
  border-right: 2px solid var(--primary);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { border-color: var(--primary); }
  51%, 100% { border-color: transparent; }
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ===== SOCIAL SIDEBAR ===== */
.social-sidebar {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
  opacity: 0;
  animation: slideInRight 1s ease-out forwards 3s;
}

@keyframes slideInRight {
  from {
    transform: translateX(100px) translateY(-50%);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(-50%);
    opacity: 1;
  }
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--light);
  text-decoration: none;
  font-size: 1.3rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.social-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.social-icon:hover::before {
  left: 100%;
}

.social-icon:hover {
  transform: translateX(-5px) scale(1.1);
  box-shadow: 
    0 0 20px var(--accent),
    0 0 40px rgba(56, 189, 248, 0.3);
  border-color: var(--accent);
}

/* ===== SOCIAL ICON SPECIFIC STYLES ===== */
.social-icon.facebook:hover {
  background: rgba(24, 119, 242, 0.2);
  color: #1877f2;
}

.social-icon.twitter:hover {
  background: rgba(29, 161, 242, 0.2);
  color: #1da1f2;
}

.social-icon.instagram:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
}

.social-icon.linkedin:hover {
  background: rgba(10, 102, 194, 0.2);
  color: #0a66c2;
}

.social-icon.email:hover {
  background: rgba(244, 63, 94, 0.2);
  color: var(--primary);
}

/* ===== TOOLTIP STYLES ===== */
.social-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  border: 1px solid var(--accent);
}

.social-icon:hover::after {
  opacity: 1;
}

/* ===== FLOATING FOOTER STYLES ===== */
footer {
  position: relative;
  margin-top: 3rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  font-size: 0.9rem;
  color: #94a3b8;
  text-align: center;
  max-width: 900px;
  width: 100%;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  opacity: 0;
  animation: slideUpFooter 1s ease-out forwards 4s;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    transparent 0%,
    var(--primary) 20%, 
    var(--accent) 50%, 
    var(--primary) 80%,
    transparent 100%);
  border-radius: 1rem 1rem 0 0;
  animation: footerGlow 3s ease-in-out infinite;
}

footer::after {
  content: '✦';
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--accent);
  color: white;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.7);
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes slideUpFooter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes footerGlow {
  0%, 100% {
    opacity: 0.6;
    transform: scaleX(1);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.05);
  }
}

@keyframes sparkle {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 1;
  }
}

footer:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-5px);
  transition: all 0.3s ease;
  box-shadow: 
    0 15px 45px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 30px rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.3);
}

footer:hover::before {
  height: 4px;
  opacity: 1;
}

footer:hover::after {
  transform: scale(1.3) rotate(360deg);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.9);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }
  
  header p {
    font-size: 1rem;
  }
  
  .card {
    padding: 1.5rem;
    margin: 0 1rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .image-section {
    flex: none;
    max-width: 250px;
  }
  
  .quote {
    font-size: 1.1rem;
  }
  
  body {
    padding: 1rem;
  }
  
  .social-sidebar {
    right: 1rem;
    gap: 0.8rem;
  }
  
  .social-icon {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
  
  .social-icon::after {
    display: none;
  }
  
  /* Mobile footer adjustments */
  footer {
    padding: 1rem;
    font-size: 0.8rem;
    margin-top: 2rem;
  }
}