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

/* Root Variables - Aquamarine Theme (Default) */
:root,
body[data-theme="aqua"] {
  --primary-color: #40E0D0;
  --secondary-color: #20B2AA;
  --accent-color: #2F9E94;
  --terminal-bg: rgba(255, 255, 255, 0.95);
  --terminal-border: #40E0D0;
  --text-primary: #1a6b63;
  --text-secondary: #20B2AA;
  --text-muted: #40E0D0;
  --bg-color: #f8fffe;
  --button-color: #40E0D0;
  --glow-color: rgba(64, 224, 208, 0.3);
}

/* Matrix Theme - Black/Green */
body[data-theme="matrix"] {
  --primary-color: #00ff41;
  --secondary-color: #00cc33;
  --accent-color: #00ff99;
  --terminal-bg: rgba(0, 0, 0, 0.95);
  --terminal-border: #00ff41;
  --text-primary: #00ff41;
  --text-secondary: #00cc33;
  --text-muted: #00ff41;
  --bg-color: #000000;
  --button-color: #00ff41;
  --glow-color: rgba(0, 255, 65, 0.3);
}

/* Synthwave Theme - Retrowave/80s Neon */
body[data-theme="synth"] {
  --primary-color: #FF006E;
  --secondary-color: #00F5FF;
  --accent-color: #7209B7;
  --terminal-bg: rgba(10, 0, 20, 0.95);
  --terminal-border: #FF006E;
  --text-primary: #00F5FF;
  --text-secondary: #FF006E;
  --text-muted: #FF00FF;
  --bg-color: #0A0014;
  --button-color: #FF006E;
  --glow-color: rgba(255, 0, 110, 0.3);
}

/* Base Styles */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Fira Code', 'Monaco', 'Courier New', monospace;
  background: var(--bg-color);
  color: var(--text-primary);
  transition: background 0.5s ease, color 0.5s ease;
}

/* Glyph Canvas Background */
#matrix {
  position: fixed;
  top: 0;
  left: 0;
    width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.35;
}

/* Theme Switcher */
.theme-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.theme-btn {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.theme-btn[data-theme="aqua"] {
  color: #40E0D0;
}

.theme-btn[data-theme="matrix"] {
  color: #00ff41;
}

.theme-btn[data-theme="synth"] {
  color: #FF006E;
}

.theme-btn.active {
  border-color: currentColor;
  box-shadow: 0 0 15px currentColor;
}

/* Terminal Container */
#terminal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 900px;
  max-height: 95vh;
  background: var(--terminal-bg);
  border: 2px solid var(--terminal-border);
  border-radius: 8px;
  box-shadow: 0 0 30px var(--glow-color), 0 0 60px var(--glow-color);
  z-index: 10;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* Terminal Header */
.terminal-header {
  background: var(--glow-color);
  border-bottom: 1px solid var(--terminal-border);
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-button {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
  opacity: 0.7;
}

.terminal-button:hover {
  opacity: 1;
  transform: scale(1.1);
}

.terminal-button.close::before {
  content: '×';
  font-size: 16px;
}

.terminal-button.minimize::before {
  content: '−';
  font-size: 14px;
}

.terminal-button.maximize::before {
  content: '□';
  font-size: 11px;
}

.terminal-title {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Terminal Body */
.terminal-body {
  padding: 30px;
  overflow-y: auto;
  max-height: calc(95vh - 45px);
  text-align: center;
}

.terminal-body::-webkit-scrollbar {
  width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
  background: var(--glow-color);
}

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--terminal-border);
  border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Avatar */
.avatar-container {
  margin: 0 auto 25px;
  display: inline-block;
  position: relative;
}

.terminal-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--terminal-border);
  box-shadow: 0 0 20px var(--glow-color);
  transition: all 0.3s ease;
  object-fit: cover;
}

.terminal-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--primary-color);
}

/* Info Section */
.info-section {
  margin-bottom: 30px;
}

h1 {
  font-size: 2.5em;
  color: var(--text-primary);
  margin-bottom: 15px;
  letter-spacing: 3px;
  text-shadow: 0 0 10px var(--glow-color);
  font-weight: 500;
}

/* Glitch Effect */
.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
    width: 100%;
  height: 100%;
  opacity: 0.8;
}

.glitch::before {
  animation: glitch-1 2.5s infinite;
  color: #8B7FBF;
  z-index: -1;
}

.glitch::after {
  animation: glitch-2 2.5s infinite;
  color: var(--primary-aqua);
  z-index: -2;
}

@keyframes glitch-1 {
  0%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
}

@keyframes glitch-2 {
  0%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(2px, 0);
  }
  40% {
    transform: translate(-2px, 0);
  }
  60% {
    transform: translate(0, -2px);
  }
  80% {
    transform: translate(0, 2px);
  }
}

.subtitle {
  font-size: 1.1em;
  color: var(--secondary-color);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.prompt {
  color: var(--primary-color);
  font-weight: bold;
}

.cursor {
  animation: blink 1s infinite;
}

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

.description {
  font-size: 0.95em;
  color: rgba(26, 107, 99, 0.8);
  line-height: 1.6;
}

.description a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(26, 107, 99, 0.6);
  transition: border-bottom-color 0.2s ease;
}

.description a:hover {
  border-bottom-color: var(--primary-color);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin: 25px 0;
}

.project-card {
  background: var(--glow-color);
  border: 1px solid var(--terminal-border);
  border-radius: 4px;
  padding: 20px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
  transition: left 0.5s ease;
}

.project-card:hover::before {
  left: 100%;
}

.project-card:hover {
  background: var(--glow-color);
  box-shadow: 0 0 20px var(--glow-color);
  transform: translateY(-5px);
  border-color: var(--secondary-color);
}

.project-label {
  font-size: 1.1em;
  color: var(--secondary-color);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 1px;
}

.project-desc {
  font-size: 0.85em;
  color: rgba(26, 107, 99, 0.9);
  line-height: 1.5;
}

/* Links Section */
.links-section {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.terminal-link {
  color: var(--text-primary);
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid var(--terminal-border);
  border-radius: 4px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glow-color);
  font-size: 0.95em;
}

.terminal-link:hover {
  background: var(--glow-color);
  box-shadow: 0 0 15px var(--glow-color);
  transform: translateY(-2px);
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}

.terminal-link i {
  font-size: 1.2em;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .theme-switcher {
    top: 10px;
    right: 10px;
    padding: 6px;
    gap: 8px;
  }

  .theme-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  #terminal {
    width: 95%;
    max-height: 98vh;
  }

  .terminal-body {
    padding: 20px;
  }

  h1 {
    font-size: 1.8em;
    letter-spacing: 2px;
  }

  .terminal-avatar {
    width: 100px;
    height: 100px;
  }

  .subtitle {
  font-size: 1em;
  }

  .description {
    font-size: 0.85em;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .links-section {
    flex-direction: column;
    gap: 12px;
  }

  .terminal-link {
  width: 100%;
    justify-content: center;
  }
}

@media screen and (max-width: 480px) {
  .terminal-header {
    padding: 8px 12px;
  }

  .terminal-button {
    width: 10px;
    height: 10px;
  }

  .terminal-title {
    font-size: 11px;
  }

  h1 {
    font-size: 1.5em;
    letter-spacing: 1px;
  }

  .terminal-avatar {
    width: 80px;
    height: 80px;
  }

  .project-card {
    padding: 15px;
  }

  .project-label {
    font-size: 1em;
  }

  .project-desc {
  font-size: 0.8em;
}
}

/* Animation entrance */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
  opacity: 1;
    transform: translateY(0);
  }
}

.terminal-body > * {
  animation: fadeIn 0.6s ease-out backwards;
}

.avatar-container {
  animation-delay: 0.1s;
}

.info-section {
  animation-delay: 0.2s;
}

.projects-grid {
  animation-delay: 0.3s;
}

.links-section {
  animation-delay: 0.4s;
}

/* Selection styling */
::selection {
  background: rgba(64, 224, 208, 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(64, 224, 208, 0.3);
  color: var(--text-primary);
}
