/* ============================================
   LIQUID GLASS PORTFOLIO - REFACTORED
   Semantic classes · Maintainable · No frameworks
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700;800;900&display=swap');

/* ===== 1. DESIGN TOKENS ===== */
:root {
  /* Glassmorphism Colors */
  --glass-purple: #6366f1;
  --glass-blue: #3b82f6;
  --glass-cyan: #06b6d4;
  --glass-pink: #ec4899;
  --glass-violet: #8b5cf6;

  /* Theme Colors */
  --color-primary: #00f2ea;
  --color-secondary: #ff0050;

  /* Palette */
  --purple-400: #a78bfa;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --cyan-500: #06b6d4;
  --yellow-400: #facc15;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --pink-400: #f472b6;
  --pink-500: #ec4899;
  --red-400: #f87171;
  --red-500: #ef4444;
  --orange-400: #fb923c;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;

  /* Text (dark theme defaults) */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-faint: rgba(255, 255, 255, 0.4);
  --text-ghost: rgba(255, 255, 255, 0.2);

  /* Backgrounds */
  --bg-body: #0f0a1f;
  --bg-body-alt: #1a0b2e;

  /* Glass */
  --glass-bg: rgba(139, 92, 246, 0.1);
  --glass-bg-hover: rgba(139, 92, 246, 0.15);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-inner: rgba(255, 255, 255, 0.3);

  /* Shadows */
  --shadow-glass:
    0 8px 32px 0 rgba(99, 102, 241, 0.2),
    0 2px 8px 0 rgba(0, 0, 0, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
  --shadow-glass-hover:
    0 16px 48px 0 rgba(99, 102, 241, 0.3),
    0 4px 16px 0 rgba(0, 0, 0, 0.15),
    inset 0 2px 0 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.1);

  /* Blur */
  --blur-strong: 40px;
  --blur-medium: 24px;
  --blur-soft: 12px;

  /* Radius */
  --radius-bubble: 50px;
  --radius-card: 32px;
  --radius-pill: 999px;

  /* Easings */
  --ease-liquid: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-display: 'Archivo Black', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ===== 2. RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  overflow: hidden; /* macOS desktop is fixed fullscreen */
  position: relative;
  height: 100vh;
  width: 100vw;
}

main {
  position: relative;
  z-index: 10;
}

a { color: inherit; text-decoration: none; }

/* ===== 3. UTILITIES ===== */
.hidden { display: none !important; }

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar { display: none; }

.truncate-2-lines {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

::selection { background: rgba(139, 92, 246, 0.5); color: #ffffff; }
::-moz-selection { background: rgba(139, 92, 246, 0.5); color: #ffffff; }

/* ===== 4. ANIMATIONS ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fadeInLiquid {
  from { opacity: 0; transform: translateY(30px) scale(0.95); filter: blur(10px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes shimmerLiquid {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes modalSlideOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.95) translateY(20px); }
}

/* ===== 5. BACKGROUND LAYER ===== */
.bg-fixed-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 55%),
    radial-gradient(circle at 30% 60%, rgba(236, 72, 153, 0.2) 0%, transparent 40%),
    linear-gradient(135deg, #1a0b2e 0%, #0f0a1f 50%, #1a0b2e 100%);
}

/* ===== 6. GLASS PANEL (base component) ===== */
.glass-panel {
  position: relative;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
  backdrop-filter: saturate(180%) blur(var(--blur-strong));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-strong));
  border-radius: var(--radius-card);
  border: 1.5px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  overflow: hidden;
  transition: transform 0.6s var(--ease-liquid);
  will-change: transform;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 30%, transparent 70%, rgba(255, 255, 255, 0.2) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
  pointer-events: none;
}

.glass-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
  box-shadow: var(--shadow-glass-hover);
  opacity: 0;
  transition: opacity 0.6s var(--ease-liquid);
  pointer-events: none;
}

.glass-panel:hover {
  transform: translateY(-2px);
}

.glass-panel:hover::after { opacity: 1; }

/* ===== 7. GLASS SEARCH BAR ===== */
.glass-search-bar {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 10, 31, 0.95) 0%, rgba(20, 15, 45, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-card);
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.2);
  overflow: hidden;
  z-index: 50;
  padding: 1rem 1.25rem;
}

/* ===== 8. BUTTON BASE (neutral reset) ===== */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
  outline: none;
  position: relative;
}

/* ===== 9. INPUT BASE ===== */
input[type="text"] {
   width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(99, 102, 241, 0.05));
  backdrop-filter: saturate(180%) blur(var(--blur-medium));
  -webkit-backdrop-filter: saturate(180%) blur(var(--blur-medium));
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.4s var(--ease-liquid);
  outline: none;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

input[type="text"]::placeholder { color: rgba(255, 255, 255, 0.4); }

input[type="text"]:focus {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(99, 102, 241, 0.08));
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3), 0 0 0 4px rgba(139, 92, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* ===== 10. LOADING SCREEN ===== */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
  background: linear-gradient(135deg, #1a0b2e 0%, #0f0a1f 100%);
}

.loading-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.loading-spinner {
  position: relative;
  width: 6rem;
  height: 6rem;
  margin: 0 auto;
}

.spinner-ring {
  position: absolute;
  border-width: 4px;
  border-style: solid;
  border-color: transparent;
  border-radius: 9999px;
  animation: spin 1s linear infinite;
}

.spinner-ring--outer {
  inset: 0;
  border-top-color: var(--purple-500);
}

.spinner-ring--middle {
  inset: 0.5rem;
  border-right-color: var(--blue-500);
  animation-direction: reverse;
  animation-duration: 1.5s;
}

.spinner-ring--inner {
  inset: 1rem;
  border-bottom-color: var(--cyan-500);
  animation-duration: 2s;
}

.loading-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.loading-label {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.025em;
}

.loading-gradient-text {
  background: linear-gradient(to right, var(--purple-400), var(--blue-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.loading-status {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  min-height: 16px;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.loading-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  animation: bounce 1s infinite;
}

.loading-dot--purple {
  background: var(--purple-500);
  box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.5);
  animation-delay: 0s;
}

.loading-dot--blue {
  background: var(--blue-500);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.5);
  animation-delay: 0.15s;
}

.loading-dot--cyan {
  background: var(--cyan-500);
  box-shadow: 0 10px 15px -3px rgba(6, 182, 212, 0.5);
  animation-delay: 0.3s;
}

/* ===== 11. TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 60;
  max-width: 24rem;
  transform: translateX(calc(100% + 2rem));
  transition: transform 0.5s ease-out;
}

.toast.toast--visible {
  transform: translateX(0);
}

.toast__panel {
  padding: 1.25rem;
  border-left: 4px solid var(--yellow-400);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.toast__content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.toast__icon-wrapper {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(250, 204, 21, 0.2);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast__icon-wrapper svg { width: 1.25rem; height: 1.25rem; color: var(--yellow-400); }

.toast__text { flex: 1; min-width: 0; }

.toast__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.toast__message {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.toast__close {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.3s;
  line-height: 1;
}

.toast__close:hover { color: var(--text-primary); }
.toast__close svg { width: 1rem; height: 1rem; }

/* ===== 12. FLOATING ACTION BUTTONS ===== */
.btn-scroll-top {
  position: fixed;
  bottom: calc(var(--mac-dock-total-height) + 1rem);
  right: 2rem;
  z-index: 5000;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: linear-gradient(to bottom right, var(--purple-600), var(--blue-600));
  color: white;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 30px rgba(139, 92, 246, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-scroll-top:hover { transform: translateY(-3px) scale(1.05); }
.btn-scroll-top:active { transform: scale(0.95); }
.btn-scroll-top svg { width: 1.5rem; height: 1.5rem; }

@media (min-width: 1280px) {
  .btn-scroll-top {
    width: 4rem;
    height: 4rem;
  }
  
  .btn-scroll-top svg {
    width: 1.75rem;
    height: 1.75rem;
  }
}

/* ===== 13. MAIN CONTENT LAYOUT ===== */
.main-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2.5rem 1rem;
  opacity: 0;
  transition: opacity 1s;
  will-change: opacity;
}

@media (min-width: 640px) { .main-content { padding: 2.5rem 1.5rem; } }
@media (min-width: 1024px) { .main-content { padding: 2.5rem 2rem; } }

/* ===== 14. HEADER LAYOUT ===== */
.header-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 1024px) {
  .header-layout { grid-template-columns: repeat(12, 1fr); }
}

/* ===== 15. SIDEBAR ===== */
.sidebar { order: 2; }

@media (min-width: 1024px) {
  .sidebar { grid-column: span 4; order: 1; }
}

@media (min-width: 1280px) {
  .sidebar { grid-column: span 3; }
}

/* ===== 16. PROFILE CARD ===== */
.profile-card {
  padding: 1.75rem;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.75rem;
}

/* Prevent glass-panel hover lift on sticky profile */
.profile-card:hover { transform: none; }

/* ===== 17. AVATAR ===== */
.avatar-container {
  position: relative;
  display: inline-block;
}

.avatar-frame {
  width: 9rem;
  height: 9rem;
  margin: 0 auto;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.2),
    0 0 0 12px transparent,
    0 20px 60px rgba(139, 92, 246, 0.4);
  transition: all 0.5s;
}

.avatar-container:hover .avatar-frame {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.3),
    0 0 0 12px rgba(139, 92, 246, 0.2),
    0 20px 60px rgba(139, 92, 246, 0.4);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(to bottom right, #581c87, #1e3a5f);
  transition: transform 0.7s;
}

.avatar-container:hover .avatar-img {
  transform: scale(1.1) rotate(3deg);
}

.avatar-status {
  position: absolute;
  bottom: -0.5rem;
  right: -0.5rem;
  width: 3rem;
  height: 3rem;
  background: linear-gradient(to bottom right, var(--green-400), var(--green-600));
  border: 4px solid var(--bg-body);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.5);
  animation: pulse 2s infinite;
}

.avatar-status svg { width: 1.25rem; height: 1.25rem; color: white; }

/* ===== 18. PROFILE INFO ===== */
.profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #e9d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.025em;
}

.profile-username {
  font-size: 0.875rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--purple-400);
  background: rgba(139, 92, 246, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  display: inline-block;
  border: 1px solid rgba(139, 92, 246, 0.3);
  backdrop-filter: blur(4px);
}

/* ===== 19. PROFILE GITHUB BUTTON ===== */
.profile-github-btn {
  display: block;
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(to right, var(--purple-600), var(--blue-600));
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 1rem;
  transition: all 0.5s;
  overflow: hidden;
  position: relative;
  text-align: center;
}

.profile-github-btn:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 40px rgba(139, 92, 246, 0.5);
  transform: scale(1.05);
}

.profile-github-btn:active { transform: scale(0.95); }

.shimmer-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-200%);
  transition: transform 1s;
}

.profile-github-btn:hover .shimmer-overlay { transform: translateX(200%); }

.btn-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-inner svg { width: 1.25rem; height: 1.25rem; }

/* ===== 20. PROFILE COUNTERS ===== */
.profile-counters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.counter-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.5s;
}

.counter-card:hover { transform: scale(1.05); }

.counter-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.counter-icon svg { width: 1.25rem; height: 1.25rem; }

.counter-icon--purple { background: rgba(139, 92, 246, 0.2); color: var(--purple-400); }
.counter-card:hover .counter-icon--purple { background: rgba(139, 92, 246, 0.3); }

.counter-icon--blue { background: rgba(59, 130, 246, 0.2); color: var(--blue-400); }
.counter-card:hover .counter-icon--blue { background: rgba(59, 130, 246, 0.3); }

.counter-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.counter-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== 21. HEADER CONTENT (right column) ===== */
.header-content {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  order: 1;
}

@media (min-width: 1024px) {
  .header-content { grid-column: span 8; order: 2; }
}

@media (min-width: 1280px) {
  .header-content { grid-column: span 9; }
}

/* ===== 22. HERO BANNER ===== */
.hero-banner {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) { .hero-banner { padding: 3.5rem; } }

/* Prevent glass lift */
.hero-banner:hover { transform: none; }

.hero-glow {
  position: absolute;
  top: -6rem;
  right: -6rem;
  width: 24rem;
  height: 24rem;
  background: linear-gradient(to bottom right, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.2));
  border-radius: 9999px;
  filter: blur(64px);
  opacity: 0.5;
  transition: opacity 1s;
}

.hero-banner:hover .hero-glow { opacity: 0.7; }

.hero-body { position: relative; z-index: 10; }

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 30%, #c7d2fe 60%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 40px rgba(139, 92, 246, 0.5);
}

.hero-title span { display: block; }
.hero-title span + span { margin-top: 0.5rem; }

.hero-description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 42rem;
  line-height: 1.625;
  font-weight: 500;
}

/* ===== 23. STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (min-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.5s;
}

.stat-card:hover { transform: scale(1.05); }

.stat-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s;
}

.stat-card:hover .stat-icon { transform: scale(1.1) rotate(6deg); }
.stat-icon svg { width: 1.75rem; height: 1.75rem; }

.stat-icon--purple {
  background: linear-gradient(to bottom right, rgba(139, 92, 246, 0.2), rgba(124, 58, 237, 0.1));
  color: var(--purple-400);
  box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.2);
}

.stat-icon--yellow {
  background: linear-gradient(to bottom right, rgba(234, 179, 8, 0.2), rgba(202, 138, 4, 0.1));
  color: var(--yellow-400);
  box-shadow: 0 10px 15px -3px rgba(234, 179, 8, 0.2);
}

.stat-icon--blue {
  background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
  color: var(--blue-400);
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2);
}

.stat-icon--pink {
  background: linear-gradient(to bottom right, rgba(236, 72, 153, 0.2), rgba(219, 39, 119, 0.1));
  color: var(--pink-400);
  box-shadow: 0 10px 15px -3px rgba(236, 72, 153, 0.2);
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-value--small {
  font-size: 1.5rem;
  padding-top: 0.5rem;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== 24. SEARCH BAR ===== */
.search-wrapper {
  position: sticky;
  top: 1rem;
  z-index: 40;
  margin-bottom: 2rem;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-field {
  position: relative;
  flex: 1;
}

.search-field__icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  transition: color 0.3s;
}

.search-field__icon svg { width: 1.25rem; height: 1.25rem; }
.search-field:focus-within .search-field__icon { color: var(--purple-400); }
.search-field input { padding-left: 3.5rem; }

/* ===== 25. REFRESH BUTTON ===== */
.btn-refresh {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(to right, var(--purple-600), var(--blue-600));
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.3s;
  box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.3);
}

.btn-refresh:hover {
  background: linear-gradient(to right, var(--purple-500), var(--blue-500));
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.5);
}

.btn-refresh:active { transform: scale(0.95); }
.btn-refresh svg { width: 1rem; height: 1rem; }
.btn-refresh__label { display: none; }

@media (min-width: 640px) { .btn-refresh__label { display: inline; } }

#refresh-data-btn:active svg { animation: spin 0.6s ease-in-out; }

.btn-filter {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 0.5rem;
  transition: all 0.3s;
}

.btn-filter:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-primary);
}

.btn-filter.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--purple-500);
  color: var(--purple-400);
}

.btn-filter svg { width: 1.25rem; height: 1.25rem; }

/* ===== 26. DATA SOURCE INDICATOR ===== */
.data-source {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.data-source svg { width: 0.75rem; height: 0.75rem; }

/* ===== 27. FILTERS ROW ===== */
.filters-row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1rem;
}

@media (min-width: 1024px) {
  .filters-row { flex-direction: row; align-items: center; }
}

/* ===== 28. SORT BUTTONS ===== */
.sort-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.sort-group__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
  cursor: pointer;
  font-weight: 600;
}

.sort-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.sort-btn svg { width: 0.75rem; height: 0.75rem; display: inline-block; }

.sort-btn.active-sort {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.45), rgba(99, 102, 241, 0.35));
  border-color: rgba(139, 92, 246, 0.75);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.4);
}

/* ===== 29. LANGUAGE FILTER BUTTONS ===== */
.language-group {
  display: flex;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .language-group { padding-bottom: 0; justify-content: flex-end; }
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.6);
  color: var(--gray-300);
}

.filter-btn:hover { background: rgba(124, 58, 237, 0.4); }

.filter-btn--active {
  background: white !important;
  color: black !important;
  border-color: white;
  font-weight: 900;
  box-shadow: 0 10px 15px -3px rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

/* ===== 30. REPO CARDS ===== */
.repos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
}

.repos-grid__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 0;
  color: var(--gray-500);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
}

.repo-card {
  position: relative;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.12) 0%, rgba(99, 102, 241, 0.08) 50%, rgba(59, 130, 246, 0.06) 100%);
  backdrop-filter: saturate(200%) blur(var(--blur-medium));
  -webkit-backdrop-filter: saturate(200%) blur(var(--blur-medium));
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1.25rem;
  cursor: pointer;
  overflow: hidden;
  transition: transform 220ms var(--ease-liquid);
  will-change: transform;
  isolation: isolate;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 8px 32px rgba(99, 102, 241, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.repo-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.6), rgba(99, 102, 241, 0.6), rgba(59, 130, 246, 0.6));
  border-radius: var(--radius-card);
  z-index: -2;
  opacity: 0;
  transition: opacity 0.5s var(--ease-liquid);
  filter: blur(8px);
  box-shadow:
    0 24px 64px rgba(99, 102, 241, 0.35),
    0 8px 24px rgba(139, 92, 246, 0.25);
}

.repo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-liquid);
  pointer-events: none;
  mix-blend-mode: overlay;
}

.repo-card:hover {
  transform: translateY(-2px);
}

.repo-card:hover::before { opacity: 1; }
.repo-card:hover::after { opacity: 1; }

/* Repo card title */
.repo-card h3,
.repo-card__name {
  font-size: 1.125rem;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
  transition: all 0.4s var(--ease-liquid);
  word-break: break-all;
}

.repo-card:hover h3,
.repo-card:hover .repo-card__name {
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 50%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--color-primary);
}

.repo-card p,
.repo-card__description {
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--gray-400);
  margin-bottom: 1.5rem;
  flex: 1;
}

/* Card internals (rendered by JS) */
.repo-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.repo-card__folder-icon {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s, color 0.3s;
}

.repo-card__folder-icon svg { width: 1.25rem; height: 1.25rem; }

.repo-card:hover .repo-card__folder-icon {
  background: var(--color-primary);
  color: black;
}

.repo-card__actions {
  display: flex;
  gap: 0.5rem;
}

.repo-card__web-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 242, 234, 0.1);
  border: 1px solid rgba(0, 242, 234, 0.5);
  color: var(--color-primary);
  border-radius: 0.375rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 0.3s;
  z-index: 10;
  text-decoration: none;
}

.repo-card__web-link:hover { background: var(--color-primary); color: black; }
.repo-card__web-link svg { width: 0.75rem; height: 0.75rem; }

.repo-card__github-link {
  padding: 0.375rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.375rem;
  color: var(--gray-400);
  transition: all 0.3s;
  z-index: 10;
  display: flex;
  align-items: center;
}

.repo-card__github-link:hover { background: rgba(255, 255, 255, 0.2); color: white; }

/* ===== 30b. REPO CARD EXTRA ELEMENTS ===== */

/* Botón VS Code */
.repo-card__vscode-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 120, 212, 0.12);
  border: 1px solid rgba(0, 120, 212, 0.4);
  color: #60a5fa;
  border-radius: 0.375rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 0.3s;
  z-index: 10;
  text-decoration: none;
  white-space: nowrap;
}
.repo-card__vscode-link:hover { background: rgba(0, 120, 212, 0.35); color: white; }
.repo-card__vscode-link svg { width: 0.75rem; height: 0.75rem; }

/* Botón Copiar Clone */
.repo-card__clone-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.375rem;
  color: var(--gray-400);
  transition: all 0.3s;
  z-index: 10;
  border: none;
  cursor: pointer;
}
.repo-card__clone-btn:hover { background: rgba(255, 255, 255, 0.15); color: white; }
.repo-card__clone-btn svg { width: 0.875rem; height: 0.875rem; }
.clone-success-icon { color: var(--green-400) !important; }

/* Fila de actualización */
.repo-card__update-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}
.repo-card__update-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.repo-card__update-tag svg { width: 0.75rem; height: 0.75rem; }

/* Badges de tecnologías */
.repo-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}
.repo-card__badges-empty { margin-bottom: 0; }
.repo-card__tech-badge {
  height: 18px;
  border-radius: 3px;
}

/* Footer de la tarjeta */
.repo-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.repo-card__language {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.repo-card__lang-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.repo-card__stats {
  display: flex;
  gap: 0.75rem;
}
.repo-card__stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.repo-card__stat svg { width: 0.75rem; height: 0.75rem; }

/* Highlight de búsqueda */
mark.search-highlight {
  background: rgba(250, 204, 21, 0.3);
  color: var(--yellow-400);
  border-radius: 2px;
  padding: 0 2px;
}

/* ===== 30c. LOAD MORE SECTION ===== */
.load-more-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.btn-load-more {
  padding: 0.875rem 2.5rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: var(--radius-pill);
  color: var(--purple-400);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-load-more:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(99, 102, 241, 0.3));
  border-color: var(--purple-400);
  color: white;
  transform: translateY(-2px);
}
.btn-load-more__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-load-more__inner svg { width: 1rem; height: 1rem; }

.results-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}


.repo-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.repo-card__tag {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transition: all 0.3s;
}

.repo-card__tag:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-primary);
}

/* ===== 32. FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 2.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-author {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-copyright {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* ===== 33. MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  transition: opacity 0.3s var(--ease-liquid);
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal:not(.hidden) .modal__container {
  animation: modalSlideIn 0.4s var(--ease-liquid);
}

.modal.closing .modal__container {
  animation: modalSlideOut 0.3s var(--ease-liquid);
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(12px);
  background: rgba(15, 10, 31, 0.9);
}

.modal__container {
  position: absolute;
  inset: 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1024px) {
  .modal__container { inset: 3rem; }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.05));
}

@media (min-width: 1024px) { .modal__header { padding: 2rem; } }

.modal__title-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1;
}

.modal__icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  background: linear-gradient(to bottom right, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__icon svg { width: 1.5rem; height: 1.5rem; color: white; }

.modal__title {
  font-weight: 700;
  color: white;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1024px) { .modal__title { font-size: 1.5rem; } }

.modal__close {
  flex-shrink: 0;
  padding: 0.75rem;
  border-radius: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s;
  margin-left: 1rem;
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transform: rotate(90deg);
}

.modal__close svg { width: 1.5rem; height: 1.5rem; }

.modal__body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ===== 34. MODAL SIDEBAR (file tree) ===== */
.modal__sidebar {
  width: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(99, 102, 241, 0.03));
}

@media (min-width: 1024px) { .modal__sidebar { width: 20rem; } }

.modal__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-ghost);
}

.modal__placeholder-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal__placeholder-inner svg {
  width: 4rem;
  height: 4rem;
  margin: 0 auto;
  opacity: 0.2;
}

.modal__placeholder-text {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== 35. MODAL CODE AREA ===== */
.modal__code-area {
  flex: 1;
  overflow-y: auto;
  background: linear-gradient(135deg, rgba(15, 10, 31, 0.8), rgba(26, 11, 46, 0.6));
}

.modal__code-viewer {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-ghost);
  padding: 2.5rem;
}

.modal__code-viewer svg { opacity: 0.1; margin-bottom: 1.25rem; }
.modal__code-viewer > svg { width: 5rem; height: 5rem; }

.modal__code-viewer p {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.4;
}

/* Modal loading / error states (rendered by JS) */
.modal__loading {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.modal__loading svg { width: 2rem; height: 2rem; animation: spin 1s linear infinite; margin-bottom: 0.5rem; }

.modal__loading-text {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  font-family: var(--font-mono);
}

.modal__loading--pulse {
  text-align: center;
  padding: 1rem;
  color: var(--color-primary);
  animation: pulse 2s infinite;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
}

.modal__error {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--red-400);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.modal__error svg { width: 1.5rem; height: 1.5rem; margin-bottom: 0.5rem; }

.modal__message {
  padding: 2.5rem;
  text-align: center;
}

.modal__message--warning { color: var(--yellow-400); }
.modal__message--muted { color: var(--gray-500); }

/* ===== 36. FILE TREE ===== */
.tree-folder {
  margin-left: 0.5rem;
}

.tree-folder[open] { margin-bottom: 0.25rem; }

.tree-folder__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 11px;
  color: var(--gray-400);
  user-select: none;
  transition: background-color 0.2s;
  outline: none;
  list-style: none;
}

.tree-folder__summary::-webkit-details-marker { display: none; }
.tree-folder__summary:hover { background: rgba(255, 255, 255, 0.05); }

.tree-folder__icon { width: 0.75rem; height: 0.75rem; }
.tree-folder__icon--closed { color: rgba(234, 179, 8, 0.8); }
.tree-folder__icon--open { color: var(--yellow-400); display: none; }
.tree-folder[open] > .tree-folder__summary .tree-folder__icon--closed { display: none; }
.tree-folder[open] > .tree-folder__summary .tree-folder__icon--open { display: block; }

.tree-folder__name {
  font-weight: 700;
  color: var(--gray-300);
  transition: color 0.2s;
}

.tree-folder__summary:hover .tree-folder__name { color: white; }

.tree-folder__children {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  margin-left: 0.625rem;
  padding-left: 0.25rem;
  margin-top: 0.25rem;
}

.tree-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem;
  margin-left: 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 10px;
  color: var(--gray-400);
  transition: all 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.tree-file:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-primary);
}

.tree-file svg { width: 0.75rem; height: 0.75rem; opacity: 0.5; flex-shrink: 0; }

.tree-file--active {
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

/* ===== 37. CODE CONTENT ===== */
.code-content {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-300);
  white-space: pre-wrap;
  word-break: break-word;
  height: 100%;
  overflow: auto;
  padding: 1rem;
  line-height: 1.6;
}

#code-viewer pre {
  font-size: 11px;
  line-height: 1.6;
}

/* ===== 38. CHIPS & BADGES ===== */
.repo-chip,
.hero-tag,
.filter-pill {
  position: relative;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  backdrop-filter: blur(var(--blur-soft));
  -webkit-backdrop-filter: blur(var(--blur-soft));
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.4s var(--ease-liquid);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.badge-new {
  font-size: 0.625rem;
  font-weight: 800;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ===== 39. MARKDOWN RENDERER ===== */
.markdown-body {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9375rem;
  line-height: 1.7;
  padding: 2rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.markdown-body code {
  background: rgba(139, 92, 246, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.875em;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-body pre {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.08));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}

/* ===== 40. SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }

::-webkit-scrollbar-track {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(99, 102, 241, 0.03));
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.6), rgba(99, 102, 241, 0.5));
  border-radius: var(--radius-pill);
  border: 2px solid rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(99, 102, 241, 0.7));
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

/* ===== 41. SKELETON LOADER ===== */
.skeleton {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.05) 0%, rgba(139, 92, 246, 0.15) 50%, rgba(139, 92, 246, 0.05) 100%);
  background-size: 200% 100%;
  animation: shimmerLiquid 2s infinite;
}

/* ===== 42. ERROR SCREEN (rendered by JS) ===== */
.error-screen {
  text-align: center;
  padding: 1rem;
  color: var(--red-500);
}

.error-title {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.error-message {
  font-size: 0.875rem;
  opacity: 0.8;
}

.btn-retry {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(239, 68, 68, 0.2);
  color: var(--red-500);
  border: 1px solid var(--red-500);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
}

.btn-retry:hover { background: rgba(239, 68, 68, 0.3); }

/* ===== 43. INTERSECTION OBSERVER ANIMATIONS ===== */
.fade-in-hidden {
  opacity: 0;
  transform: translateY(10px);
}

.fade-in-hidden.animate-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

.repo-card:nth-child(1).animate-in { transition-delay: 0.05s; }
.repo-card:nth-child(2).animate-in { transition-delay: 0.1s; }
.repo-card:nth-child(3).animate-in { transition-delay: 0.15s; }
.repo-card:nth-child(4).animate-in { transition-delay: 0.05s; }
.repo-card:nth-child(5).animate-in { transition-delay: 0.1s; }
.repo-card:nth-child(6).animate-in { transition-delay: 0.15s; }
.repo-card:nth-child(7).animate-in { transition-delay: 0.05s; }
.repo-card:nth-child(8).animate-in { transition-delay: 0.1s; }
.repo-card:nth-child(9).animate-in { transition-delay: 0.15s; }

/* ===== 44. MEDIA QUERIES & RESPONSIVE ===== */
@media (max-width: 640px) {
  .repos-grid { grid-template-columns: 1fr; gap: 1rem; }

  :root {
    --blur-strong: 30px;
    --blur-medium: 20px;
  }

  .modal__sidebar { max-height: 200px; overflow-y: auto; }

  .hero-title { font-size: 2.5rem !important; }

  .language-group { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .btn-scroll-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
  }
}

/* ===== 46. REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in-hidden { opacity: 1; transform: none; }
}

/* ===== 47. PRINT ===== */
@media print {
  body { background: white; color: black; overflow: visible; height: auto; }

  .mac-wallpaper,
  .mac-menubar,
  .mac-window__titlebar,
  .mac-dock-container,
  .bg-fixed-layer,
  .loading-screen,
  .toast,
  .modal,
  .btn-scroll-top,
  .search-wrapper,
  button { display: none !important; }

  .mac-desktop,
  .mac-window-area,
  .mac-window,
  .mac-window__content { 
    position: static !important;
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    background: white !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .glass-panel {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .repo-card {
    background: white;
    border: 1px solid #ddd;
    box-shadow: none;
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }

  a { text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}

/* ===== 48. ACCESSIBILITY ===== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.8);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.repo-card:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.8);
  outline-offset: 2px;
}

/* =====================================================
   macOS DESKTOP EXPERIENCE — Apple-style UI
   Menubar · Window Chrome · Dock · Glassmorphism
   ===================================================== */

/* ------ macOS Design Tokens ------ */
:root {
  --mac-menubar-height: 28px;
  --mac-titlebar-height: 52px;
  --mac-dock-height: 60px;
  --mac-dock-gap: 8px;
  --mac-dock-total-height: calc(var(--mac-dock-height) + var(--mac-dock-gap) * 2 + 14px);
  --mac-window-radius: 12px;

  /* macOS traffic lights */
  --mac-btn-close: #ff5f56;
  --mac-btn-close-border: #e0443e;
  --mac-btn-minimize: #ffbd2e;
  --mac-btn-minimize-border: #dea123;
  --mac-btn-maximize: #27c93f;
  --mac-btn-maximize-border: #1aab29;

  /* macOS glass colours */
  --mac-glass-dark: rgba(28, 28, 35, 0.75);
  --mac-glass-medium: rgba(40, 40, 50, 0.65);
  --mac-glass-light: rgba(255, 255, 255, 0.08);
  --mac-border-subtle: rgba(255, 255, 255, 0.12);
  --mac-shadow-window:
    0 32px 64px rgba(0, 0, 0, 0.6),
    0 16px 32px rgba(0, 0, 0, 0.4),
    0 0 0 0.5px rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ------ macOS Desktop (root container) ------ */
.mac-desktop {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ------ macOS Wallpaper ------ */
.mac-wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 0% 0%,   #5e2ca5 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%,  #0a84ff 0%, transparent 50%),
    radial-gradient(ellipse at 50% 60%,  #2d1b69 0%, transparent 60%),
    radial-gradient(ellipse at 100% 100%, #ff6b35 0%, transparent 50%),
    radial-gradient(ellipse at 0% 100%,  #1e3a8a 0%, transparent 55%),
    linear-gradient(160deg, #1a0d3b 0%, #0d1b4b 40%, #1a0d3b 100%);
  animation: mac-wallpaper-shift 30s ease-in-out infinite alternate;
}

@keyframes mac-wallpaper-shift {
  0%   { filter: hue-rotate(0deg)   brightness(1); }
  50%  { filter: hue-rotate(15deg)  brightness(1.05); }
  100% { filter: hue-rotate(-10deg) brightness(0.98); }
}

/* ------ macOS Menu Bar ------ */
.mac-menubar {
  position: relative;
  z-index: 1000;
  height: var(--mac-menubar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(20, 20, 28, 0.72);
  backdrop-filter: saturate(200%) blur(40px);
  -webkit-backdrop-filter: saturate(200%) blur(40px);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 400;
  user-select: none;
}

.mac-menubar__left,
.mac-menubar__right {
  display: flex;
  align-items: center;
  gap: 0;
}

.mac-menubar__apple {
  font-size: 15px;
  margin-right: 6px;
  cursor: default;
  color: rgba(255, 255, 255, 0.95);
  padding: 0 8px;
  line-height: var(--mac-menubar-height);
}

.mac-menubar__app-name {
  font-weight: 600;
  padding: 0 8px;
  cursor: default;
  color: rgba(255, 255, 255, 0.95);
}

.mac-menubar__item {
  padding: 0 8px;
  cursor: default;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.15s ease;
  border-radius: 4px;
  line-height: var(--mac-menubar-height);
}

.mac-menubar__item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mac-menubar__right {
  gap: 4px;
}

.mac-menubar__status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  cursor: default;
  color: rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  transition: background 0.15s ease;
}

.mac-menubar__status-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mac-menubar__status-icon svg {
  width: 14px;
  height: 14px;
}

.mac-menubar__clock {
  padding: 0 8px;
  font-size: 13px;
  font-weight: 400;
  cursor: default;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ------ Window Area (desktop canvas) ------ */
.mac-window-area {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 8px;
  overflow: hidden;
}

/* ------ macOS Window ------ */
.mac-window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1340px;
  height: 100%;
  border-radius: var(--mac-window-radius);
  background: var(--mac-glass-dark);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  box-shadow: var(--mac-shadow-window);
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mac-window--fullscreen {
  border-radius: 0;
  max-width: 100%;
  height: calc(100vh - var(--mac-menubar-height));
}

.mac-window--closed {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

.mac-window--minimized {
  opacity: 0.25;
  transform: scale(0.45) translateY(130%);
  pointer-events: none;
}

/* ------ Window Title Bar ------ */
.mac-window__titlebar {
  position: relative;
  z-index: 10;
  height: var(--mac-titlebar-height);
  min-height: var(--mac-titlebar-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(30, 30, 40, 0.6);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
  cursor: default;
  user-select: none;
  flex-shrink: 0;
}

.mac-window__controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Traffic light buttons */
.mac-window__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 0.1s ease;
  flex-shrink: 0;
}

.mac-window__btn--close {
  background: var(--mac-btn-close);
  box-shadow: 0 0 0 0.5px var(--mac-btn-close-border);
}

.mac-window__btn--minimize {
  background: var(--mac-btn-minimize);
  box-shadow: 0 0 0 0.5px var(--mac-btn-minimize-border);
}

.mac-window__btn--maximize {
  background: var(--mac-btn-maximize);
  box-shadow: 0 0 0 0.5px var(--mac-btn-maximize-border);
}

.mac-window__btn:hover { filter: brightness(0.85); }
.mac-window__btn:active { filter: brightness(0.7); }

/* Hide icons inside traffic lights until hover on the controls group */
.mac-window__btn-icon {
  opacity: 0;
  transition: opacity 0.1s ease;
  color: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.mac-window__controls:hover .mac-window__btn-icon {
  opacity: 1;
}

/* Window title */
.mac-window__title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.01em;
}

.mac-window__title-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* ------ Window scrollable content ------ */
.mac-window__content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  /* Custom scrollbar matching macOS dark style */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.mac-window__content::-webkit-scrollbar { width: 8px; }
.mac-window__content::-webkit-scrollbar-track { background: transparent; }
.mac-window__content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.mac-window__content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ------ macOS Dock ------ */
.mac-dock-container {
  position: relative;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: var(--mac-dock-gap) 0 calc(var(--mac-dock-gap) + 4px);
  flex-shrink: 0;
}

.mac-dock {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(30, 30, 40, 0.55);
  backdrop-filter: saturate(200%) blur(40px);
  -webkit-backdrop-filter: saturate(200%) blur(40px);
  border-radius: 20px;
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.mac-dock__separator {
  width: 0.5px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
  align-self: center;
}

/* Dock item */
.mac-dock__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  /* Base state for magnification */
  --dock-scale: 1;
  transform: scale(var(--dock-scale)) translateY(0);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom center;
}

/* macOS dock magnify — JS-free CSS approach using sibling selectors */
.mac-dock:hover .mac-dock__item {
  transform: scale(0.9) translateY(2px);
}

.mac-dock__item:hover {
  transform: scale(1.35) translateY(-10px) !important;
  z-index: 10;
}

/* Neighbouring items get mild magnification */
.mac-dock__item:hover + .mac-dock__item,
.mac-dock__item:has(+ .mac-dock__item:hover) {
  transform: scale(1.2) translateY(-5px) !important;
  z-index: 9;
}

.mac-dock__item:hover + .mac-dock__item + .mac-dock__item,
.mac-dock__item:has(+ .mac-dock__item + .mac-dock__item:hover) {
  transform: scale(1.08) translateY(-2px) !important;
  z-index: 8;
}

/* Dock icon container */
.mac-dock__icon {
  width: var(--mac-dock-height);
  height: var(--mac-dock-height);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.2s ease;
}

.mac-dock__icon svg {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Dock icon colour themes */
.mac-dock__icon--home    { background: linear-gradient(145deg, #5e9bff, #2563eb); color: #fff; }
.mac-dock__icon--profile { background: linear-gradient(145deg, #c084fc, #7c3aed); color: #fff; }
.mac-dock__icon--search  { background: linear-gradient(145deg, #34d399, #059669); color: #fff; }
.mac-dock__icon--repos   { background: linear-gradient(145deg, #f472b6, #db2777); color: #fff; }
.mac-dock__icon--github  { background: linear-gradient(145deg, #6e7681, #24292f); color: #fff; }

.mac-dock__item:hover .mac-dock__icon {
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* Dock label tooltip */
.mac-dock__label {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 35, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.mac-dock__label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(28, 28, 35, 0.88);
}

.mac-dock__item:hover .mac-dock__label {
  opacity: 1;
}

/* ------ Toast/Loading z-index inside desktop ------ */
.loading-screen,
.toast {
  z-index: 9000;
}

/* ------ Modal inside macOS desktop ------ */
.modal {
  z-index: 8000;
}

/* ------ Responsive adjustments for macOS layout ------ */
@media (max-width: 768px) {
  :root {
    --mac-dock-height: 56px;
    --mac-titlebar-height: 44px;
  }

  .mac-menubar__item { display: none; }

  .mac-dock__icon { border-radius: 14px; }
  .mac-dock__icon svg { width: 28px; height: 28px; }

  .mac-window-area { padding: 10px 10px 6px; }

  .mac-dock {
    gap: 4px;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  :root {
    --mac-dock-height: 48px;
    --mac-titlebar-height: 40px;
    --mac-menubar-height: 24px;
  }

  .mac-menubar__apple,
  .mac-menubar__app-name { display: block; }

  .mac-menubar__status-icon:not(:last-child) { display: none; }

  .mac-window-area { padding: 6px 6px 4px; }
}

/* ------ Web mode: remove OS-like chrome and keep regular page flow ------ */
body.web-mode {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  width: 100%;
}

body.web-mode .mac-desktop {
  position: relative;
  overflow: visible;
  min-height: 100vh;
}

body.web-mode .mac-wallpaper,
body.web-mode .mac-menubar,
body.web-mode .mac-window__titlebar,
body.web-mode .mac-dock-container {
  display: none !important;
}

body.web-mode .mac-window-area {
  display: block;
  padding: 0;
  overflow: visible;
}

body.web-mode .mac-window {
  max-width: none;
  height: auto;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  overflow: visible;
}

body.web-mode .mac-window__content {
  overflow: visible;
}

body.web-mode .main-content {
  padding-top: 1.5rem;
}

body.web-mode .btn-scroll-top {
  bottom: 1.5rem;
}

/* ============================================
   🔒 PRIVATE DASHBOARD ADDITIONS
   ============================================ */

/* 1. Login Screen */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 11, 16, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.login-card {
  position: relative;
  width: 90%;
  max-width: 360px;
  padding: 2.5rem 2rem;
  background: rgba(25, 28, 41, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: loginCardAppear 0.5s var(--ease-liquid);
}

@keyframes loginCardAppear {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-avatar-container {
  display: inline-block;
  margin-bottom: 1.25rem;
}

.login-avatar-frame {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
  box-shadow: 0 8px 24px rgba(0, 242, 234, 0.25);
}

.login-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0f0a1f;
}

.login-title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.4;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-field {
  position: relative;
  width: 100%;
}

.login-field__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-muted);
}

.login-field input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.login-field input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 242, 234, 0.25);
}

.login-error-msg {
  font-size: 0.8rem;
  color: #ff6b6b;
  margin-top: -0.25rem;
  text-align: left;
  min-height: 1rem;
}

.login-submit-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--color-primary);
  color: #0c1118;
  border: none;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px var(--color-primary);
}

.login-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid #0c1118;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Shake Animation */
.shake-anim {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* 2. Badges privados en las tarjetas */
.repo-card__private-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.repo-card__private-badge i {
  width: 0.75rem;
  height: 0.75rem;
}

/* 3. Botón de borrado de repo */
.repo-card__delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.repo-card__delete-btn:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
}

.repo-card__delete-btn i {
  width: 1.1rem;
  height: 1.1rem;
}

/* 4. Selector de ramas en visor de código */
.branch-select-wrapper {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  gap: 0.4rem;
  margin-left: 1rem;
  font-size: 0.8rem;
}

.branch-select-wrapper select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.branch-select-wrapper select option {
  background: #10151d;
  color: var(--text-primary);
}

.branch-select-wrapper i.branch-icon {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--color-primary);
}

/* 5. Historial de commits en visor */
.commits-sidebar {
  width: 250px;
  border-left: 1px solid var(--color-border);
  background: rgba(8, 11, 16, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.commits-title {
  padding: 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
}

.commits-title i {
  width: 1rem;
  height: 1rem;
  color: var(--color-primary);
}

.commits-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.commit-item {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.commit-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.05);
}

.commit-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.commit-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-border);
}

.commit-info {
  flex: 1;
  min-width: 0;
}

.commit-msg {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commit-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commits-loading, .commits-error {
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Adaptación del modal de código para commits */
.modal__container {
  display: flex;
  flex-direction: column;
}
.modal__body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.modal__sidebar {
  flex: 0 0 200px;
}
.modal__code-area {
  flex: 1;
  border-right: none;
}

/* 6. Formulario del Modal Crear Repo */
.modal__container--small {
  max-width: 450px !important;
}

.modal__form {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group--row {
  flex-direction: row;
  align-items: center;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-textarea {
  height: 80px;
  resize: none;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 8px rgba(0, 242, 234, 0.2);
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-error-msg {
  font-size: 0.8rem;
  color: #ff6b6b;
  min-height: 1rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-cancel, .btn-submit {
  padding: 0.65rem 1.2rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-submit {
  background: var(--color-primary);
  border: none;
  color: #0c1118;
}

.btn-submit:hover {
  box-shadow: 0 0 10px var(--color-primary);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


