/* ==========================================================================
   CSS SYSTEM - TIKTOK DEVELOPER VAULT (CYBERSECURITY & LINUX THEME)
   ========================================================================== */

/* --- Google Fonts Integration --- */
:root {
  /* Colors */
  --bg-deep: hsl(220, 20%, 4%);
  --bg-card: rgba(10, 15, 30, 0.65);
  --border-light: rgba(0, 255, 204, 0.15);
  --border-focus: rgba(0, 255, 204, 0.5);
  
  --color-cyan: hsl(175, 100%, 45%);
  --color-green: hsl(145, 80%, 45%);
  --color-purple: hsl(270, 75%, 60%);
  --color-magenta: hsl(325, 80%, 55%);
  --color-yellow: hsl(45, 90%, 50%);
  
  --text-primary: hsl(210, 20%, 98%);
  --text-secondary: hsl(215, 12%, 65%);
  --text-muted: hsl(215, 12%, 40%);
  
  /* Fonts & Shadows */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  --shadow-glow-cyan: 0 0 15px rgba(0, 255, 204, 0.35);
  --shadow-glow-green: 0 0 15px rgba(0, 255, 136, 0.35);
  --shadow-glow-magenta: 0 0 15px rgba(255, 0, 128, 0.35);
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.6);
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Light Mode Themes --- */
body.light-mode {
  --bg-deep: hsl(210, 30%, 96%);
  --bg-card: rgba(255, 255, 255, 0.75);
  --border-light: rgba(0, 180, 216, 0.15);
  --border-focus: rgba(0, 180, 216, 0.5);
  
  --color-cyan: hsl(190, 95%, 38%);
  --color-green: hsl(145, 80%, 32%);
  --color-purple: hsl(270, 65%, 45%);
  --color-magenta: hsl(325, 75%, 45%);
  --color-yellow: hsl(40, 85%, 38%);
  
  --text-primary: hsl(220, 25%, 12%);
  --text-secondary: hsl(215, 15%, 32%);
  --text-muted: hsl(215, 12%, 50%);
  
  --shadow-glow-cyan: 0 0 10px rgba(0, 180, 216, 0.2);
  --shadow-glow-green: 0 0 10px rgba(0, 180, 80, 0.2);
  --shadow-card: 0 10px 30px rgba(0, 20, 50, 0.08);
}

body.light-mode .cyber-glow-1 {
  background: radial-gradient(circle, rgba(0, 180, 216, 0.06) 0%, transparent 70%);
}

body.light-mode .cyber-glow-2 {
  background: radial-gradient(circle, rgba(153, 51, 255, 0.05) 0%, transparent 70%);
}

body.light-mode .btn-link {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
}

body.light-mode .btn-link:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

body.light-mode .post-snippet-wrapper {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .dialog-pre {
  background: #f4f6f9 !important;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .code-header {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .btn-copy-code {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .btn-copy-code:hover {
  background: var(--color-cyan);
  color: #fff;
}


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

html, body {
  min-block-size: 100dvb;
  font-family: var(--font-display);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

/* Custom premium scrollbar */
::-webkit-scrollbar {
  inline-size: 10px;
  block-size: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyan);
  box-shadow: var(--shadow-glow-cyan);
}

/* --- Background Cyber Glowing Blobs --- */
.cyber-glow-1 {
  position: fixed;
  inset-inline-start: -10vw;
  inset-block-start: -10vw;
  inline-size: 50vw;
  block-size: 50vw;
  background: radial-gradient(circle, rgba(0, 255, 204, 0.08) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

.cyber-glow-2 {
  position: fixed;
  inset-inline-end: -10vw;
  inset-block-end: -10vw;
  inline-size: 60vw;
  block-size: 60vw;
  background: radial-gradient(circle, rgba(153, 51, 255, 0.07) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(100px);
}

/* --- Common UI elements --- */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.neon-text-cyan {
  color: var(--color-cyan);
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.neon-text-green {
  color: var(--color-green);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.hidden {
  display: none !important;
}

/* --- Container App Layout --- */
.app-container {
  max-inline-size: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
  padding-block: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* --- HEADER SECTION --- */
.header {
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
  inline-size: 100%;
  block-size: 2px;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-purple));
}

.profile-area {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.avatar-wrapper {
  position: relative;
  inline-size: 90px;
  block-size: 90px;
}

.profile-img {
  inline-size: 100%;
  block-size: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-cyan);
  box-shadow: var(--shadow-glow-cyan);
  transition: transform var(--transition-smooth);
}

.avatar-wrapper:hover .profile-img {
  transform: rotate(5deg) scale(1.05);
}

.pulse-indicator {
  position: absolute;
  inset-block-end: 2px;
  inset-inline-end: 2px;
  inline-size: 16px;
  block-size: 16px;
  border-radius: 50%;
  background-color: var(--color-green);
  border: 3px solid var(--bg-deep);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.profile-name {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--color-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-block-start: 0.25rem;
  max-inline-size: 550px;
}

.profile-links {
  display: flex;
  gap: 1rem;
  margin-block-start: 0.75rem;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast);
}

.btn-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-link:hover #link-github {
  color: var(--color-cyan);
}

.icon {
  inline-size: 16px;
  block-size: 16px;
}

/* Terminal & Theme Toggle Wrapper */
.terminal-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  inline-size: 40px;
  block-size: 40px;
  background: rgba(0, 255, 204, 0.06);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--color-cyan);
  cursor: pointer;
  box-shadow: 0 0 0px rgba(0, 255, 204, 0);
  transition: all var(--transition-fast);
}

.btn-theme-toggle:hover {
  background: rgba(0, 255, 204, 0.12);
  border-color: var(--color-cyan);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-2px);
}

body.light-mode .btn-theme-toggle {
  background: rgba(0, 180, 216, 0.06);
  border-color: var(--border-light);
  color: var(--color-cyan);
}

body.light-mode .btn-theme-toggle:hover {
  background: rgba(0, 180, 216, 0.12);
  border-color: var(--color-cyan);
  box-shadow: var(--shadow-glow-cyan);
}

/* Terminal Toggle Button */
.btn-terminal-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 255, 204, 0.06);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--color-cyan);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 0px rgba(0, 255, 204, 0);
  transition: all var(--transition-fast);
}

.btn-terminal-toggle:hover {
  background: rgba(0, 255, 204, 0.12);
  border-color: var(--color-cyan);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-2px);
}

.terminal-pulse {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background-color: var(--color-cyan);
  box-shadow: 0 0 8px var(--color-cyan);
  animation: terminal-flicker 1.5s infinite alternate;
}

@keyframes terminal-flicker {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* --- SEARCH & FILTERS SECTION --- */
.controls-section {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  inset-inline-start: 1rem;
  inline-size: 20px;
  block-size: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-input {
  inline-size: 100%;
  padding: 0.9rem 1.2rem 0.9rem 2.8rem;
  background: rgba(5, 8, 16, 0.8);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-display);
  transition: all var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--color-cyan);
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.12);
}

.search-input:focus + .search-icon {
  color: var(--color-cyan);
}

.btn-clear-search {
  position: absolute;
  inset-inline-end: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem;
  transition: color var(--transition-fast);
}

.btn-clear-search:hover {
  color: var(--color-magenta);
}

.filters-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filter-pill {
  padding: 0.5rem 1.1rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.12);
}

.filter-pill.active {
  background: rgba(0, 255, 204, 0.1);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.15);
}

/* --- REPOSITORIOS DE GITHUB SECTION --- */
.section-repos, .section-posts {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-block-end: 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-size: 1.4rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.2px;
}

.status-indicator {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.repo-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-block-size: 150px;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.repo-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-cyan);
  box-shadow: 0 8px 24px rgba(0, 255, 204, 0.08);
}

.repo-top {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.repo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.repo-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 255, 204, 0.08);
  color: var(--color-cyan);
  border: 1px solid rgba(0, 255, 204, 0.15);
}

.repo-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: clip;
}

.repo-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-start: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.repo-language {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
}

.lang-dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.lang-dot.python { background-color: #3572A5; }
.lang-dot.javascript { background-color: #f1e05a; }
.lang-dot.shell { background-color: #89e051; }
.lang-dot.css { background-color: #563d7c; }
.lang-dot.html { background-color: #e34c26; }

.repo-stats {
  display: flex;
  gap: 0.75rem;
}

.repo-stat-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-small {
  inline-size: 12px;
  block-size: 12px;
}

/* Loading Repo Indicator */
.repo-loading-card, .post-loading-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px dashed rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.spinner {
  inline-size: 32px;
  block-size: 32px;
  border: 3px solid rgba(0, 255, 204, 0.1);
  border-top-color: var(--color-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner.green {
  border: 3px solid rgba(0, 255, 136, 0.1);
  border-top-color: var(--color-green);
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* --- EL BAÚL DE CONTENIDO (POSTS) --- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

/* Responsive posts scaling using container queries */
.posts-grid-wrapper {
  container-type: inline-size;
}

.post-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-green);
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.08);
}

.post-card::after {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: 0;
  inline-size: 4px;
  block-size: 100%;
  background: var(--color-green);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.post-card:hover::after {
  opacity: 1;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 0.75rem;
}

.post-category {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--color-green);
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 255, 136, 0.07);
  border: 1px solid rgba(0, 255, 136, 0.15);
}

.post-date {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.post-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-block-end: 0.5rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.post-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-block-end: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: clip;
}

.post-snippet-wrapper {
  margin-block-end: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  position: relative;
}

.post-snippet {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-cyan);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-block-end: 1.25rem;
}

.post-tag {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-start: auto;
  border-block-start: 1px solid rgba(255, 255, 255, 0.04);
  padding-block-start: 0.75rem;
}

.btn-read-more {
  color: var(--color-green);
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: transform var(--transition-fast);
}

.post-card:hover .btn-read-more {
  transform: translateX(3px);
}

.tiktok-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-magenta);
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

/* --- DETAILED POST DIALOG (MODAL) --- */
.post-dialog {
  margin: auto;
  inline-size: 90%;
  max-inline-size: 960px;
  max-block-size: 85vh;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  outline: none;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.post-dialog::backdrop {
  background: rgba(0, 4, 8, 0.8);
  backdrop-filter: blur(10px);
}

.dialog-content {
  display: flex;
  flex-direction: column;
  max-block-size: 85vh;
}

.dialog-header {
  padding: 1.25rem 2rem;
  border-block-end: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
}

.dialog-header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dialog-category-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--color-cyan);
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 255, 204, 0.08);
  border: 1px solid rgba(0, 255, 204, 0.2);
}

.dialog-date {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.dialog-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
}

.dialog-close-btn:hover {
  color: var(--color-magenta);
}

.dialog-body {
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Two-column layout when video is loaded */
.dialog-body.has-video {
  display: grid;
  grid-template-columns: 325px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.dialog-text-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  inline-size: 100%;
}

@media (max-width: 820px) {
  .dialog-body.has-video {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.dialog-title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dialog-tiktok-container {
  margin-block-end: 0.5rem;
}

.btn-tiktok-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff007f, #00f0ff);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(255, 0, 127, 0.25);
  transition: all var(--transition-fast);
}

.btn-tiktok-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 127, 0.4);
}

/* Markdown styling inside dialog */
.dialog-markdown-content {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.dialog-markdown-content h2,
.dialog-markdown-content h3,
.dialog-markdown-content h4 {
  color: var(--text-primary);
  margin-block-start: 1.5rem;
  margin-block-end: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
}

.dialog-markdown-content h3 { font-size: 1.3rem; border-block-end: 1px solid rgba(255, 255, 255, 0.05); padding-block-end: 0.25rem; }

.dialog-markdown-content p {
  margin-block-end: 1rem;
}

.dialog-markdown-content ul {
  padding-inline-start: 1.5rem;
  margin-block-end: 1rem;
}

.dialog-markdown-content li {
  margin-block-end: 0.35rem;
}

.dialog-markdown-content code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: var(--color-cyan);
}

.dialog-markdown-content pre {
  margin-block-end: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

.dialog-markdown-content pre code {
  color: inherit;
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.dialog-markdown-content blockquote {
  border-inline-start: 4px solid var(--color-cyan);
  background: rgba(0, 255, 204, 0.03);
  padding: 0.75rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin-block-end: 1rem;
}

/* Glowing code blocks */
.dialog-code-block-container {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-block-start: 1rem;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  border-block-end: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-copy-code {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.btn-copy-code:hover {
  background: var(--color-cyan);
  color: var(--bg-deep);
  border-color: var(--color-cyan);
}

.dialog-pre {
  margin: 0;
  padding: 1.2rem;
  background: #0f141d !important;
  overflow-x: auto;
}

.dialog-pre code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* --- INTERACTIVE TERMINAL DRAWER --- */
.terminal-drawer {
  position: fixed;
  inset-inline-end: -460px; /* Hidden by default */
  inset-block-start: 0;
  inline-size: 440px;
  block-size: 100vh;
  background: rgba(5, 7, 12, 0.95);
  border-inline-start: 1px solid var(--border-light);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: inset-inline-end var(--transition-smooth);
}

.terminal-drawer.open {
  inset-inline-end: 0;
}

.terminal-header {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-block-end: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  inline-size: 12px;
  block-size: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.close { background-color: #ff5f56; cursor: pointer; }
.dot.minimize { background-color: #ffbd2e; }
.dot.maximize { background-color: #27c93f; }

.terminal-title {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.btn-close-terminal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}

.btn-close-terminal:hover {
  color: var(--color-magenta);
}

.terminal-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-green);
  display: flex;
  flex-direction: column;
}

.terminal-welcome {
  margin-block-end: 1rem;
}

.terminal-ascii {
  white-space: pre;
  font-size: 0.48rem;
  line-height: 1.2;
  color: var(--color-cyan);
  margin-block-end: 1rem;
  text-shadow: 0 0 5px rgba(0, 255, 204, 0.4);
}

.terminal-tip {
  color: var(--text-secondary);
  margin-block-end: 0.35rem;
}

.cmd-highlight {
  color: var(--color-cyan);
  font-weight: bold;
}

.terminal-sep {
  color: var(--text-muted);
  margin-block-start: 0.5rem;
  margin-block-end: 0.5rem;
}

/* History logging */
.terminal-history-entry {
  margin-block-end: 0.75rem;
  word-break: break-word;
}

.terminal-history-cmd {
  color: var(--text-primary);
  font-weight: bold;
  margin-block-end: 0.25rem;
}

.terminal-history-output {
  white-space: pre-wrap;
  color: var(--color-green);
  line-height: 1.4;
}

/* Dynamic command line */
.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block-start: auto; /* Push to bottom */
  padding-block-start: 1rem;
}

.terminal-prompt {
  color: var(--color-cyan);
  font-weight: bold;
  white-space: nowrap;
}

#terminal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  caret-color: var(--color-cyan);
}

/* Console Themes */
.terminal-drawer.theme-matrix {
  background: rgba(0, 8, 2, 0.96);
  border-inline-start: 1px solid rgba(0, 255, 68, 0.2);
}
.terminal-drawer.theme-matrix .terminal-body {
  color: #00ff41;
  text-shadow: 0 0 4px rgba(0, 255, 65, 0.6);
}
.terminal-drawer.theme-matrix #terminal-input {
  color: #00ff41;
}

.terminal-drawer.theme-retro {
  background: rgba(18, 9, 0, 0.96);
  border-inline-start: 1px solid rgba(255, 120, 0, 0.2);
}
.terminal-drawer.theme-retro .terminal-body {
  color: #ff7800;
  text-shadow: 0 0 4px rgba(255, 120, 0, 0.6);
}
.terminal-drawer.theme-retro #terminal-input {
  color: #ff7800;
}

.terminal-drawer.theme-monochrome {
  background: rgba(10, 10, 10, 0.98);
  border-inline-start: 1px solid rgba(255, 255, 255, 0.1);
}
.terminal-drawer.theme-monochrome .terminal-body {
  color: #ffffff;
}
.terminal-drawer.theme-monochrome #terminal-input {
  color: #ffffff;
}

/* --- FOOTER --- */
.footer {
  margin-block-start: 2rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.cyber-footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-stats {
  display: flex;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.separator {
  opacity: 0.3;
}

/* --- RESPONSIVE DESIGN (BREAKPOINTS) --- */
@media (max-width: 900px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
  }
  
  .terminal-toggle-wrapper {
    inline-size: 100%;
  }
  
  .btn-terminal-toggle {
    inline-size: 100%;
    justify-content: center;
  }
  
  .terminal-drawer {
    inline-size: 100%;
    inset-inline-end: -105%;
  }
}

@media (max-width: 600px) {
  .app-container {
    padding-inline: 0.75rem;
    gap: 1.5rem;
  }
  
  .profile-area {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .profile-name {
    font-size: 1.8rem;
  }
  
  .profile-links {
    flex-wrap: wrap;
  }
  
  .dialog-body {
    padding: 1.25rem;
  }
  
  .dialog-title {
    font-size: 1.4rem;
  }
}
