/* filepath: c:\Work\Projects\TerminalPortfolio\style.css */
:root {
  --default-font-color: #ebebeb;
  --default-background-color: #1b1b1b;
  --default-accent-color: #02d0df; /* Default accent, can be one of your existing neons */
  --default-prompt-color: #577bf1;
  --default-input-color: rgb(201, 82, 35);
  --default-banner-color: rgb(201, 82, 35);
  --default-command-output-color: rgb(201, 82, 35);
  --default-link-color: #c5ee0f;
  --default-text-shadow: 0px 0px 10px rgba(11, 202, 231, 0.75); /* Default shadow for neon text */
}

body {
  font-size: 1.25em;
  font-family: monospace;
  white-space: normal;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--default-background-color); /* Use variable */
  color: var(--default-font-color); /* Use variable */
  margin: 0;
  padding: 0;
}

.terminal-container {
  display: flex;
  flex-direction: column;
}

.terminal {
  /* Define theme variables here, JavaScript will update these */
  --font-color: var(--default-font-color);
  --background-color: var(--default-background-color);
  --accent-color: var(--default-accent-color);
  --prompt-color: var(--default-prompt-color);
  --input-color: var(--default-input-color);
  --banner-color: var(--default-banner-color);
  --command-output-color: var(--default-command-output-color);
  --link-color: var(--default-link-color);
  --text-shadow: var(--default-text-shadow);

  color: var(--font-color);
  background-color: var(--background-color);
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 10px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.terminal-output {
  margin: 0;
  /* padding: 10000px; /* This seems excessively large, consider reducing or removing if .terminal padding is enough */
  flex-grow: 1;
  color: var(--font-color); /* Inherit from .terminal or override if needed */
}

/* Remove old ID-based theme styles like #terminal_output_1, #terminal_output_2, etc. */
/* These are now handled by JavaScript setting CSS variables on the .terminal element */

.command_line {
  margin: 3px 0;
  color: var(
    --prompt-color
  ) !important; /* Or use a new variable like --command-line-prompt-color */
  text-shadow: none;
}
.neon {
  color: var(--accent-color);
  text-shadow: var(--text-shadow);
}

.banner {
  font-size: smaller;
  max-width: 300px; /* This might be too restrictive for the preformatted text */
  color: var(--banner-color) !important;
  text-shadow: none !important;
}

.intro {
  /* font-size: 1.25em !important; */
  color: var(--accent-color); /* Use accent color for intro highlight */

  font-size: 1.25em !important;
  line-height: 1.4;
  margin-top: 10px;
}

#intro_mob {
  color: var(--accent-color); /* Use accent color for intro highlight */
  line-height: 1.4;
  margin-top: 10px;
}

.command {
  margin: 3px 0;
  padding-left: 25px;
  color: var(
    --command-output-color
  ) !important; /* Or a more specific variable */
  text-shadow: none !important;
}

/* #theme selector might be redundant if themes are applied to .terminal */
/* #theme {
  color: var(--accent-color);
  text-shadow: var(--text-shadow);
  margin: 10px;
} */

#theme_name {
  /* This ID was used for li items in themes_function, consider making it a class */
  color: var(
    --link-color
  ) !important; /* Or a specific variable for theme names */
  /* text-shadow: 0px 0px 10px rgba(11, 202, 231, 0.75); /* Consider using var(--text-shadow) or a specific one */
  margin: 10px;
}
#theme_name ul {
  /* This rule seems incorrect as #theme_name was on li */
  list-style-type: decimal;
}

.terminal-input {
  display: flex;
  margin: 0;
  margin-left: 3px;
  padding: 0px;
  position: relative;
}

.prompt {
  margin-right: 5px;
  white-space: nowrap;
  color: var(--prompt-color); /* Use variable */
}

#command-input {
  background-color: transparent;
  width: 100%;
  font-size: large;
  border: none;
  outline: none;
  color: var(--input-color) !important; /* Use variable */
  font-family: monospace;
  padding: 5px;
  box-sizing: border-box;
  width: calc(100% - 10px);
  margin-top: -2.5px;
}

.cursor {
  margin-left: 145px; /* This might need to be dynamic or removed if input takes full width */
  position: absolute;
  background-color: var(
    --input-color
  ) !important; /* Use variable for cursor color */
  width: 10px;
  height: 1em;
  top: 50%;
  transform: translateY(-50%);
  animation: blink 0.7s step-start infinite;
  pointer-events: none;
  margin-top: -2.5px;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

ul,
li {
  width: 100%; /* This is very broad, might affect other uls/lis on a page if this CSS is used elsewhere */
  /* Consider scoping it, e.g., .terminal ul, .terminal li */
}

/* Ensure links within the terminal also use theme colors if desired */
.terminal-output a {
  color: var(--accent-color); /* Or var(--link-color) */
  text-decoration: underline;
}

.terminal-output a:hover {
  color: var(--font-color); /* Example hover effect */
}

.cert_name:hover {
  color: var(--default-accent-color) !important;
}

.cert_name {
  cursor: pointer;
  max-width: 500px;
  transition: color 0.2s ease;
}

.banner pre {
  overflow-x: auto;
  white-space: pre;
}

/* Tablet and smaller devices */
@media (max-width: 768px) {
  body {
    font-size: 1.1em;
  }

  .terminal {
    padding: 8px;
  }

  .banner {
    font-size: 0.7em !important;
    overflow-x: auto;
  }

  .cert_name {
    padding: 8px 4px;
    margin: 4px 0;
  }
}

/* Mobile devices - Enhanced experience */
@media (max-width: 600px) {
  body {
    font-size: 0.95em;
    padding: 0;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
  }

  .terminal {
    padding: 8px;
    font-size: 1em;
    min-width: 0;
    width: 100vw;
    min-height: 100vh;
    box-sizing: border-box;
  }

  .terminal-output {
    padding-bottom: 20px;
    overflow-x: hidden;
  }

  .banner {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 0.45em !important;
    line-height: 1.2;
    -webkit-overflow-scrolling: touch;
  }

  .banner pre {
    margin: 0;
    padding: 0;
    white-space: pre;
    word-wrap: normal;
  }

  .command {
    padding-left: 5px;
    font-size: 0.9em;
    word-break: break-word;
    line-height: 1.5;
    margin: 2px 0;
  }

  .command_line {
    word-break: break-all;
    font-size: 0.9em;
    margin: 2px 0;
  }

  .terminal-input {
    position: sticky;
    bottom: 0;
    background-color: var(--background-color);
    padding: 8px 0;
    margin: 0;
    z-index: 100;
    flex-direction: row;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .prompt {
    margin-bottom: 0;
    margin-right: 5px;
    font-size: 0.9em;
    flex-shrink: 0;
  }

  #command-input {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 10px 8px;
    width: 100%;
    margin-top: 0;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    min-height: 44px; /* Better touch target */
  }

  .cursor {
    display: none; /* Hide cursor on mobile for better UX */
  }

  ul,
  li {
    width: 100%;
    font-size: 0.9em;
    word-break: break-word;
    margin: 4px 0;
  }

  .cert_name {
    max-width: 100%;
    font-size: 0.9em;
    padding: 12px 8px;
    margin: 6px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    min-height: 44px; /* Better touch target */
    display: flex;
    align-items: center;
  }

  .cert_name:active {
    background-color: rgba(255, 255, 255, 0.1);
  }

  .neon {
    text-shadow: none; /* Reduce effects on mobile for performance */
  }

  /* Mobile-optimized modal for certificates */
  #photo-onTop {
    padding: 10px !important;
  }

  #photo-onTop img {
    max-width: 95vw !important;
    max-height: 85vh !important;
    width: auto !important;
    height: auto !important;
  }

  /* Better link styling for mobile */
  a {
    min-height: 44px;
    display: inline-block;
    padding: 4px 0;
  }
}

/* Very small phones */
@media (max-width: 375px) {
  body {
    font-size: 0.85em;
  }

  .banner {
    font-size: 0.35em !important;
  }

  .terminal {
    padding: 5px;
  }

  .command,
  .cert_name {
    font-size: 0.85em;
  }

  #command-input {
    font-size: 16px;
    padding: 8px 6px;
  }
}

/* Landscape mode on mobile */
@media (max-width: 900px) and (orientation: landscape) {
  .banner {
    font-size: 0.5em !important;
  }

  .terminal {
    min-height: auto;
  }

  .terminal-input {
    position: relative;
  }
}
