/* ==========================================================================
   SAJUN P S - MAC TERMINAL PORTFOLIO DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Font Families */
  --font-mono: 'Fira Code', monospace;
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Color System - Default Mac Dark Theme */
  --bg-page: #08090b;
  --bg-window: #000000;
  --bg-header: #121418;
  --bg-terminal: #000000;
  --bg-badge-card: #f8fafc;
  --text-badge-card: #0f172a;
  
  --border-window: rgba(0, 255, 102, 0.2);
  --border-panel: rgba(255, 255, 255, 0.06);

  /* Terminal Colors matching reference screenshot */
  --term-prompt-user: #00d2ff; /* Bright Cyan Blue */
  --term-prompt-path: #00d2ff;
  --term-prompt-symbol: #00ff66; /* Bright Neon Green */
  --term-text: #ffffff;
  --term-text-muted: #94a3b8;
  --term-accent: #00ff66;
  --term-highlight: #00ff66;
  --term-success: #00ff66;
  --term-error: #ff4d4d;
  --term-link: #00ff66;

  /* Animation Settings */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Theme Overrides --- */
body.theme-matrix {
  --bg-page: #030804;
  --bg-window: #061208;
  --bg-header: #0b2210;
  --bg-terminal: #020a03;
  --term-prompt-user: #00ff41;
  --term-prompt-path: #2f944d;
  --term-prompt-symbol: #5eff8e;
  --term-text: #00ff41;
  --term-text-muted: #2f944d;
  --term-accent: #00ff41;
  --term-link: #5eff8e;
  --border-window: rgba(0, 255, 65, 0.25);
}

body.theme-cyberpunk {
  --bg-page: #0f051d;
  --bg-window: #180930;
  --bg-header: #270f4d;
  --bg-terminal: #110524;
  --term-prompt-user: #ff007f;
  --term-prompt-path: #00f0ff;
  --term-prompt-symbol: #ffe600;
  --term-text: #00f0ff;
  --term-text-muted: #b56cff;
  --term-accent: #ff007f;
  --term-link: #ffe600;
  --border-window: rgba(255, 0, 127, 0.3);
}

body.theme-solarized {
  --bg-page: #002b36;
  --bg-window: #073642;
  --bg-header: #002b36;
  --bg-terminal: #002b36;
  --term-prompt-user: #268bd2;
  --term-prompt-path: #839496;
  --term-prompt-symbol: #859900;
  --term-text: #93a1a1;
  --term-text-muted: #657b83;
  --term-accent: #b58900;
  --term-link: #268bd2;
  --border-window: rgba(147, 161, 161, 0.15);
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--term-text);
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

/* Ambient Background Glow Effect */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 30%, rgba(56, 189, 248, 0.06) 0%, rgba(0, 0, 0, 0) 70%),
              radial-gradient(circle at 80% 80%, rgba(74, 222, 128, 0.04) 0%, rgba(0, 0, 0, 0) 60%);
  pointer-events: none;
  z-index: 1;
}

/* Matrix Rain Canvas */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 2;
}

#matrix-canvas.active {
  opacity: 0.35;
}

/* --- MAC TERMINAL WINDOW CONTAINER --- */
.mac-window {
  width: 94vw;
  height: 90vh;
  max-width: 1350px;
  max-height: 820px;
  background-color: #19191b;
  border: 2px solid #0091ff;
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  overflow: hidden;
  transition: all var(--transition-smooth);
}

/* --- MAC WINDOW TITLEBAR HEADER --- */
.mac-header {
  height: 48px;
  background-color: #19191b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mac Traffic Control Buttons */
.mac-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.mac-dot.close { background-color: #ff5f56; border: 0.5px solid #e0443e; }
.mac-dot.minimize { background-color: #ffbd2e; border: 0.5px solid #dea123; }
.mac-dot.maximize { background-color: #27c93f; border: 0.5px solid #1aab29; }

.mac-dots:hover .mac-dot {
  opacity: 0.85;
}

.window-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.3px;
}

/* Header Navigation Shortcuts */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.15);
}

.nav-btn:active {
  transform: translateY(1px);
}

.sep {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  user-select: none;
}

/* --- WORKSPACE BODY SPLIT LAYOUT --- */
.window-body {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
  height: calc(100% - 48px);
}

/* --- LEFT PANEL: ID BADGE CONTAINER --- */
.badge-panel {
  width: 340px;
  background-color: #19191b;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  flex-shrink: 0;
}

/* 3D Wrapper */
.badge-3d-wrap {
  perspective: 1200px;
  width: 270px;
  height: 420px;
}

/* Interactive Card */
.badge-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.85, 0.32, 1.2);
  cursor: pointer;
}

.badge-card.flipped {
  transform: rotateY(180deg);
}

/* Card Front & Back Common Styles */
.badge-front, .badge-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background-color: #e5e5e7;
  color: #1c1c1e;
  border-radius: 24px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* Lanyard Slot Hole at Top Center */
.lanyard-hole-slot {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.lanyard-hole {
  width: 22px;
  height: 22px;
  background-color: #1c1c1e;
  border-radius: 50%;
}

.lanyard-hole::after {
  display: none;
}

/* Badge Front Identity Header */
.badge-identity {
  text-align: left;
  margin-top: 12px;
  margin-left: 4px;
}

.badge-name {
  font-family: var(--font-sans);
  font-size: 1.55rem;
  font-weight: 600;
  color: #1c1c1e;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.badge-role {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: #636366;
  margin-top: 3px;
}

/* Photo Box Container */
.badge-photo-frame {
  height: 220px;
  background-color: #e5e5ea;
  border-radius: 6px;
  margin-top: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.badge-footer {
  display: none;
}

.badge-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
  transition: filter 0.3s ease;
}

.badge-card:hover .badge-photo {
  filter: brightness(1.03) contrast(1.02);
}

/* Hiring Tag Pill */
.status-badge-tag {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Information List */
.badge-info-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.65rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 3px;
}

.info-label {
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.58rem;
}

.info-value {
  color: #334155;
  font-weight: 600;
}

/* Card Bottom Footer: Barcode & Smart Chip */
.badge-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
}

.barcode-graphic {
  display: flex;
  gap: 2px;
  height: 22px;
}

.barcode-graphic span {
  width: 2px;
  height: 100%;
  background-color: #334155;
}
.barcode-graphic span:nth-child(2n) { width: 3px; }
.barcode-graphic span:nth-child(3n) { width: 1px; }
.barcode-graphic span:nth-child(5n) { width: 4px; }

.smart-chip {
  width: 30px;
  height: 22px;
  background: linear-gradient(135deg, #d97706 0%, #fef3c7 50%, #b45309 100%);
  border-radius: 4px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.chip-pattern {
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}

/* --- BADGE BACK FACE --- */
.badge-back {
  transform: rotateY(180deg);
  background-color: #e5e5e7;
  color: #1c1c1e;
}

.badge-back .lanyard-hole {
  background-color: #1c1c1e;
}

.back-header {
  text-align: center;
  margin-top: 6px;
}

.back-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1c1c1e;
}

.back-subtitle {
  font-size: 0.6rem;
  color: #636366;
  letter-spacing: 0.8px;
  margin-top: 2px;
}

.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 18px 0 10px;
}

.qr-box {
  width: 100px;
  height: 100px;
  background-color: #ffffff;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.qr-svg,
.qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.qr-hint {
  font-size: 0.58rem;
  color: #636366;
}

/* Back Contact Pills */
.back-contact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-pill {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #1c1c1e;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.contact-pill:hover {
  background-color: rgba(0, 0, 0, 0.1);
  border-color: #1c1c1e;
  color: #000000;
}

.flip-back-hint {
  font-size: 0.58rem;
  color: #8e8e93;
  text-align: center;
}

/* Notice label under badge panel */
.card-flip-notice {
  font-size: 0.68rem;
  color: var(--term-prompt-path);
  margin-top: 14px;
  text-align: center;
  animation: fadeInOut 2.5s infinite;
}

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

/* --- RIGHT PANEL: TERMINAL SCREEN --- */
.terminal-panel {
  flex-grow: 1;
  background-color: var(--bg-terminal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.terminal-screen {
  flex-grow: 1;
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: var(--border-window) transparent;
}

.terminal-screen::-webkit-scrollbar {
  width: 6px;
}

.terminal-screen::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.terminal-history {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-row {
  display: flex;
  align-items: flex-start;
}

.terminal-row.command-line {
  font-weight: 600;
}

.terminal-row.response {
  color: var(--term-text);
  white-space: pre-wrap;
  padding-left: 0;
  border-left: none;
  margin-top: 4px;
}

/* Prompt Component Styles */
.prompt {
  display: inline-flex;
  user-select: none;
  white-space: nowrap;
}

.prompt-user {
  color: var(--term-prompt-user);
  font-weight: 600;
}

.prompt-path {
  color: var(--term-prompt-path);
}

.contact-link {
  color: #ffffff !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: color 0.15s ease;
}

.contact-link:hover {
  color: #00ff66 !important;
  text-decoration: underline !important;
}

.nav-shortcut {
  color: #ffffff !important;
  text-decoration: none !important;
}

.nav-shortcut:hover {
  text-shadow: 0 0 8px #ffffff;
  color: #ffffff !important;
}

.menu-divider-line {
  height: 1px;
  background-color: rgba(0, 255, 102, 0.4);
  margin: 6px 0 12px 0;
}

.intro-subtext {
  color: #ffffff;
  font-size: 0.86rem;
}

.command-run-text {
  color: #00ff66;
  font-weight: bold;
}

/* Interactive Links & Clickable Elements */
.cmd-link {
  color: var(--term-link);
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.cmd-link:hover {
  color: var(--term-prompt-symbol);
  text-shadow: 0 0 6px var(--term-prompt-symbol);
}

/* Terminal Tables */
.term-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.8rem;
}

.term-table th, .term-table td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  text-align: left;
}

.term-table th {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--term-accent);
  font-weight: bold;
}

.term-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Skill Bar Custom Progress Meter */
.skill-group {
  margin: 10px 0;
}

.skill-group-title {
  color: var(--term-highlight);
  font-weight: bold;
  margin-bottom: 6px;

}

.skill-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.skill-label {
  width: 170px;
  color: var(--term-text);
  flex-shrink: 0;
}

.skill-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--term-prompt-symbol);
}

/* Active Line Input Container */
.active-prompt-line {
  display: flex;
  align-items: center;
  position: relative;
  margin-top: 4px;
}

.input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  flex-grow: 1;
}

#terminal-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: default;
  border: none;
  outline: none;
  background: transparent;
  color: transparent;
}

.input-display {
  color: var(--term-text);
  white-space: pre;
}

.autocomplete-hint {
  color: rgba(255, 255, 255, 0.3);
  white-space: pre;
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 1.15em;
  background-color: #00ff66;
  margin-left: 2px;
  vertical-align: text-bottom;
  box-shadow: 0 0 6px rgba(0, 255, 102, 0.6);
  animation: cursorBlink 1s infinite;
}

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

/* Typing animation cursor */
.typing-cursor {
  display: inline-block;
  width: 9px;
  height: 1.15em;
  background-color: #00ff66;
  margin-left: 2px;
  vertical-align: text-bottom;
  box-shadow: 0 0 6px rgba(0, 255, 102, 0.6);
  animation: cursorBlink 0.7s infinite;
}

/* --- TERMINAL FOOTER STATUS BAR --- */
.terminal-footer {
  height: 32px;
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-window);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--term-prompt-path);
  flex-shrink: 0;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator.online {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.sep-dot {
  color: rgba(255, 255, 255, 0.2);
}

/* --- RESPONSIVE MOBILE LAYOUT --- */
@media (max-width: 900px) {
  html, body {
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }

  .mac-window {
    width: 98vw;
    height: auto;
    max-height: none;
    margin: 10px 0;
    border-radius: 12px;
  }

  .window-body {
    flex-direction: column;
    height: auto;
  }

  .badge-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-window);
    padding: 16px 12px;
  }

  .badge-3d-wrap {
    width: 260px;
    height: 410px;
  }

  .terminal-panel {
    height: 520px;
  }

  .header-nav {
    max-width: 55vw;
  }
}
