body {
  background-color: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Courier New', Courier, monospace;
  margin: 0;
  padding: 10px;
}

pre {
  color: #007bff;
  margin: 0;
  font-size: clamp(4px, 2.2vw, 16px);
  line-height: 1.2;
}

.prompt {
  color: #4af626;
  font-weight: bold;
}

.cursor {
  color: #ffffff;
  animation: blink 1s step-end infinite;
}

#terminal-history div {
  margin-bottom: 5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-prompt {
  white-space: pre-wrap;
  word-break: break-word;
}

.history-command {
  font-weight: bold;
}

.history-output {
  color: #d4d4d4;
  margin-bottom: 15px;
}

.error-red {
  color: #ff5555;
  font-weight: bold;
}

#terminal-input {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.typing-container {
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: typing 0.5s steps(70, end) forwards;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

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

.gui-window {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70vw;
  max-width: 800px;
  height: 60vh;
  background-color: #242424;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  flex-direction: column;
  z-index: 1000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #e0e0e0;
  border: 1px solid #333;
}

.gui-titlebar {
  height: 35px;
  background-color: #1a1a1a;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  user-select: none;
  border-bottom: 1px solid #000;
}

.gui-title {
  font-size: 14px;
  color: #a0a0a0;
}

.gui-controls {
  display: flex;
  gap: 8px;
}

.gui-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0,0,0,0.6);
  font-weight: bold;
  user-select: none;
}

.gui-btn::before { content: ""; display: none; margin-top: -1px; }
.gui-controls:hover .gui-close::before { content: "×"; display: block; font-size: 13px; }
.gui-controls:hover .gui-min::before { content: "−"; display: block; font-size: 11px; }
.gui-controls:hover .gui-max::before { content: "+"; display: block; font-size: 11px; }

.gui-close { background-color: #ff5f56; }
.gui-close:hover { background-color: #ff3b30; }
.gui-min { background-color: #ffbd2e; }
.gui-max { background-color: #27c93f; }

.gui-window.maximized {
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  transform: none;
  max-width: none;
  border-radius: 0;
}

.gui-window.minimized {
  height: 35px;
  overflow: hidden;
  top: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.gui-window.minimized .gui-body {
  display: none;
}

.gui-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.gui-sidebar {
  width: 180px;
  background-color: #1e1e1e;
  border-right: 1px solid #333;
  padding: 15px 0;
}

.gui-sidebar-item {
  padding: 10px 15px;
  font-size: 14px;
  cursor: pointer;
  background-color: #3a3a3a;
  border-left: 3px solid #007bff;
  transition: background 0.2s;
}

.gui-sidebar-item:hover {
  background-color: #4a4a4a;
}

.gui-content {
  flex: 1;
  padding: 30px;
  background-color: #242424;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.gui-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.gui-content h1 {
  margin-top: 0;
  font-size: 24px;
  font-weight: normal;
  margin-bottom: 10px;
}

.gui-content p {
  font-size: 16px;
  color: #a0a0a0;
  line-height: 1.5;
}

.portfolio-content {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  overflow-y: auto;
}

.portfolio-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.portfolio-markdown {
  width: 100%;
}

.portfolio-markdown h1,
.portfolio-markdown h2,
.portfolio-markdown h3 {
  color: #e0e0e0;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: bold;
}

.portfolio-markdown p {
  color: #c0c0c0;
  line-height: 1.6;
  font-size: 16px;
  margin-bottom: 15px;
}

.portfolio-markdown a {
  color: #007bff;
  text-decoration: none;
}

.portfolio-markdown a:hover {
  text-decoration: underline;
}

.portfolio-markdown ul,
.portfolio-markdown ol {
  color: #c0c0c0;
  line-height: 1.6;
  padding-left: 20px;
  margin-bottom: 15px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  width: 100%;
}

.portfolio-card {
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.portfolio-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  border-color: #666;
}

.portfolio-card img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.portfolio-card-title {
  padding: 10px;
  text-align: center;
  font-size: 14px;
  color: #e0e0e0;
}

.portfolio-controls {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #444;
  width: 100%;
}

.portfolio-btn {
  display: inline-block;
  background-color: #444;
  color: #e0e0e0;
  border: 1px solid #666;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.portfolio-btn:hover {
  background-color: #555;
}

.image-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  width: 100%;
}

.image-gallery-grid img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  border: 1px solid #444;
}

.fullscreen-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.fullscreen-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.custom-context-menu {
  display: none;
  position: absolute;
  background-color: #242424;
  border: 1px solid #444;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 3000;
  padding: 5px 0;
  min-width: 150px;
}

.context-menu-item {
  padding: 10px 20px;
  color: #e0e0e0;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.context-menu-item:hover {
  background-color: #444;
}

/* Responsive text wrapping for small screens */
@media screen and (max-width: 768px) {
  .typing-container {
    white-space: pre-wrap !important;
    width: 100% !important;
    animation: mobileFadeIn 0.8s forwards !important;
  }
}

@keyframes mobileFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
