/* ============================================
   CSS Variables - Light Mode (Default)
   ============================================ */
:root {
  --bg: #f8fafc;
  --card: rgba(255, 255, 255, 0.8);
  --border: rgba(0, 0, 0, 0.1);
  --text: #1e293b;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-2: #22d3ee;
}

/* ============================================
   CSS Variables - Dark Mode
   ============================================ */
.dark {
  --bg: #0b1020;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e5e7eb;
  --muted: #a1a1aa;
  --accent: #6366f1;
  --accent-2: #22d3ee;
}

/* ============================================
   Base Styles
   ============================================ */
html,
body {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Light mode background gradient */
html:not(.dark) body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(99, 102, 241, 0.15), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(34, 211, 238, 0.15), transparent 60%),
    var(--bg);
}

/* Dark mode background gradient */
html.dark body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(99, 102, 241, 0.25), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(34, 211, 238, 0.25), transparent 60%),
    var(--bg);
}

/* ============================================
   Glass Morphism
   ============================================ */
.glass {
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Light mode glass */
html:not(.dark) .glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Dark mode glass */
html.dark .glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.05));
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.2rem;
  border-radius: .8rem;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  box-shadow: 0 10px 25px rgba(99, 102, 241, .35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(99, 102, 241, .45);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  transition: background 0.3s ease, transform 0.2s ease;
}

/* Light mode ghost button */
html:not(.dark) .btn-ghost {
  background: rgba(0, 0, 0, 0.05);
}

html:not(.dark) .btn-ghost:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Dark mode ghost button */
html.dark .btn-ghost {
  background: rgba(255, 255, 255, 0.06);
}

html.dark .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
  transform: translateY(-1px);
}

/* ============================================
   Tags
   ============================================ */
.tag {
  padding: .25rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light mode tags */
html:not(.dark) .tag {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Dark mode tags */
html.dark .tag {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* ============================================
   Text Effects
   ============================================ */
.gradient-text {
  background: linear-gradient(90deg, #a78bfa, #22d3ee, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================
   Navigation
   ============================================ */
.section {
  scroll-margin-top: 90px;
}

.nav-blur {
  backdrop-filter: blur(12px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Light mode nav */
html:not(.dark) .nav-blur {
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Dark mode nav */
html.dark .nav-blur {
  background: rgba(8, 12, 24, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   Cards & Hover Effects
   ============================================ */
.card-hover {
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35), 0 10px 30px rgba(99, 102, 241, .15);
  border-color: rgba(99, 102, 241, .35);
}

/* ============================================
   Grid Layouts
   ============================================ */
.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* ============================================
   Progress Bars
   ============================================ */
.progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  transition: background 0.3s ease;
}

/* Light mode progress */
html:not(.dark) .progress {
  background: rgba(0, 0, 0, 0.1);
}

/* Dark mode progress */
html.dark .progress {
  background: rgba(255, 255, 255, 0.08);
}

.progress>span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #6366f1);
  border-radius: 999px;
  transition: width .6s ease;
}

/* ============================================
   Shadows & Effects
   ============================================ */
.shadow-ring {
  box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.15);
}

/* ============================================
   Links
   ============================================ */
.link {
  text-decoration: none;
  transition: color 0.3s ease;
}

/* Light mode links */
html:not(.dark) .link {
  color: #6366f1;
}

html:not(.dark) .link:hover {
  color: #4f46e5;
  text-decoration: underline;
}

/* Dark mode links */
html.dark .link {
  color: #a5b4fc;
}

html.dark .link:hover {
  color: #c7d2fe;
  text-decoration: underline;
}

/* ============================================
   Blob Effects
   ============================================ */
.blob {
  filter: blur(40px);
  opacity: .6;
  mix-blend-mode: screen;
}

.backdrop {
  transition: background 0.3s ease;
}

/* Light mode backdrop */
html:not(.dark) .backdrop {
  background: radial-gradient(60% 60% at 20% 20%, rgba(99, 102, 241, .1), transparent 60%),
    radial-gradient(50% 50% at 80% 30%, rgba(34, 211, 238, .08), transparent 60%),
    radial-gradient(60% 60% at 50% 80%, rgba(52, 211, 153, .06), transparent 60%);
}

/* Dark mode backdrop */
html.dark .backdrop {
  background: radial-gradient(60% 60% at 20% 20%, rgba(99, 102, 241, .25), transparent 60%),
    radial-gradient(50% 50% at 80% 30%, rgba(34, 211, 238, .2), transparent 60%),
    radial-gradient(60% 60% at 50% 80%, rgba(52, 211, 153, .15), transparent 60%);
}

/* ============================================
   Text Colors for Light Mode
   ============================================ */
html:not(.dark) .text-gray-300 {
  color: #475569;
}

html:not(.dark) .text-gray-400 {
  color: #64748b;
}

html:not(.dark) .text-gray-200 {
  color: #1e293b;
}

html:not(.dark) .text-indigo-200 {
  color: #4f46e5;
}

html:not(.dark) .text-indigo-300 {
  color: #4f46e5;
}

/* Icon Colors for Light Mode - Make them more visible */
html:not(.dark) svg.text-indigo-300 {
  color: #4f46e5 !important;
}

html:not(.dark) svg.text-emerald-300 {
  color: #059669 !important;
}

html:not(.dark) svg.text-cyan-300 {
  color: #0891b2 !important;
}

html:not(.dark) svg.text-purple-300 {
  color: #9333ea !important;
}

html:not(.dark) svg.text-gray-400 {
  color: #475569 !important;
}

/* Icon background colors for light mode */
html:not(.dark) .bg-indigo-500\/30 {
  background-color: rgba(99, 102, 241, 0.15) !important;
}

html:not(.dark) .bg-emerald-500\/30 {
  background-color: rgba(16, 185, 129, 0.15) !important;
}

html:not(.dark) .bg-cyan-500\/30 {
  background-color: rgba(6, 182, 212, 0.15) !important;
}

html:not(.dark) .bg-purple-500\/30 {
  background-color: rgba(147, 51, 234, 0.15) !important;
}

/* Text colors for light mode */
html:not(.dark) .text-indigo-300:not(svg) {
  color: #4f46e5;
}

html:not(.dark) .text-emerald-300:not(svg) {
  color: #059669;
}

html:not(.dark) .text-cyan-300:not(svg) {
  color: #0891b2;
}

html:not(.dark) .text-purple-300:not(svg) {
  color: #9333ea;
}

/* Highlighted keywords in light mode - ensure visibility */
html:not(.dark) .font-semibold.text-indigo-300 {
  color: #4f46e5 !important;
}

html:not(.dark) .font-semibold.text-emerald-300 {
  color: #059669 !important;
}

html:not(.dark) .font-semibold.text-cyan-300 {
  color: #0891b2 !important;
}

/* Form status messages */
.text-red-400 {
  color: #f87171;
}

html:not(.dark) .text-red-400 {
  color: #dc2626 !important;
}

html.dark .text-red-400 {
  color: #f87171;
}

/* Navigation hover colors for light mode */
html:not(.dark) a.hover\:text-indigo-300:hover {
  color: #4f46e5 !important;
}

/* ============================================
   Form Inputs - Light Mode
   ============================================ */
html:not(.dark) input[type="text"],
html:not(.dark) input[type="email"],
html:not(.dark) textarea {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #1e293b !important;
}

html:not(.dark) input[type="text"]::placeholder,
html:not(.dark) input[type="email"]::placeholder,
html:not(.dark) textarea::placeholder {
  color: #94a3b8 !important;
}

html:not(.dark) input[type="text"]:focus,
html:not(.dark) input[type="email"]:focus,
html:not(.dark) textarea:focus {
  background-color: rgba(255, 255, 255, 1) !important;
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

/* Checkbox for light mode */
html:not(.dark) input[type="checkbox"] {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
}

html:not(.dark) input[type="checkbox"]:checked {
  background-color: #6366f1 !important;
  border-color: #6366f1 !important;
}

/* Border colors for light mode */
html:not(.dark) .border-white\/10 {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html:not(.dark) .border-white\/20 {
  border-color: rgba(0, 0, 0, 0.15) !important;
}

/* Code preview backgrounds for light mode */
html:not(.dark) .bg-black\/30 {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) .bg-black\/40 {
  background-color: rgba(0, 0, 0, 0.08) !important;
}

html:not(.dark) pre code {
  color: #1e293b !important;
}

/* ============================================
   GitHub Section Styles
   ============================================ */
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  min-width: 80px;
  transition: background 0.3s ease;
}

html.dark .stat-item {
  background: rgba(99, 102, 241, 0.15);
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

html.dark .stat-value {
  color: #a5b4fc;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 1024px) {
  .repo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .repo-grid {
    grid-template-columns: 1fr;
  }
}

.repo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.repo-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.repo-card {
  position: relative;
}

.repo-card a {
  pointer-events: auto;
  z-index: 2;
  position: relative;
}

.repo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.repo-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}

html.dark .repo-name {
  color: #a5b4fc;
}

.repo-name:hover {
  color: #4f46e5;
  text-decoration: underline;
}

html.dark .repo-name:hover {
  color: #c7d2fe;
}

.repo-description {
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  opacity: 0.8;
}

.repo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}

.repo-language {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.language-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.repo-stats {
  display: flex;
  gap: 16px;
  color: var(--muted);
}

.repo-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.border-3 {
  border-width: 3px;
}

/* ============================================
   Responsive Design
   ============================================ */
/* Recent Activity Styles */
#recentActivity .card-hover {
  transition: all 0.2s ease;
}

#recentActivity .card-hover:hover {
  transform: translateX(4px);
  border-color: var(--accent);
}

/* Tech Stack Carousel */
#techStackCarousel {
  overflow: hidden;
  position: relative;
}

#techStackTrack {
  display: flex;
  will-change: transform;
}

#techStackPrev:disabled,
#techStackNext:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .stat-item {
    min-width: 70px;
    padding: 10px 16px;
  }
  
  .stat-value {
    font-size: 20px;
  }
  
  #techStackPrev {
    transform: translate(-2rem, -50%) !important;
    width: 8px;
    height: 8px;
  }
  
  #techStackNext {
    transform: translate(2rem, -50%) !important;
    width: 8px;
    height: 8px;
  }
}

/* ============================================
   Bingo Board Goal Tracker
   ============================================ */
/* Main title - larger */
.bingo-main-title {
  font-size: 1.75rem;
}

@media (min-width: 640px) {
  .bingo-main-title {
    font-size: 2rem;
  }
}

/* Layout: Preview 60-70% width, compact panels */
.bingo-goal-pool {
  border-bottom: 1px solid var(--border);
}

.bingo-settings-row .bingo-panel {
  padding: 0.75rem 1rem;
}

.bingo-preview-wrapper {
  width: 100%;
  max-width: 72%;
  margin-left: 0;
}

@media (max-width: 768px) {
  .bingo-preview-wrapper {
    max-width: 100%;
  }
}

/* Button hierarchy */
.bingo-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #2563eb, #059669);
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bingo-btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.bingo-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bingo-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.bingo-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
}

.bingo-btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bingo-btn-destructive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: 0.75rem;
  background: transparent;
  color: #f87171;
  border: 2px solid rgba(248, 113, 113, 0.6);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.bingo-btn-destructive:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: #f87171;
}

.bingo-btn-muted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: background 0.2s ease, color 0.2s ease;
}

.bingo-btn-muted:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* Sound/Music toggle - active state distinct */
.bingo-toggle[aria-pressed="true"] {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

html.dark .bingo-toggle[aria-pressed="true"] {
  color: #a5b4fc;
}

/* Goal pool textarea - line numbers via padding for readability */
.bingo-pool-textarea {
  font-family: inherit;
  line-height: 1.6;
}

/* Board grid - interactive tiles */
.bingo-preview-grid {
  display: grid;
  gap: 4px;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  margin: 0 auto;
}

.bingo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.bingo-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.bingo-tile.bingo-tile-free {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  font-weight: 600;
  color: var(--accent);
}

.bingo-tile.bingo-tile-completed {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--text);
}

.bingo-tile.bingo-tile-completed::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.875rem;
  font-weight: bold;
  color: #22c55e;
}

.bingo-tile {
  position: relative;
}

.bingo-tile.bingo-pattern {
  box-shadow: inset 0 0 0 2px #eab308;
  border-color: #eab308;
}

/* Helper text - smaller */
.bingo-helper,
.bingo-board-hint {
  font-size: 0.75rem;
}

/* Section dividers */
#bingo-board .border-t {
  border-color: var(--border);
}

/* Touch targets */
#bingo-board button,
#bingo-board .bingo-tile {
  min-height: 44px;
  min-width: 44px;
}

/* Light mode overrides for bingo */
html:not(.dark) .bingo-btn-destructive {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.6);
}

html:not(.dark) .bingo-btn-destructive:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: #dc2626;
}