/* Retro Gaming Portfolio - CSS */

@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

:root {
  --bg-primary: #000000;
  --bg-secondary: #0000aa;
  --bg-tertiary: #008888;
  --text-primary: #00ff00;
  --text-secondary: #ffffff;
  --text-accent: #ffff00;
  --border-color: #008888;
  --highlight: #ff00ff;
  --error: #ff0000;
  --warning: #ffaa00;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  hyphens: none;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
}

body {
  font-family: "Press Start 2P", monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  cursor:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><rect width="16" height="16" fill="%2300ff00" stroke="%2300aa00" stroke-width="1"/></svg>'),
    crosshair;
}

/* Custom neon green cursor */
* {
  cursor:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><rect width="16" height="16" fill="%2300ff00" stroke="%2300aa00" stroke-width="1"/></svg>'),
    crosshair !important;
}

/* CRT Screen Effect */
.crt-screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  border: none;
  box-shadow:
    0 0 50px rgba(0, 255, 0, 0.3),
    inset 0 0 50px rgba(0, 255, 0, 0.1);
  overflow: hidden;
}

.crt-screen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(transparent 50%, rgba(0, 255, 0, 0.03) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 1000;
}

.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 0, 0.03) 2px,
    rgba(0, 255, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 1001;
}

/* Screen Content */
.screen-content {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 100;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.screen.active {
  opacity: 1;
  transform: translateY(0);
}

/* Boot Screen */
#boot-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease;
}

#boot-screen:hover {
  opacity: 0.9;
}

.boot-text {
  animation: flicker 2s infinite alternate;
  animation-play-state: paused;
}

.boot-line {
  font-size: 14px;
  margin-bottom: 10px;
  opacity: 0;
  animation: typewriter 0.5s forwards;
}

.boot-line:nth-child(1) {
  animation-delay: 0.5s;
}
.boot-line:nth-child(2) {
  animation-delay: 1s;
}
.boot-line:nth-child(3) {
  animation-delay: 1.5s;
}
.boot-line:nth-child(4) {
  animation-delay: 2s;
}
.boot-line:nth-child(5) {
  animation-delay: 2.5s;
}

.boot-complete {
  color: var(--text-accent);
  animation: glow 1s ease-in-out infinite alternate;
  animation-play-state: paused;
}

.boot-prompt {
  color: var(--highlight);
  margin-top: 20px;
  animation: blink 1s infinite;
  animation-play-state: paused;
  opacity: 0;
  visibility: hidden;
}

/* Main Desktop */
#main-desktop {
  padding: 20px;
}

.desktop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  margin-bottom: 10px;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.window-title {
  font-size: 12px;
  color: var(--text-secondary);
}

.window-controls {
  display: flex;
  gap: 5px;
}

.control-btn {
  width: 20px;
  height: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s;
}

.control-btn:hover {
  background: var(--highlight);
  color: var(--bg-primary);
}

/* Menu Bar */
.menu-bar {
  display: flex;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  margin-bottom: 10px;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.menu-item {
  padding: 10px 20px;
  cursor: pointer;
  border-right: 1px solid var(--border-color);
  transition: all 0.3s;
  font-size: 10px;
}

.menu-item:hover,
.menu-item.active {
  background: var(--bg-tertiary);
  color: var(--text-accent);
  text-shadow: 0 0 10px var(--text-accent);
}

.menu-item:last-child {
  border-right: none;
}

/* Content Area */
.content-area {
  height: calc(100vh - 200px);
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.2);
}

/* Mobile skill bar improvements */
@media (max-width: 768px) {
  .skill-item {
    margin-bottom: 15px;
  }

  .skill-bar {
    height: 14px;
    border-width: 2px;
  }

  .skill-fill {
    height: 100%;
    min-height: 10px;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
  }

  .skill-name {
    font-size: 9px;
    margin-bottom: 5px;
  }

  .skill-percent {
    font-size: 9px;
    margin-top: 3px;
  }
}

/* Mobile landscape specific fixes */
@media (max-height: 500px) and (orientation: landscape) {
  .desktop-header {
    padding: 5px 10px;
    margin-bottom: 5px;
  }

  .window-title {
    font-size: 10px;
  }

  .control-btn {
    width: 16px;
    height: 12px;
    font-size: 8px;
  }

  .menu-bar {
    margin-bottom: 5px;
  }

  .menu-item {
    padding: 5px 8px;
    font-size: 8px;
  }

  .content-area {
    height: calc(100vh - 120px);
  }

  .terminal {
    margin: 5px;
  }

  .terminal-header {
    padding: 5px 10px;
    font-size: 8px;
  }

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

  .status-bar {
    height: 20px;
    font-size: 6px;
    padding: 0 8px;
  }

  .status-left,
  .status-right {
    gap: 8px;
  }
}

/* Extra small height screens in landscape */
@media (max-height: 400px) and (orientation: landscape) {
  .content-area {
    height: calc(100vh - 80px);
  }

  .desktop-header {
    padding: 2px 5px;
    margin-bottom: 2px;
  }

  .window-title {
    font-size: 8px;
  }

  .control-btn {
    width: 12px;
    height: 10px;
    font-size: 6px;
  }

  .menu-bar {
    margin-bottom: 2px;
  }

  .menu-item {
    padding: 2px 4px;
    font-size: 6px;
  }

  .terminal {
    margin: 2px;
  }

  .terminal-header {
    padding: 2px 5px;
    font-size: 6px;
  }

  .terminal-content {
    padding: 4px;
    font-size: 8px;
  }

  .status-bar {
    height: 16px;
    font-size: 5px;
    padding: 0 5px;
  }

  .status-left,
  .status-right {
    gap: 5px;
  }
}

.section {
  display: none;
  height: 100%;
}

.section.active {
  display: block;
}

/* Terminal Styling */
.terminal {
  height: 100%;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  margin: 10px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
  font-size: 10px;
  color: var(--text-secondary);
}

.terminal-controls {
  display: flex;
  gap: 3px;
}

.terminal-content {
  padding: 15px;
  height: calc(100% - 50px);
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.4;
}

/* Center content for About and Contact sections */
#about-section .terminal-content,
#contact-section .terminal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#about-section .terminal-content > *,
#contact-section .terminal-content > * {
  width: 100%;
  max-width: 800px;
  text-align: left;
}

.command-line {
  color: var(--text-accent);
  margin-bottom: 10px;
}

.file-content {
  margin-bottom: 20px;
}

/* ASCII Art */
.ascii-art {
  margin: 20px 0;
  color: var(--highlight);
  text-shadow: 0 0 10px var(--highlight);
  animation: glow 2s ease-in-out infinite alternate;
  text-align: center;
}

/* Ensure ASCII art is centered within the centered container */
#about-section .ascii-art {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ascii-art pre {
  font-family: "Courier New", monospace;
  font-size: 16px;
  line-height: 1.1;
  margin: 0;
  padding: 10px;
  white-space: pre;
  overflow: visible;
  letter-spacing: 0;
  word-spacing: 0;
  text-align: center;
  font-weight: bold;
}

/* Bio Text */
.bio-text {
  color: var(--text-primary);
  margin: 20px 0;
  max-width: 80ch;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 11px;
}

.bio-text p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.bio-text .tech-skill {
  color: var(--text-accent);
  margin: 2px 0;
  display: block;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.skill-category {
  border: 2px solid var(--border-color);
  padding: 15px;
  background: rgba(0, 136, 136, 0.1);
}

.category-title {
  color: var(--text-accent);
  font-size: 10px;
  margin-bottom: 15px;
  text-align: center;
  text-shadow: 0 0 10px var(--text-accent);
}

.skill-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.skill-name {
  min-width: 120px;
  font-size: 10px;
  color: var(--text-primary);
}

.skill-bar {
  flex: 1;
  height: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--text-primary), var(--text-accent));
  width: 0%;
  transition: width 2s ease;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.skill-percent {
  min-width: 30px;
  font-size: 10px;
  color: var(--text-accent);
  text-align: right;
}

/* Projects */
.projects-list {
  margin: 20px 0;
}

.project-image-link {
  float: right;
  margin: 10px 0 10px 15px;
  display: block;
  text-decoration: none;
}

.project-image {
  max-width: 200px;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
}

.project-image-link:hover .project-image {
  border-color: var(--text-accent);
  box-shadow: 
    0 0 20px rgba(255, 255, 0, 0.6),
    0 0 40px rgba(255, 255, 0, 0.4),
    0 0 60px rgba(255, 255, 0, 0.2);
  transform: scale(1.05);
}

/* Center align image on mobile devices */
@media (max-width: 768px) {
  .project-image-link {
    float: none;
    text-align: center;
    margin: 10px 0;
    display: block;
    width: 100%;
  }
  
  .project-image {
    margin: 0 auto;
    display: block;
  }
}

.project-item {
  border: 2px solid var(--border-color);
  padding: 15px;
  margin-bottom: 15px;
  background: rgba(0, 136, 136, 0.1);
  transition: all 0.3s;
  overflow: hidden; /* Clearfix for floated elements */
}

.project-item:hover {
  border-color: var(--text-accent);
  box-shadow: 0 0 15px rgba(255, 255, 0, 0.3);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.project-title {
  color: var(--highlight);
  font-size: 10px;
  text-shadow: 0 0 10px var(--highlight);
}

.project-year {
  color: var(--text-accent);
  font-size: 8px;
}

.project-tech {
  color: var(--text-accent);
  font-size: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 0, 0.1);
  padding: 4px 8px;
  border: 1px solid var(--text-accent);
  border-radius: 2px;
  display: inline-block;
}

.project-desc {
  color: var(--text-primary);
  font-size: 10px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.project-links {
  display: flex;
  gap: 10px;
}

.project-link {
  color: var(--text-accent);
  text-decoration: none;
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.project-link:hover {
  background: var(--text-accent);
  color: var(--bg-primary);
  text-shadow: none;
}

/* Glow effect class - can be applied to any element */
.glow {
  background: rgba(255, 255, 0, 0.1);
  border: 2px solid var(--text-accent);
  color: var(--text-accent);
  font-weight: bold;
  text-shadow: 0 0 5px var(--text-accent);
  box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
  position: relative;
  animation: pulse-glow 2s ease-in-out infinite alternate;
}

.glow:hover {
  background: var(--text-accent);
  color: var(--bg-primary);
  text-shadow: none;
  box-shadow: 
    0 0 15px rgba(255, 255, 0, 0.6),
    0 0 25px rgba(255, 255, 0, 0.4);
  transform: scale(1.05);
}

@keyframes pulse-glow {
  from {
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
    text-shadow: 0 0 5px var(--text-accent);
  }
  to {
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.5);
    text-shadow: 0 0 10px var(--text-accent);
  }
}

/* Contact */
.contact-info {
  margin: 20px auto;
  max-width: 600px;
  width: 100%;
}

.contact-method {
  display: flex;
  margin-bottom: 15px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.contact-label {
  min-width: 120px;
  color: var(--text-accent);
  font-size: 11px;
  flex-shrink: 0;
}

.contact-value {
  color: var(--text-primary);
  font-size: 11px;
  text-decoration: none;
  transition: color 0.3s;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  word-break: break-all;
  flex: 1;
  text-align: right;
}

.contact-value:hover {
  color: var(--highlight);
  text-shadow: 0 0 10px var(--highlight);
}

/* PDF Links Container */
.pdf-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Download Link */
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  text-decoration: none;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
  border-radius: 3px;
  font-size: 12px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.download-link:hover {
  color: var(--highlight);
  border-color: var(--highlight);
  text-shadow: 0 0 10px var(--highlight);
  box-shadow: 0 0 10px var(--highlight);
  background-color: rgba(0, 255, 0, 0.1);
}

.download-icon {
  display: block;
  line-height: 1;
}

.contact-note {
  margin: 30px auto 0;
  color: var(--text-primary);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  max-width: 500px;
}

/* Status Bar */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: var(--bg-secondary);
  border-top: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  font-size: 8px;
  color: var(--text-primary);
  z-index: 1002;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.status-left,
.status-right {
  display: flex;
  gap: 20px;
}

.status-item {
  color: var(--text-primary);
}

/* Animations */
@keyframes typewriter {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px currentColor;
  }
  to {
    text-shadow:
      0 0 20px currentColor,
      0 0 30px currentColor;
  }
}

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

@keyframes scanline {
  0% {
    transform: translateY(-100vh);
  }
  100% {
    transform: translateY(100vh);
  }
}

/* Responsive Design */
@media (max-width: 768px) and (orientation: portrait) {
  .desktop-header,
  .menu-bar {
    padding: 5px 10px;
  }

  .menu-item {
    padding: 8px 12px;
    font-size: 8px;
  }

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

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

  .ascii-art pre {
    font-size: 2vw;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .status-bar {
    font-size: 7px;
    padding: 0 10px;
  }

  .status-left,
  .status-right {
    gap: 10px;
  }
}

/* Mobile landscape - additional optimizations */
@media (max-width: 768px) and (orientation: landscape) {
  .content-area {
    height: calc(100vh - 140px);
  }

  .desktop-header {
    padding: 3px 8px;
    margin-bottom: 3px;
  }

  .menu-bar {
    margin-bottom: 3px;
  }

  .menu-item {
    padding: 4px 6px;
    font-size: 7px;
  }

  .terminal-content {
    padding: 6px;
    font-size: 9px;
  }

  .ascii-art pre {
    font-size: 1.5vw;
  }

  .bio-text {
    font-size: 9px;
  }

  .bio-text p {
    margin-bottom: 8px;
    line-height: 1.4;
  }

  /* Adjust max-width for mobile landscape */
  #about-section .terminal-content > *,
  #contact-section .terminal-content > * {
    max-width: 600px;
  }

  .skill-bar {
    height: 8px;
  }

  .skill-fill {
    height: 100%;
    min-height: 6px;
  }

  /* Fix contact overlap on narrow landscape screens */
  .contact-info {
    max-width: 500px;
  }

  .contact-method {
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-start;
  }

  .contact-label {
    min-width: 80px;
    font-size: 9px;
  }

  .contact-value {
    font-size: 9px;
    flex: 1;
    min-width: 0;
    text-align: left;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  /* PDF links mobile adjustments */
  .pdf-links {
    gap: 8px;
  }

  .download-link {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .contact-note {
    max-width: 400px;
    text-align: center;
  }
}

@media (max-width: 480px) and (orientation: portrait) {
  .boot-line {
    font-size: 10px;
  }

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

  .ascii-art pre {
    font-size: 2vw;
  }

  .skill-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .skill-bar {
    width: 100%;
    height: 10px;
    margin: 5px 0;
  }

  .skill-fill {
    height: 100%;
    min-height: 8px;
  }

  .bio-text {
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .bio-text p {
    line-height: 1.8;
    margin-bottom: 15px;
  }
}

/* Very small screens in landscape */
@media (max-width: 480px) and (orientation: landscape) {
  .content-area {
    height: calc(100vh - 100px);
  }

  .desktop-header {
    padding: 2px 5px;
    margin-bottom: 2px;
  }

  .window-title {
    font-size: 8px;
  }

  .control-btn {
    width: 14px;
    height: 10px;
    font-size: 7px;
  }

  .menu-bar {
    margin-bottom: 2px;
  }

  .menu-item {
    padding: 3px 5px;
    font-size: 6px;
  }

  .terminal {
    margin: 3px;
  }

  .terminal-header {
    padding: 3px 8px;
    font-size: 7px;
  }

  .terminal-content {
    padding: 5px;
    font-size: 8px;
  }

  .ascii-art pre {
    font-size: 1.2vw;
  }

  .bio-text {
    font-size: 8px;
  }

  .bio-text p {
    margin-bottom: 6px;
    line-height: 1.3;
  }

  /* Further adjust max-width for very small screens */
  #about-section .terminal-content > *,
  #contact-section .terminal-content > * {
    max-width: 100%;
  }

  .status-bar {
    height: 18px;
    font-size: 5px;
    padding: 0 5px;
  }

  .status-left,
  .status-right {
    gap: 5px;
  }

  .skill-bar {
    height: 6px;
  }

  .skill-fill {
    height: 100%;
    min-height: 4px;
  }

  /* Fix contact overlap on very narrow screens */
  .contact-info {
    max-width: 100%;
  }

  .contact-method {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .contact-label {
    min-width: auto;
    font-size: 8px;
  }

  .contact-value {
    font-size: 8px;
    word-break: break-all;
    text-align: left;
    max-width: 100%;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  .contact-note {
    text-align: left;
  }
}

/* Very narrow screens - general fix for contact overlap */
@media (max-width: 400px) {
  .contact-method {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .contact-label {
    min-width: auto;
    font-size: 9px;
  }

  .contact-value {
    font-size: 9px;
    word-break: break-all;
    text-align: left;
    max-width: 100%;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  /* PDF links very narrow screen adjustments */
  .pdf-links {
    gap: 6px;
  }

  .download-link {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .contact-note {
    text-align: left;
  }
}

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

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-accent);
}

/* Selection */
::selection {
  background: var(--highlight);
  color: var(--bg-primary);
}

/* Additional Animations */
.cursor-blink {
  animation: blink 1s infinite;
  color: var(--text-accent);
}

.typing {
  animation: typewriter 0.1s infinite;
}

.message-overlay {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
