/* Google Search Design System - High Fidelity */
:root {
  /* Light Mode (Default) */
  --bg-color: #ffffff;
  --header-bg: #ffffff;
  --search-bar-bg: #ffffff;
  --text-primary: #202124;
  --text-secondary: #70757a;
  --text-link: #1a0dab;
  --border-color: #dadce0;
  --card-bg: #ffffff;
  --card-border: #dfe1e5;
  --tab-active: #1a73e8;
  --tab-hover: #e8f0fe;
  --hover-bg: rgba(60, 64, 67, 0.08);
  --footer-bg: #f2f2f2;
  --header-height: 120px;
  --max-content-width: 1100px;
  --google-radius: 28px;
  --google-radius-md: 20px;
  --google-radius-sm: 12px;
  --highlight-blue: #d3e3fd;
  --highlight-border: #c2d7f7;
}

body.dark-mode {
  /* Dark Mode Tokens */
  --bg-color: #202124;
  --header-bg: #202124;
  --search-bar-bg: #303134;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-link: #8ab4f8;
  --border-color: #3c4043;
  --card-bg: #303134;
  --card-border: #3c4043;
  --tab-active: #8ab4f8;
  --tab-hover: #3c4043;
  --hover-bg: rgba(232, 234, 237, 0.08);
  --footer-bg: #171717;
  --highlight-blue: #3c4043;
  --highlight-border: #5f6368;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: Arial, sans-serif;
  line-height: 1.5;
  font-size: 14px;
  transition: transform 0.5s ease, background-color 0.5s ease, color 0.5s ease;
}

body.askew-mode {
  transform: rotate(1deg);
}

/* Icon Colors (Standard Google Palette) */
.icon-blue { color: #4285F4 !important; }
.icon-red { color: #EA4335 !important; }
.icon-green { color: #34A853 !important; }
.icon-yellow { color: #FBBC05 !important; }

/* Static Highlight Class (Used for Location/Degree) */
.card-blue {
  background-color: var(--highlight-blue) !important;
  border-color: var(--highlight-border) !important;
}

/* Centralized Container Utility */
.google-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

#themeToggle {
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#themeToggle:active {
  transform: scale(0.8);
}

#theme-reveal {
  position: fixed;
  z-index: 9999;
  width: 1px;
  height: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  top: 50%;
  left: 50%;
}

.reveal-icon {
  position: absolute;
  color: var(--text-primary);
  font-family: 'Material Icons Outlined';
  font-size: 24px;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes trueVortex {
  0% { 
    opacity: 0;
    transform: rotate(0deg) translateY(var(--start-dist-y)) translateX(var(--start-dist-x)) scale(1);
  }
  10% { opacity: 1; }
  35% {
    transform: rotate(60deg) translateY(-350px) translateX(0) scale(4);
  }
  100% {
    opacity: 1;
    transform: rotate(360deg) translateY(0) translateX(0) scale(15);
  }
}

.reveal-active .reveal-icon {
  animation: trueVortex 1.5s cubic-bezier(0.15, 0, 0.15, 1) forwards;
}

.reveal-fade-out {
  opacity: 0 !important;
  transition: opacity 0.5s ease !important;
}

.reveal-fade-out {
  opacity: 0 !important;
  transition: opacity 0.5s ease !important;
}

.theme-icon-rotate {
  animation: rotateIcon 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rotateIcon {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(0.5); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Search Eggs */
.result-stats {
  color: var(--text-secondary);
  font-size: 14px;
  padding-bottom: 4px;
}

.did-you-mean {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.did-you-mean a {
  color: #d93025; /* Classic Google correction red */
  text-decoration: none;
  font-style: italic;
  font-weight: bold;
}

.did-you-mean a:hover {
  text-decoration: underline;
}

/* Header & Search Bar */
header {
  position: sticky;
  top: 0;
  background-color: var(--header-bg);
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.top-bar {
  display: flex;
  align-items: center;
  padding: 20px 0;
}

.logo {
  font-family: 'Product Sans', Arial, sans-serif;
  font-size: 24px;
  font-weight: bold;
  margin-right: 40px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo span:nth-child(1) { color: #4285F4; } /* S - Blue */
.logo span:nth-child(2) { color: #EA4335; } /* h - Red */
.logo span:nth-child(3) { color: #FBBC05; } /* u - Yellow */
.logo span:nth-child(4) { color: #4285F4; } /* h - Blue */
.logo span:nth-child(5) { color: #34A853; } /* a - Green */
.logo span:nth-child(6) { color: #EA4335; } /* i - Red */
/* l, n - No specific color (defaults to text color) */


.search-container {

  flex: 1;
  max-width: 690px;
  position: relative;
}

.search-bar {
  width: 100%;
  padding: 12px 20px;
  padding-left: 45px;
  border-radius: var(--google-radius);
  border: 1px solid var(--border-color);
  background-color: var(--search-bar-bg);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  flex-shrink: 0;
}

.theme-toggle, .apps-icon, .profile-icon {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-icon {
  width: 36px;
  height: 36px;
  background-color: #8ab4f8;
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
}

/* Nav Tabs */
.nav-tabs-wrapper {
  border-bottom: 1px solid var(--border-color);
}

.nav-tabs {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.nav-tab {
  padding: 10px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.nav-tab.active {
  color: var(--tab-active);
  border-bottom-color: var(--tab-active);
}

/* Entity Header Section */
.entity-container {
  padding: 20px 0;
}

.entity-header {
  margin-bottom: 24px;
}

.entity-name {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.entity-name h1 {
  font-size: 32px;
  font-weight: 400;
}

.entity-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-top: 4px;
}

/* Main Layout Grid */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 40px;
}

/* Left Column */
.main-column {
  width: 100%;
}

.image-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 200px 200px;
  gap: 8px;
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: var(--google-radius-md);
  border: 1px solid var(--border-color);
}

.img-large {
  grid-row: span 2;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.img-small {
  background: var(--card-bg);
  border-left: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.img-top-right { border-bottom: 1px solid var(--border-color); }

.card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.info-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--google-radius-md);
  padding: 16px;
  transition: box-shadow 0.2s, background-color 0.2s, border-color 0.2s;
}

.info-card:hover {
  box-shadow: 0 1px 6px rgba(32,33,36,0.28);
  background-color: var(--highlight-blue);
  border-color: var(--highlight-border);
}

.bullet-list {
  margin-top: 10px;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

.bullet-list li {
  margin-bottom: 6px;
}

.card-label {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-value {
  font-size: 18px;
}

.card-subvalue {
  color: var(--text-secondary);
  font-size: 12px;
}

/* Section Styling */
.content-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 16px;
}

/* Sidebar Knowledge Panel */
.side-panel {
  width: 370px;
  position: sticky;
  top: 140px;
  height: fit-content;
}

.kp-card {
  border: 1px solid var(--border-color);
  border-radius: var(--google-radius-md);
  overflow: hidden;
}

.kp-section {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.kp-section:last-child { border-bottom: none; }

.kp-row {
  display: flex;
  margin-bottom: 8px;
}

.kp-label {
  width: 100px;
  flex-shrink: 0;
  color: var(--text-primary);
  font-weight: bold;
}

.kp-value {
  color: var(--text-primary);
}

.kp-value a {
  color: var(--text-link);
  text-decoration: none;
}

.kp-value a:hover { text-decoration: underline; }

/* Desktop-Only Sidebar Extensions */
.sidebar-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.related-entity {
  text-align: center;
}

.related-entity-icon {
  width: 40px;
  height: 40px;
  background-color: var(--tab-hover);
  border-radius: 50%;
  margin: 0 auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.related-entity-name {
  font-size: 10px;
  color: var(--text-primary);
}

.related-searches-list {
  list-style: none;
  margin-top: 12px;
}

.related-search-link {
  display: block;
  color: var(--text-link);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 8px;
}

.related-search-link:hover { text-decoration: underline; }

.desktop-only { display: block; }

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--google-radius-sm);
  font-size: 13px;
  transition: background 0.2s;
}

.skill-item:hover {
  background-color: var(--highlight-blue);
}

/* Certifications Section */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--google-radius);
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s;
}

.cert-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background-color: var(--highlight-blue);
  border-color: var(--highlight-border);
}

.cert-icon {
  font-size: 32px;
  color: var(--tab-active);
}

/* Responsiveness */
@media (max-width: 1000px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .side-panel {
    width: 100%;
    position: static;
    order: -1;
  }
  .desktop-only { display: none !important; }
}

/* Footer Styling */
.footer {
  background-color: var(--footer-bg);
  border-top: 1px solid var(--border-color);
  margin-top: 100px;
  color: var(--text-secondary);
  font-size: 14px;
  width: 100%;
}

.footer-row {
  padding: 15px 0;
}

.footer-location {
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
}

.location-dot {
  width: 10px;
  height: 10px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  margin: 0 12px;
  display: inline-block;
}

.footer-links-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links-left, .footer-links-right {
  display: flex;
  gap: 25px;
  align-items: center;
}

.footer-links-left a, .footer-links-right a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links-left a:hover, .footer-links-right a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Easter Egg Animations */
@keyframes barrelRoll {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.do-barrel-roll {
  animation: barrelRoll 1s ease;
}

@keyframes neonGlow {
  0%, 100% { text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px var(--icon-blue), 0 0 20px var(--icon-blue); }
  50% { text-shadow: 0 0 2px #fff, 0 0 5px #fff, 0 0 7px var(--icon-blue), 0 0 10px var(--icon-blue); opacity: 0.8; }
}

body.dark-mode #googleLogo:hover span {
  animation: neonGlow 1.5s infinite;
}

@keyframes blinkText {
  50% { opacity: 0; }
}
.blink-egg {
  animation: blinkText 0.8s step-start infinite;
}

@keyframes sonicRace {
  0% { transform: translateX(-100vw) skewX(-20deg); }
  100% { transform: translateX(100vw) skewX(-20deg); }
}
.sonic-blur {
  position: fixed;
  top: 50%;
  left: 0;
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, transparent, #1a73e8, #8ab4f8);
  box-shadow: 0 0 10px #1a73e8;
  z-index: 10000;
  pointer-events: none;
  animation: sonicRace 0.5s linear forwards;
}

@keyframes snapAway {
  0% { transform: scale(1); opacity: 1; filter: blur(0); }
  100% { transform: scale(1.1) translateY(-20px); opacity: 0; filter: blur(10px) grayscale(1); }
}
.snapped {
  animation: snapAway 1.5s forwards;
  pointer-events: none;
}

@keyframes dashWalk {
  0% { left: -100px; transform: scaleX(1); }
  45% { transform: scaleX(1); }
  50% { transform: scaleX(-1); }
  95% { transform: scaleX(-1); }
  100% { left: -100px; transform: scaleX(1); }
  10% { top: 40%; }
  30% { top: 60%; }
  70% { top: 40%; }
}
@keyframes shakeIcon {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
}
.shake-icon {
  animation: shakeIcon 0.3s ease-in-out;
}

.flutter-dash {
  position: fixed;
  z-index: 10001;
  font-size: 40px;
  pointer-events: none;
  left: -500px;
}


/* Responsive Utility Flags */
.mobile-only { display: none !important; }
.desktop-only { display: block !important; }

@media (max-width: 600px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }

  /* Logo -> Circle SN for Mobile */
  .logo span { display: none; }
  .logo::after {
    content: 'SN';
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #8ab4f8;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
  }

  .apps-icon, .profile-icon { display: none !important; }

  /* Universal Fluid Widths */
  .google-container {
    padding: 0 12px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box;
  }

  .entity-container, .content-grid, .main-column, .side-panel {
    width: 100% !important;
    margin: 0 !important;
    display: block !important;
  }

  /* Fix Knowledge Panel (Side Panel) on Mobile */
  .kp-card {
    width: 100% !important;
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 20px;
  }

  .kp-row {
    flex-direction: column !important;
    gap: 4px;
    margin-bottom: 12px;
  }

  .kp-label { width: 100% !important; }
  .kp-value { width: 100% !important; }

  /* Section Reordering */
  #overview {
    display: flex;
    flex-direction: column;
  }
  .card-row {
    order: 1;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }
  .github-integration {
    order: 2;
    width: 100%;
  }
  #overview > .content-section {
    order: 3;
  }

  /* GitHub Specific Fixes */
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  .github-body {
    padding: 12px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .contribution-grid {
    transform-origin: left top;
  }

  /* Footer Links */
  .footer-links-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .footer-links-left, .footer-links-right {
    gap: 15px;
    flex-wrap: wrap;
  }
}



/* Header Adjustments for Mobile */
@media (max-width: 600px) {
  .top-bar {
    padding: 10px 0;
    gap: 10px;
  }
  .search-container {
    flex: 1;
  }
  .search-bar {
    padding: 8px 10px 8px 32px;
    font-size: 14px;
  }
  .search-icon {
    left: 10px;
    font-size: 18px;
  }
  .header-actions {
    gap: 8px;
  }
}



/* GitHub Integration Styles */
.github-integration {
  margin-bottom: 32px;
}

.github-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--google-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.github-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.github-icon {
  color: var(--tab-active);
  font-size: 20px;
}

.github-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-primary);
}

.github-username {
  color: var(--text-link);
  text-decoration: none;
  font-size: 13px;
}

.github-username:hover {
  text-decoration: underline;
}

.github-body {
  padding: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.github-body::-webkit-scrollbar {
  height: 4px;
}

.github-body::-webkit-scrollbar-track {
  background: transparent;
}

.github-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.contribution-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  grid-template-columns: repeat(53, 12px);
  gap: 3px;
  min-width: fit-content;
}

.grid-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background-color: var(--github-level-0);
  position: relative;
}

.grid-cell:hover {
  outline: 2px solid var(--text-secondary);
  z-index: 10;
}

/* Tooltip style for grid cells */
.grid-cell::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.grid-cell:hover::after {
  opacity: 1;
}

.github-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-cells {
  display: flex;
  gap: 3px;
}

/* GitHub Contribution Levels */
:root {
  --github-level-0: #ebedf0;
  --github-level-1: #9be9a8;
  --github-level-2: #40c463;
  --github-level-3: #30a14e;
  --github-level-4: #216e39;
}

body.dark-mode {
  --github-level-0: #161b22;
  --github-level-1: #0e4429;
  --github-level-2: #006d32;
  --github-level-3: #26a641;
  --github-level-4: #39d353;
}

.level-0 { background-color: var(--github-level-0); }
.level-1 { background-color: var(--github-level-1); }
.level-2 { background-color: var(--github-level-2); }
.level-3 { background-color: var(--github-level-3); }
.level-4 { background-color: var(--github-level-4); }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stats-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--google-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: var(--tab-active);
}

.stats-label {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stats-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-primary);
}

.stats-subtext {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Loading Shimmer */
.loading-placeholder {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shimmer-box {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--card-bg) 25%, var(--border-color) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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