/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: #ffffff;
  color: #1a1a1a;
  line-height: 1.6;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.01em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #e5e5e5;
  z-index: 1000;
  transition: all 0.3s ease;
  margin-bottom: 24px;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  font-weight: 500;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.view-toggle {
  display: flex;
  align-items: center;
  background: #ffffff;
  padding: 10px 14px 10px 10px;
  gap: 14px;
}

.toggle-option {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999999;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.toggle-option.active {
  color: #ff5722;
}

.toggle-option:hover:not(.active) {
  color: #666666;
}

.toggle-icon {
  stroke: currentColor;
  transition: all 0.2s ease;
}

.toggle-divider {
  width: 1px;
  height: 20px;
  background: #e5e5e5;
}

/* Main Content */
.main-content {
  flex: 1;
}

/* Chat View */
.chat-view {
  position: fixed;
  top: 88px;
  left: 0;
  right: 0;
  bottom: 124px;
  padding: 24px 0;
  scroll-behavior: smooth;
  display: flex; /* Use flexbox for alignment */
  justify-content: center; /* Center horizontally */
}

.chat-container {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%; /* Make it full height */
  display: flex;
  flex-direction: column;
  position: relative; /* For positioning children */
}

.scroll-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
  position: relative;
  z-index: 1; /* Ensure it's above the fade */

  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.scroll-container::-webkit-scrollbar {
  display: none; /* Webkit browsers */
}

.scroll-container.hide-scrollbar {
  overflow-y: hidden;
}

.fade-out {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px; /* Adjust height as needed */
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 1) 20%,
    rgba(255, 255, 255, 0)
  );
  z-index: 2; /* Must be above the scroll container */
  pointer-events: none; /* Allows clicks to pass through */
}

.scroll-indicator {
  display: none !important;
}

.scroll-spacer {
  height: 100vh;
  min-height: 400px;
  flex-shrink: 0;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.6;
}

.message {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Message spacing is now handled by flexbox gap in .chat-messages */
.message.user {
  margin-top: 0;
}

.message.assistant {
  margin-top: 0;
}

/* Ensure first message has proper top spacing when scrolled to top */
.message:first-child {
  margin-top: 24px;
}

.message-header {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: #999999;
  margin-bottom: 0;
  font-weight: 400;
}

.message-content {
  color: #1a1a1a;
  line-height: 1.6;
  font-size: 15px;
}

.message.user .message-content {
  color: #64748b;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
}

.message.assistant .message-content {
  color: #1a1a1a;
}

.message.assistant .message-content strong {
  font-weight: 600;
  color: #059669;
}

.message.assistant .message-content a {
  color: #3d66cd;
  text-decoration: none;
  font-weight: 500;
}

.message.assistant .message-content a:hover {
  text-decoration: underline;
}

.command-link {
  color: #3d66cd;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.command-link:hover {
  color: #214dbb;
  text-decoration: underline;
}

/* Terminal Prompt Fixed */
.terminal-prompt-fixed {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  padding: 0 24px;
  z-index: 1000;
}

.terminal-prompt-container {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.terminal-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.prompt-section {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: #1a1a1a;
  display: flex;
  align-items: flex-start;
  flex: 1;
  gap: 8px;
  cursor: text;
  transition: opacity 0.2s ease;
}

.input-container {
  position: relative;
  flex: 1;
  cursor: text;
}

.terminal-input {
  background: none;
  border: none;
  outline: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: #1a1a1a;
  width: 100%;
  padding: 0;
  margin: 0;
  transition: all 0.2s ease;
  caret-color: #ff5722;
  position: relative;
  z-index: 2;
  line-height: 1.5;
  min-height: 42px;
  padding-right: 40px;
  resize: none;
  padding-top: 2px;
}

.terminal-input::placeholder {
  color: #999999;
  opacity: 1;
}

.commands-btn {
  background: none;
  border: none;
  color: #666666;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.commands-btn:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.commands-btn svg {
  stroke: currentColor;
}

/* Button Group */
.button-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Return Button */
.return-btn {
  background: none;
  border: 1px solid #e5e5e5;
  color: #666666;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.return-btn:hover,
.return-btn:active {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.return-btn svg {
  stroke: currentColor;
}

/* Commands Popup */
.commands-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease-out;
}

.popup-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: slideUp 0.3s ease-out;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e5e5;
}

.popup-header h3 {
  font-size: 18px;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #666666;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #f5f5f5;
  color: #1a1a1a;
}

.commands-list {
  display: grid;
  gap: 8px;
}

.command-btn {
  background: none;
  border: none;
  padding: 12px 16px;
  text-align: left;
  color: #3b82f6;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  text-decoration: underline;
  text-decoration-color: transparent;
}

.command-btn:hover {
  background: #f0f9ff;
  text-decoration-color: #3b82f6;
}

.command-btn:active {
  background: #dbeafe;
}

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

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

/* Portfolio View */
.portfolio-view {
  min-height: 100vh;
  background: #ffffff;
}

.portfolio-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Sections */
.section {
  padding: 40px 0;
}

#about-section {
  padding: 120px 0 40px 0;
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* About Section */
.hero {
  text-align: center;
  max-width: 800px;
  margin: 48px auto 0 auto;
}

.hero-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 3.5rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.hero-intro {
  max-width: 600px;
  margin: 24px auto 0 auto;
  text-align: center;
}

.hero-intro p {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.6;
  margin: 0;
}

.about-section {
  max-width: 720px;
  margin: 32px auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.about-block {
  text-align: center;
}

.section-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.125rem;
  font-weight: 400;
  color: #475569;
  line-height: 1.7;
  margin: 0;
}

.card-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.card-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.65;
  margin: 0;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin: 0 auto 48px auto;
}

.section-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 2.5rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

/* Work Section */
.work-grid {
  display: grid;
  gap: 24px;
}

.work-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px;
  transition: all 0.2s ease;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}

.work-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.work-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-company {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.work-role {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  color: #3b82f6;
  font-weight: 500;
}

.work-period {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.work-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.work-description {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.work-description li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 16px;
}

.work-description li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #cbd5e1;
  font-weight: bold;
}

.work-description li:last-child {
  margin-bottom: 0;
}

.work-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.highlight-tag {
  font-family: "JetBrains Mono", monospace;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

.skill-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px;
  transition: all 0.2s ease;
}

.skill-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.skill-icon {
  width: 48px;
  height: 48px;
  background: #eff6ff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #3b82f6;
}

.skill-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-family: "JetBrains Mono", monospace;
  background: #f8fafc;
  color: #475569;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
}

/* Contact Section */
.contact-hero {
  text-align: center;
  margin: 0 auto 48px auto;
}

.contact-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 2.5rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.01em;
}

.contact-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
}

.contact-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.contact-icon {
  width: 48px;
  height: 48px;
  background: #eff6ff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
}

.contact-method {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.contact-detail {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

/* Typing Indicator */
.typing-indicator {
  position: fixed;
  bottom: 124px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffff;
  animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingDot {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-container {
    padding: 0 16px;
  }

  .chat-container {
    padding: 0 16px;
  }

  .portfolio-container {
    padding: 0 16px;
  }

  .section {
    padding: 24px 0;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-intro p {
    font-size: 1.125rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .about-section {
    margin-top: 24px;
    gap: 32px;
  }

  .section-text {
    font-size: 1rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .contact-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .work-card {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero {
    margin-top: 32px;
  }

  #about-section {
    padding: 80px 0 24px 0;
  }
}

@media (max-width: 480px) {
  .header-container {
    height: 56px;
  }

  .chat-view {
    top: 76px;
    bottom: 100px;
    padding: 16px 0;
  }

  .section {
    padding: 16px 0;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-intro p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .about-section {
    gap: 24px;
    margin-top: 20px;
    padding: 0 8px;
  }

  .section-text {
    font-size: 0.9rem;
  }

  .hero {
    margin-top: 24px;
  }

  .work-card,
  .skill-card,
  .contact-card {
    padding: 24px;
  }

  #about-section {
    padding: 64px 0 16px 0;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }

  .view-toggle {
    padding: 6px 8px;
    gap: 8px;
  }

  .command-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .popup-content {
    padding: 20px;
    max-width: 400px;
  }

  .terminal-prompt-fixed {
    padding: 0 16px;
    bottom: 16px;
  }

  .terminal-box {
    padding: 12px 16px;
  }

  .prompt-section {
    font-size: 13px;
  }

  .terminal-input {
    font-size: 13px;
  }

  .commands-btn {
    padding: 6px;
  }

  .return-btn {
    width: 28px;
    height: 28px;
    padding: 6px;
  }

  .typing-indicator {
    bottom: 100px;
  }
}
