/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Fira Code', 'Courier New', monospace;
  background: linear-gradient(135deg, #0c1445 0%, #1a1a2e 50%, #16213e 100%);
  color: #00ff00;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Terminal Container - Centers Everything and holds terminal + sidebar */
.terminal-container {
  display: flex; /* Make it a flex container */
  justify-content: center;
  align-items: flex-start; /* Align items to the top (or center if you prefer for overall look) */
  min-height: 100vh;
  width: 100%;
  padding: 20px;
  position: relative;
  gap: 30px; /* Space between terminal and button sidebar */
}

/* Background Animation */
.terminal-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
      radial-gradient(circle at 20% 80%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(0, 255, 0, 0.1) 0%, transparent 50%);
  animation: pulse 4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes pulse {
  0% { opacity: 0.3; }
  100% { opacity: 0.7; }
}

/* Main Terminal Window */
.terminal {
  width: 90%;
  max-width: 900px;
  background: rgba(0, 0, 0, 0.95);
  border-radius: 12px;
  box-shadow:
      0 20px 40px rgba(0, 0, 0, 0.8),
      0 0 0 1px rgba(0, 255, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  overflow: hidden;
  position: relative;
  z-index: 1;
  flex-shrink: 0; /* Prevent terminal from shrinking too much */
}

/* Terminal Content */
.terminal-content {
  padding: 25px;
  color: #00ff00;
  font-size: 14px;
  line-height: 1.6;
  min-height: 500px; /* Ensures a consistent height even with little content */
  position: relative;
}

.terminal-line {
  margin-bottom: 8px;
  word-wrap: break-word;
}

.prompt {
  color: #00ff00;
  font-weight: 500;
  text-shadow: 0 0 3px rgba(0, 255, 0, 0.5);
}

.command {
  color: #ffffff;
  margin-left: 5px;
}

/*.cursor {
  animation: blink 1s infinite;
  color: #00ff00;
  font-weight: bold;
}

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

/* Welcome Box */
.welcome-box {
  margin: 20px 0;
  color: #00ffff;
}

.box-border {
  border: 2px solid #00ff00;
  border-radius: 8px;
  padding: 20px;
  background: rgba(0, 255, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.box-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.1), transparent);
  animation: scan 3s linear infinite;
}

@keyframes scan {
  0% { left: -100%; }
  100% { left: 100%; }
}

.welcome-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 10px;
  color: #00ff00;
  text-align: center;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.welcome-text {
  font-size: 14px;
  color: #00ffff;
  text-align: center;
  line-height: 1.5;
}

/* Terminal Prompt */
.terminal-prompt {
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Button Sidebar - NEW */
.button-sidebar {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    align-items: flex-start; /* Align buttons to the left within the sidebar */
    padding: 20px 0; /* Add some padding if needed */
}

/* Button Grid - Modified for vertical stacking */
.button-grid {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 12px; /* Space between buttons */
    /* No margin-top here anymore, controlled by button-sidebar position */
}

.terminal-nav-button {
  background: linear-gradient(135deg, #001100 0%, #003300 100%);
  color: #00ff00;
  border: 1px solid #00ff00;
  padding: 14px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  font-weight: 500;
  text-transform: lowercase;
  position: relative;
  overflow: hidden;
  display: flex; /* Added for download/preview buttons in resume section */
  align-items: center; /* Added for download/preview buttons in resume section */
  justify-content: center; /* Added for download/preview buttons in resume section */
  gap: 8px; /* Added for icon spacing in download/preview buttons */
  min-width: 120px; /* Give buttons a consistent minimum width */
}

.terminal-nav-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.2), transparent);
  transition: left 0.5s ease;
}

.terminal-nav-button:hover::before {
  left: 100%;
}

.terminal-nav-button:hover {
  background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
  color: #000000;
  transform: translateY(-2px);
  box-shadow:
      0 5px 15px rgba(0, 255, 0, 0.3),
      0 0 20px rgba(0, 255, 0, 0.2);
  text-shadow: none;
}

.terminal-nav-button:active {
  transform: translateY(0);
}

.button-text {
  position: relative;
  z-index: 1;
}

/* Special Button Styles */
.clear-button {
  background: linear-gradient(135deg, #001100 0%, #003300 100%);
  color: #00ff00;
  border: 1px solid #00ff00;
}

.clear-button:hover {
  background: linear-gradient(135deg, #00ff00 0%, #00cc00 100%);
  color: #000000;
  box-shadow:
      0 5px 15px rgba(0, 255, 0, 0.3),
      0 0 20px rgba(0, 255, 0, 0.2);
}

/* Style for echoed text */
.echo-output {
  color: #ffffff;
  /* You can add more styles here if you want echoed text to look different */
}


/* Content Display */
.content-display {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 255, 0, 0.3);
  animation: fadeIn 0.5s ease-in-out;
}

.content-display.hidden {
  display: none;
}

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

.content-output {
  margin: 15px 0;
  color: #00ffff;
  line-height: 1.6;
}

.content-output h3 {
  color: #00ff00;
  margin-bottom: 10px;
  font-size: 16px;
}

.content-output p {
  margin-bottom: 8px;
}

.content-output ul {
  margin-left: 20px;
  margin-bottom: 10px;
}

.content-output li {
  margin-bottom: 5px;
}

.content-output a {
  color: #00ff00;
  text-decoration: none;
  transition: color 0.3s ease;
}

.content-output a:hover {
  color: #00ffff;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

/* Project Divider Styling */
.project-divider {
  color: #00ff00;
  font-family: 'Fira Code', monospace;
  margin: 15px 0;
  text-align: center;
  font-weight: 300;
  opacity: 0.8;
}

/* Resume Specific Styles (Renamed from CV) */
.resume-download-section {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #00ff00;
    border-radius: 5px;
    background-color: rgba(0, 255, 0, 0.1);
}

.resume-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Using existing terminal-nav-button style for resume download/preview buttons */
.resume-download-section .terminal-nav-button {
    padding: 10px 15px; /* Slightly smaller padding for these internal buttons */
    font-size: 13px; /* Slightly smaller font size */
    flex-grow: 1; /* Allow buttons to grow and fill space */
}

/* Resume Modal Styles (Renamed from CV Modal) */
.resume-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Dark overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure it's on top */
  backdrop-filter: blur(5px); /* Optional: blur background */
  -webkit-backdrop-filter: blur(5px); /* Safari support */
}

.resume-modal-content {
  background-color: #1a1a1a; /* Dark background for the modal */
  border: 1px solid #00ff00; /* Green border */
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.5); /* Glowing shadow */
  overflow: hidden; /* Ensures content stays within bounds */
  display: flex;
  flex-direction: column;

  /* Adjust these values for larger modal size */
  width: 90%; /* Increase to 90% of viewport width */
  max-width: 1000px; /* Max width to prevent it from getting too large on very wide screens */
  height: 90%; /* Increase to 90% of viewport height */
  max-height: 800px; /* Max height */

  padding: 0; /* Remove default padding if any */
}

.resume-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #0d0d0d;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(0, 255, 0, 0.2);
  color: #00ff00;
  font-size: 1.1em;
}

.resume-modal-header h3 {
  margin: 0;
  color: #00ff00;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.resume-modal-close {
  background: none;
  border: none;
  color: #ff4500; /* Red for close button */
  font-size: 1.8em;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
}

.resume-modal-close:hover {
  color: #ff0000;
  transform: rotate(90deg);
}

.resume-modal-body {
  flex-grow: 1; 
  padding: 0; 
  display: flex; 
}

.resume-modal-body iframe {
  width: 100%; /* Make iframe fill the body */
  height: 100%; /* Make iframe fill the body */
  border: none; /* No border for iframe */
}

.resume-instructions {
    line-height: 1.6;
}

.resume-instructions h4 {
    color: #00ff00;
    margin-bottom: 15px;
    font-size: 14px;
}

.resume-instructions ol, .resume-instructions ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.resume-instructions pre {
    background-color: rgba(0, 255, 0, 0.1);
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    overflow-x: auto;
    margin: 10px 0;
}

.resume-instructions code {
    background-color: rgba(0, 255, 0, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
}

.resume-temp-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

#userInput {
  flex-grow: 1;
  outline: none; /* REMOVE THE WHITE OUTLINE */
  border: none; /* Ensure no border */
  background: transparent; /* Ensure no background */
  color: #ffffff; /* Keep your text color */
  caret-color: #00ff00; /* Cursor color */
  min-width: 50px;
}

/* Loading Animation */
.loading {
    opacity: 0.6;
    animation: loading 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .terminal-container {
      flex-direction: column; /* Stack terminal and buttons vertically */
      align-items: center; /* Center them horizontally */
      padding: 10px;
      gap: 20px; /* Adjust gap for vertical stacking */
  }

  .terminal {
      width: 100%;
      max-width: none;
  }

  .terminal-content {
      padding: 20px 15px;
      font-size: 13px;
  }

  .button-sidebar {
      width: 100%; /* Take full width on smaller screens */
      padding: 0; /* Remove horizontal padding */
      align-items: center; /* Center the grid of buttons */
  }

  .button-grid {
      flex-direction: row; /* Allow buttons to wrap horizontally */
      flex-wrap: wrap;
      justify-content: center; /* Center buttons within the row */
      width: 100%; /* Take full width to allow wrapping */
  }

  .terminal-nav-button {
      padding: 12px 15px;
      font-size: 13px;
      flex-grow: 1; /* Allow buttons to grow and fill space */
      min-width: unset; /* Remove min-width so they can shrink */
  }

  .welcome-title {
      font-size: 16px;
  }

  .welcome-text {
      font-size: 13px;
  }

  .resume-buttons {
      flex-direction: column;
  }

  .resume-modal-content {
      max-width: 95%;
      max-height: 95%;
  }
}

@media (max-width: 480px) {
  .terminal-header {
      padding: 10px 15px;
  }

  .terminal-content {
      padding: 15px 10px;
      font-size: 12px;
  }

  .welcome-title {
      font-size: 14px;
  }

  .welcome-text {
      font-size: 12px;
  }

  .terminal-nav-button {
      padding: 10px 12px;
      font-size: 12px;
  }

  .resume-content { /* Check if this class is used anywhere in HTML/JS content */
      font-size: 11px;
      padding: 15px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #00ff00;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #00cc00;
}

.error-output {
  color: #ff4500; /* Orange-red color for errors */
  font-weight: bold;
}