body {
  margin: 0;
  padding: 0;
  font-family: "Fira Code", monospace;
  background: #0b0b0c;
  color: #f8f9fa;
  height: 100vh;
  overflow: hidden;
}

/* Main container wrapping everything */
.main-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* Profile card overlay */
.profile-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background: rgba(17, 17, 17, 0.95);
  border: 1px solid #222;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  text-align: center;
  opacity: 0;
  animation: cardAppear 0.8s ease-out forwards;
}

@keyframes cardAppear {
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Profile avatar */
.profile-avatar img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  animation: avatarAppear 0.8s 0.5s ease-out forwards;
}
@keyframes avatarAppear {
  to {
    opacity: 1;
  }
}

/* Name, username, contacts */
.name-fa,
.name-en,
.username,
.contact div {
  opacity: 0;
  transform: translateY(20px);
  animation: textAppear 0.6s ease-out forwards;
}
.name-fa {
  animation-delay: 0.7s;
  font-size: 1.4rem;
  font-weight: 600;
  color: #f1f1f1;
  direction: rtl;
  margin-top: 1rem;
}
.name-en {
  animation-delay: 0.85s;
  font-size: 1.1rem;
  color: #b0b0b0;
  margin-top: 0.25rem;
}
.username {
  animation-delay: 1s;
  margin-top: 0.4rem;
  color: #0d6efd;
  font-weight: 500;
}
.contact div:nth-child(1) {
  animation-delay: 1.1s;
}
.contact div:nth-child(2) {
  animation-delay: 1.2s;
}

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

/* Social links */
.social-links {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(20px);
  animation: socialAppear 0.8s 1.4s ease-out forwards;
}
@keyframes socialAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  transition: 0.3s, transform 0.4s;
}
.social-btn:hover {
  transform: translateY(-5px) rotate(5deg);
  opacity: 0.9;
}
.bg-twitter {
  background: #1da1f2;
}
.bg-instagram {
  background: radial-gradient(
    circle at 30% 107%,
    #fdf497 0%,
    #fdf497 5%,
    #fd5949 45%,
    #d6249f 60%,
    #285aeb 90%
  );
}
.bg-linkedin {
  background: #0077b5;
}
.bg-youtube {
  background: #ff0000;
}
.bg-github {
  background: #171515;
}
.bg-telegram {
  background: #0088cc;
}

/* Code/Output container */
.code-output-container {
  display: flex;
  width: 80%;
  max-width: 1200px;
  height: 80%;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 0;
}

/* Panels */
#code-panel {
  flex: 1;
  background: #1e1e1e;
  padding: 1rem;
  overflow-y: auto;
  white-space: pre;
  border-right: 1px solid #333;
  color: #f8f8f2;
}
#output-panel {
  flex: 1;
  background: #111;
  padding: 1rem;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #a8ff60;
}

/* Typed line animation */
.typed-line {
  opacity: 0;
  transform: translateX(-10px);
  animation: lineAppear 0.3s forwards;
}
@keyframes lineAppear {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#cursor {
  font-weight: bold;
  color: #f8f8f2;
  display: inline;
  margin-left: 2px;
  animation: blink 1s step-start infinite;
}
@keyframes blink {
  50% {
    visibility: hidden;
  }
}

/* Python syntax highlighting */
.syntax-keyword {
  color: #66d9ef;
}
.syntax-string {
  color: #e6db74;
}
.syntax-class {
  color: #a6e22e;
}
.syntax-function {
  color: #fd971f;
}
.syntax-comment {
  color: #75715e;
  font-style: italic;
}

/* Scrollbar styling */
#code-panel,
#output-panel {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
#code-panel::-webkit-scrollbar,
#output-panel::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
#code-panel::-webkit-scrollbar-track,
#output-panel::-webkit-scrollbar-track {
  background: transparent;
}
#code-panel::-webkit-scrollbar-thumb,
#output-panel::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
#code-panel::-webkit-scrollbar-thumb:hover,
#output-panel::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

/* Close button for profile card */
.profile-card .close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: #f8f8f2;
  font-size: 1.5rem;
  cursor: pointer;
  transition: 0.3s;
}
.profile-card .close-btn:hover {
  color: #ff5f5f;
}

/* Blur overlay for profile card */
.blur-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.blur-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Responsive adjustments */

/* Mobile (up to 600px) */
@media (max-width: 600px) {
  .profile-card {
    max-width: 90%;
    padding: 1.5rem;
  }

  .profile-avatar img {
    width: 120px;
    height: 120px;
    border: 4px solid rgba(255, 255, 255, 0.05);
  }

  .name-fa {
    font-size: 1.2rem;
  }

  .name-en {
    font-size: 1rem;
  }

  .username {
    font-size: 0.95rem;
  }

  .social-links {
    gap: 0.4rem;
  }

  .social-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .code-output-container {
    flex-direction: column;
    width: 80%;
    height: 70%;
  }

  #code-panel,
  #output-panel {
    flex: unset;
    width: 100%;
    height: 50%;
    border-right: none;
    border-bottom: 1px solid #333;
  }
}

/* Tablet (601px - 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
  .profile-card {
    max-width: 80%;
    padding: 1.8rem;
  }

  .profile-avatar img {
    width: 140px;
    height: 140px;
    border: 5px solid rgba(255, 255, 255, 0.05);
  }

  .name-fa {
    font-size: 1.3rem;
  }

  .name-en {
    font-size: 1.05rem;
  }

  .username {
    font-size: 1rem;
  }

  .social-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .code-output-container {
    flex-direction: row;
    width: 80%;
    height: 75%;
  }

  #code-panel,
  #output-panel {
    flex: 1;
    width: auto;
    height: 100%;
    border-right: 1px solid #333;
  }
}
