/* ========================
   CGA Terminal Theme
   ======================== */

/* Base CGA terminal colors */
:root[data-design="terminal"] {
  --font-display: 'Courier New', 'Consolas', 'Liberation Mono', monospace;
  --font-sans: 'Courier New', 'Consolas', 'Liberation Mono', monospace;

  /* CGA amber/green light mode */
  --color-bg: #000000;
  --color-bg-accent: #000000;
  --color-card: #000000;
  --color-border: #00aa00;
  --color-border-strong: #00ff00;
  --color-text: #00aa00;
  --color-text-muted: #008800;
  --color-accent: #00ff00;
  --shadow: none;
  --focus-ring: none;
  
  /* Terminal styling */
  --terminal-glow: 0 0 10px rgba(0, 255, 0, 0.5), 0 0 20px rgba(0, 255, 0, 0.3);
  --terminal-text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
  --polaroid-bg: #000000;
  --polaroid-img-filter: brightness(0.8) contrast(1.2) saturate(0.8);
}

/* Terminal dark mode (yellow CGA) */
:root[data-design="terminal"][data-theme="dark"] {
  --color-bg: #000000;
  --color-bg-accent: #000000;
  --color-card: #000000;
  --color-border: #ffaa00;
  --color-border-strong: #ffff00;
  --color-text: #ffaa00;
  --color-text-muted: #ff8800;
  --color-accent: #ffff00;
  
  /* Yellow CGA glow */
  --terminal-glow: 0 0 10px rgba(255, 255, 0, 0.5), 0 0 20px rgba(255, 170, 0, 0.3);
  --terminal-text-shadow: 0 0 5px rgba(255, 255, 0, 0.8);
}

/* Terminal light mode */
:root[data-design="terminal"][data-theme="light"] {
  --color-bg: #000000;
  --color-bg-accent: #000000;
  --color-card: #000000;
  --color-border: #00ff00;
  --color-border-strong: #00ff00;
  --color-text: #00ff00;
  --color-text-muted: #00aa00;
  --color-accent: #00ffff;
}

/* Terminal Card */
:root[data-design="terminal"] .card {
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: var(--terminal-glow);
  font-family: 'Courier New', 'Consolas', 'Liberation Mono', monospace;
  padding: clamp(1.5rem, 4vh, 2.5rem) clamp(1.25rem, 4vw, 2.5rem);
}

:root[data-design="terminal"] .card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: 
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.15),
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 2px
    );
  z-index: 1;
}

:root[data-design="terminal"] .card__header {
  gap: 0.3rem;
  position: relative;
  z-index: 2;
}

:root[data-design="terminal"] .name {
  font-family: 'Courier New', 'Consolas', 'Liberation Mono', monospace;
  font-size: clamp(1.25rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-shadow: var(--terminal-text-shadow);
  color: var(--color-accent);
}

:root[data-design="terminal"] .tagline {
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-shadow: var(--terminal-text-shadow);
  line-height: 1.4;
}

:root[data-design="terminal"] .divider {
  height: 1px;
  background: var(--color-border);
  box-shadow: var(--terminal-glow);
  margin: 0.3rem 0;
}

/* Terminal Polaroid */
:root[data-design="terminal"] .polaroid {
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: var(--terminal-glow);
  padding: 0;
}

:root[data-design="terminal"] .polaroid img {
  border: none;
  border-radius: 0;
  filter: var(--polaroid-img-filter);
  display: block;
}

/* Terminal Buttons */
:root[data-design="terminal"] .btn {
  --btn-border: var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  border: 1px solid var(--btn-border);
  border-radius: 0;
  font-family: 'Courier New', 'Consolas', 'Liberation Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.6rem;
  min-width: auto;
  text-shadow: var(--terminal-text-shadow);
  box-shadow: var(--terminal-glow);
}

:root[data-design="terminal"] .btn::before {
  display: none;
}

:root[data-design="terminal"] .btn:hover {
  border-color: var(--color-accent);
  background: rgba(255, 255, 0, 0.1);
  color: var(--color-accent);
  box-shadow: var(--terminal-glow), inset 0 0 10px rgba(255, 255, 0, 0.3);
}

:root[data-design="terminal"] .btn:focus-visible {
  outline: 1px dashed var(--color-border);
  outline-offset: 1px;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

:root[data-design="terminal"] .btn:active {
  background: rgba(255, 255, 0, 0.2);
  transform: none;
}

/* Terminal brand buttons */
:root[data-design="terminal"] .btn--linkedin,
:root[data-design="terminal"] .btn--github,
:root[data-design="terminal"] .btn--unsplash {
  --btn-border: var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
}

:root[data-design="terminal"] .btn--linkedin:hover,
:root[data-design="terminal"] .btn--github:hover,
:root[data-design="terminal"] .btn--unsplash:hover {
  background: rgba(255, 255, 0, 0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: var(--terminal-glow), inset 0 0 10px rgba(255, 255, 0, 0.3);
}

/* Terminal Theme Toggle */
:root[data-design="terminal"] .theme-toggle__switch {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: var(--terminal-glow);
  backdrop-filter: none;
}

:root[data-design="terminal"] .theme-toggle__switch:hover {
  border-color: var(--color-accent);
  box-shadow: var(--terminal-glow), inset 0 0 10px rgba(255, 255, 0, 0.3);
}

:root[data-design="terminal"] .theme-toggle__icon {
  color: var(--color-text);
  text-shadow: var(--terminal-text-shadow);
}

:root[data-design="terminal"] .theme-toggle__slider {
  background: var(--color-border);
  border-radius: 0;
  box-shadow: var(--terminal-glow);
}

/* Terminal Dropdown */
:root[data-design="terminal"] .theme-dropdown {
  background: var(--color-card);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: var(--terminal-glow);
  backdrop-filter: none;
  font-family: 'Courier New', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffff00' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  background-size: 1rem;
  padding-right: 1.5rem;
}

:root[data-design="terminal"] .theme-dropdown:hover {
  border-color: var(--color-accent);
  box-shadow: var(--terminal-glow), inset 0 0 10px rgba(255, 255, 0, 0.3);
}

:root[data-design="terminal"] .theme-dropdown:focus {
  outline: 1px dashed var(--color-border);
  outline-offset: 1px;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

:root[data-design="terminal"] .theme-dropdown option {
  background: var(--color-card);
  color: var(--color-text);
  font-family: 'Courier New', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.85rem;
}

/* Terminal focus ring */
:root[data-design="terminal"] :focus-visible {
  outline: 1px dashed var(--color-border);
  outline-offset: 1px;
}

/* Terminal responsive adjustments */
@media (max-width: 560px) {
  :root[data-design="terminal"] .theme-toggle__switch {
    width: 3rem;
    height: 1.75rem;
  }

  :root[data-design="terminal"] .theme-toggle__slider {
    width: 1.25rem;
    height: 1.25rem;
  }

  :root[data-design="terminal"] .btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
  }

  :root[data-design="terminal"] .theme-dropdown {
    font-size: 0.75rem;
    padding: 0.3rem 0.4rem;
    padding-right: 1.3rem;
  }
}

/* CRT scanline effect */
@media (prefers-reduced-motion: reduce) {
  :root[data-design="terminal"] .card::before {
    display: none;
  }
}
