/* ============================================
   BuckeyeCTF-Inspired Dark Theme
   Accent Color: #4553ef (Blue)
   Mobile-First Responsive Design
   ============================================ */

:root {
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: #111111;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --accent-primary: #4553ef;
  --accent-hover: #5a68ff;
  --border-color: #2a2a2a;
  --border-accent: #4553ef;
  --shadow: rgba(69, 83, 239, 0.3);
  --accent-glow: rgba(69, 83, 239, 0.5);
  --accent-bg: rgba(69, 83, 239, 0.1);

  /* Radius Variables */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-2xl: 15px;
  --radius-full: 50%;

  /* Shadow Variables */
  --shadow-sm: 0 0 10px var(--shadow);
  --shadow-md: 0 5px 20px var(--shadow);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px var(--shadow);
  --shadow-2xl: 0 20px 60px rgba(0, 0, 0, 0.8);
  --shadow-focus: 0 0 0 2px rgba(69, 83, 239, 0.2);
  --shadow-red: 0 0 15px rgba(239, 69, 69, 0.3);
  
  /* Responsive Typography - Fluid Sizes */
  --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --font-size-lg: clamp(1.125rem, 1rem + 0.625vw, 1.5rem);
  --font-size-xl: clamp(1.5rem, 1.25rem + 1.25vw, 2.5rem);
  --font-size-2xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --font-size-3xl: clamp(2.5rem, 2rem + 2.5vw, 4rem);
  
  /* Spacing Variables */
  --spacing-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
  --spacing-sm: clamp(0.5rem, 0.4rem + 0.5vw, 1rem);
  --spacing-md: clamp(1rem, 0.8rem + 1vw, 2rem);
  --spacing-lg: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  --spacing-xl: clamp(2rem, 1.5rem + 2.5vw, 4rem);
}

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

html {
  /* Prevent horizontal scroll */
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  /* Prevent text from being too small on mobile */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.modal-open {
  overflow: hidden;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   3D Wireframe Animation Background
   ============================================ */
#wireframe-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}

/* Reduce wireframe complexity on mobile for performance */
@media (max-width: 768px) {
  #wireframe-canvas {
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  #wireframe-canvas {
    display: none;
  }
}

/* ============================================
   Navigation Bar
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  z-index: 1000;
  position: relative;
}

.navbar-left {
  position: absolute;
  left: 2rem;
  display: flex;
  align-items: center;
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
}

.navbar-actions {
  position: absolute;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ============================================
   Mobile Hamburger Menu
   ============================================ */
.mobile-menu-toggle {
  display: none;
  position: absolute;
  left: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
}

.hamburger-line {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Dropdown Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mobile-menu.active {
  max-height: 500px;
  overflow-y: auto;
}

.mobile-menu-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-menu-nav li {
  border-bottom: 1px solid var(--border-color);
}

.mobile-menu-nav li:last-child {
  border-bottom: none;
}

.mobile-nav-link {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--font-size-base);
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background-color: rgba(69, 83, 239, 0.1);
  color: var(--accent-primary);
  padding-left: 2rem;
}

/* Hide mobile menu elements on desktop */
@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none !important;
  }
  
  .mobile-menu {
    display: none !important;
  }
}

/* ============================================
   Theme Toggle Button (Blue Team vs Red Team)
   ============================================ */
.theme-toggle-btn {
  background: transparent;
  border: none;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  width: 50px;
  height: 40px;
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn:hover {
  background: var(--accent-bg);
  box-shadow: var(--shadow-md);
}

.theme-icon {
  position: absolute;
  transition: all 0.3s ease;
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.theme-icon.active {
  opacity: 1;
  transform: scale(1);
}

/* Shield Icon (Blue Team) */
.shield-icon {
  stroke: #4553ef;
}

.shield-icon.active {
  stroke: #4553ef;
  filter: drop-shadow(0 0 8px rgba(69, 83, 239, 0.6));
}

/* Sword Icon (Red Team) */
.sword-icon {
  stroke: #ef4545;
}

.sword-icon.active {
  stroke: #ef4545;
  filter: drop-shadow(0 0 8px rgba(239, 69, 69, 0.6));
}

/* When red team is active */
.theme-toggle-btn.red-active:hover {
  background: rgba(239, 69, 69, 0.1);
  box-shadow: var(--shadow-red);
}

/* Animation when switching */
.theme-toggle-btn.switching {
  transform: rotate(360deg);
}

/* Icon positioning */
.theme-toggle-btn .shield-icon,
.theme-toggle-btn .sword-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.theme-toggle-btn .shield-icon.active,
.theme-toggle-btn .sword-icon.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}


.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.command-palette-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-family: inherit;
  width: 40px;
  height: 40px;
}

.command-palette-btn svg {
  transition: transform 0.3s ease;
}

.command-palette-btn:hover {
  color: var(--accent-primary);
  background: var(--accent-bg);
  box-shadow: var(--shadow-md);
}

.command-palette-btn:hover svg {
  transform: scale(1.1);
}

.kbd {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
}

/* ============================================
   Command Palette Modal
   ============================================ */
.command-palette-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.command-palette-modal.active {
  display: flex;
}

.command-palette-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}

.command-palette-container {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: var(--bg-secondary);
  border: 1px solid var(--text-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.command-palette-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
}

.command-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: inherit;
  outline: none;
}

.command-palette-input::placeholder {
  color: var(--text-secondary);
}

.command-palette-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  line-height: 1;
}

.command-palette-close:hover {
  color: var(--text-primary);
}

.command-palette-content {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.command-palette-content::-webkit-scrollbar {
  width: 8px;
}

.command-palette-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.command-palette-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}

.command-palette-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.command-palette-section {
  padding: 0.5rem 0;
}

.command-palette-section-title {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: bold;
  letter-spacing: 0.05em;
}

.command-palette-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.command-palette-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-primary);
  transform: scaleY(0);
  transition: transform 0.2s ease;
}

.command-palette-item:hover {
  background: var(--bg-card);
  padding-left: 1.5rem;
}

.command-palette-item:hover::before {
  transform: scaleY(1);
}

.command-palette-item.selected {
  background: var(--bg-card);
  border-left: 3px solid var(--accent-primary);
  padding-left: 1.5rem;
}

.command-icon {
  font-size: 1.2rem;
  margin-right: 0.75rem;
  min-width: 24px;
  text-align: center;
}

.command-palette-item span:last-child {
  flex: 1;
}

.result-badge {
  margin-left: auto;
  padding: 0.2rem 0.6rem;
  background: transparent;
  color: var(--accent-primary);
  font-size: 0.75rem;
  border-radius: var(--radius-xl);
  text-transform: uppercase;
  font-weight: bold;
}

.no-results {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

/* ============================================
   Mobile Simple Search Modal
   ============================================ */
.mobile-search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
}

.mobile-search-modal.active {
  display: flex;
}

.mobile-search-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
}

.mobile-search-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.mobile-search-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 2px solid var(--accent-primary);
  background: var(--bg-secondary);
}

.mobile-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: inherit;
  outline: none;
  padding: 0.5rem;
}

.mobile-search-input::placeholder {
  color: var(--text-secondary);
}

.mobile-search-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.mobile-search-close:hover {
  color: var(--accent-primary);
}

.mobile-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.mobile-search-hint {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem 1rem;
  font-style: italic;
}

.mobile-search-item {
  display: block;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 44px;
}

.mobile-search-item:hover,
.mobile-search-item:active {
  border-color: var(--accent-primary);
  background: rgba(69, 83, 239, 0.1);
}

.mobile-search-item-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.mobile-search-item-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Hide/show search buttons based on screen size */
.mobile-search-btn {
  display: none;
}

@media (max-width: 768px) {
  .desktop-search {
    display: none;
  }
  
  .mobile-search-btn {
    display: flex;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
  }
  
  .mobile-search-btn:hover {
    color: var(--accent-primary);
    background: var(--accent-bg);
  }
}

/* ============================================
   Main Content Container
   ============================================ */
.main-content {
  margin-top: 80px;
  padding: var(--spacing-md);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

/* Page Container for Centered Content */
.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--spacing-md) var(--spacing-sm);
  line-height: 1.8;
  color: var(--text-primary);
}

.page-content h2,
.page-content h3,
.page-content h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.page-content h2 {
  font-size: var(--font-size-xl);
  border-bottom: 2px solid var(--accent-primary);
  padding-bottom: 0.5rem;
}

.page-content h3 {
  font-size: var(--font-size-lg);
}

.page-content h4 {
  font-size: var(--font-size-base);
}

.page-content p {
  margin-bottom: 1.5rem;
  font-size: var(--font-size-base);
}

.page-content a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
  /* Ensure links are touchable on mobile */
  display: inline-block;
  min-height: 24px;
}

.page-content a:hover {
  border-bottom-color: var(--accent-primary);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.hero-logo {
  width: clamp(120px, 30vw, 220px);
  height: auto;
  object-fit: contain;
  margin-bottom: var(--spacing-md);
  border-radius: var(--radius-full);
  border: 3px solid var(--accent-primary);
  box-shadow: var(--shadow-sm);
  animation: float 3s ease-in-out infinite;
  will-change: transform;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-title {
  font-size: var(--font-size-3xl);
  font-weight: bold;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px var(--accent-glow);
  animation: glitch 3s infinite;
  position: relative;
  will-change: transform;
}

.hero-title::before,
.hero-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title::before {
  animation: glitch-1 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.hero-title::after {
  animation: glitch-2 2s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch {
  0%, 100% {
    transform: translate(0);
  }
  33% {
    transform: translate(-2px, 2px);
  }
  66% {
    transform: translate(2px, -2px);
  }
}

@keyframes glitch-1 {
  0%, 100% {
    transform: translate(0);
    opacity: 1;
  }
  33% {
    transform: translate(-4px, 0);
    opacity: 0.8;
  }
  66% {
    transform: translate(4px, 0);
    opacity: 0.9;
  }
}

@keyframes glitch-2 {
  0%, 100% {
    transform: translate(0);
    opacity: 1;
  }
  33% {
    transform: translate(3px, 0);
    opacity: 0.9;
  }
  66% {
    transform: translate(-3px, 0);
    opacity: 0.8;
  }
}

.hero-tagline {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.hero-description {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

/* Hero Split Layout - Logo + Typing Code */
.hero-split-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 0 var(--spacing-md);
}

.hero-logo-section {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-logo-section .hero-logo {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin-bottom: 0;
}

.hero-code-section {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 506.29px;
  min-width: 506.29px;
  max-width: 506.29px;
}

.typing-code {
  background: rgba(10, 10, 10, 0.95);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 2rem;
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
  font-size: clamp(0.85rem, 1vw, 1rem);
  line-height: 1.6;
  color: var(--text-primary);
  text-align: left;
  /* Fixed dimensions - calculated for 11 lines of code */
  height: 320px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.typing-code::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  animation: scanline 2s linear infinite;
}

@keyframes scanline {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.typing-code code {
  display: block;
  white-space: pre;
  color: var(--text-primary);
  min-height: 100%;
  width: 100%;
}

/* Syntax highlighting for typing code */
.typing-code .keyword { color: #c586c0; }
.typing-code .function { color: #dcdcaa; }
.typing-code .string { color: #ce9178; }
.typing-code .property { color: #9cdcfe; }
.typing-code .class-name { color: #4ec9b0; }

/* Mobile: Hide logo, show only code */
@media (max-width: 768px) {
  .hero-split-container {
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .hero-logo-section {
    display: none;
  }
  
  .hero-code-section {
    width: 100%;
  }
  
  .typing-code {
    padding: 1.5rem;
    font-size: 0.8rem;
    height: 280px;
  }
}

/* ============================================
   Cards & Containers
   ============================================ */
.card {
  background: rgba(10, 10, 10, 0.95);
  border: 0;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  /* Optimize for touch */
  -webkit-tap-highlight-color: rgba(69, 83, 239, 0.2);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-primary);
  transform: translateX(-3px);
  transition: transform 0.3s ease;
  will-change: transform;
}

.card:hover,
.card:active {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card:hover::before,
.card:active::before {
  transform: translateX(0);
}

/* ============================================
   Project Cards
   ============================================ */
.project-card {
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(69, 83, 239, 0.3);
  border-color: var(--accent-primary);
}

.project-card:active {
  transform: translateY(-2px);
}

.project-card:hover .card-title svg {
  transform: translate(2px, -2px);
}

.tech-tag {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  font-weight: 500;
}

.project-card:hover .tech-tag {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

.project-image {
  position: relative;
  overflow: hidden;
}

.project-image img {
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

/* Category Tags */
.category-tag {
  background: rgba(69, 83, 239, 0.1);
  color: var(--accent-primary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  border: 1px solid rgba(69, 83, 239, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
  font-weight: 500;
  white-space: nowrap;
}

.project-card:hover .category-tag {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
  /* Ensure clickable area is large enough for touch */
  display: inline-block;
  min-height: 44px;
  line-height: 1.4;
}

.card-title a:hover,
.card-title a:active {
  color: var(--accent-primary);
}

.card-meta {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--font-size-sm);
}

.card-tags-top {
  margin-top: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.card-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: var(--font-size-base);
}

/* ============================================
   Tags & Categories
   ============================================ */

/* ============================================
   Post Content
   ============================================ */
.blog-post {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--spacing-md) var(--spacing-sm);
}

/* Minimalist Post Container */
.post-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

/* Glassmorphism Container - DEPRECATED, keeping for backward compatibility */
.post-glass-container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--spacing-md);
}

.post-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--border-color);
  text-align: center;
}

.post-title {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
  line-height: 1.2;
}

.post-meta-date {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: 1rem;
}

.post-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.post-content {
  line-height: 1.8;
  color: var(--text-primary);
  text-align: justify;
  font-size: 1.05rem;
}

.post-content p {
  margin-bottom: 1.5rem;
  text-align: justify;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: bold;
}

.post-content h2 {
  border-bottom: 2px solid var(--accent-primary);
  padding-bottom: 0.5rem;
}

.post-content a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.post-content a:hover {
  border-bottom-color: var(--accent-primary);
}

.post-content code {
  background: transparent;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
  color: var(--accent-primary);
  font-size: 0.85em;
  border: none;
}

.post-content pre {
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 2rem 0;
  box-shadow: var(--shadow-lg);
}

.post-content pre code {
  background: transparent;
  padding: 0;
  color: var(--text-primary);
  border: none;
  display: block;
  line-height: 1.6;
  font-size: 0.95rem;
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
  white-space: pre;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: var(--text-secondary);
  font-style: italic;
  background: rgba(30, 30, 30, 0.5);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 2rem auto;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
}

.post-content img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent-primary);
}

.post-content ul,
.post-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.post-content li {
  margin: 0.5rem 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: rgba(17, 17, 17, 0.5);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.post-content th,
.post-content td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  text-align: left;
}

.post-content th {
  background: rgba(30, 30, 30, 0.8);
  color: var(--accent-primary);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.post-content td {
  background: rgba(17, 17, 17, 0.3);
}

.post-content tr:hover td {
  background: rgba(30, 30, 30, 0.5);
}

/* Ensure code blocks don't get table styling */
.post-content table code,
.post-content table pre {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.post-content table pre {
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

/* Post Footer Navigation */
.post-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.post-nav-link {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.post-nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-primary);
  transform: translateX(-3px);
  transition: transform 0.3s ease;
}

.post-nav-link:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-nav-link:hover::before {
  transform: translateX(0);
}

.post-nav-link.next-post {
  text-align: right;
}

.nav-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.nav-title {
  color: var(--text-primary);
  font-weight: bold;
  font-size: 1.1rem;
}

/* Related Posts Section */
.related-posts-section {
  margin-top: 4rem;
  padding: 0 1rem;
}

.section-title {
  color: var(--accent-primary);
  font-size: 1.8rem;
  margin-bottom: 2rem;
  text-align: center;
  border-bottom: 2px solid var(--accent-primary);
  padding-bottom: 0.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive adjustments for blog posts */
@media (max-width: 768px) {
  .blog-post {
    padding: 1rem 0.5rem;
  }

  .post-glass-container {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
  }

  .post-title {
    font-size: 2rem;
  }

  .post-content {
    font-size: 1rem;
  }

  .post-content pre {
    padding: 1rem;
    font-size: 0.85rem;
  }

  .post-content img {
    margin: 1.5rem 0;
  }

  .post-navigation {
    flex-direction: column;
  }

  .post-nav-link.next-post {
    text-align: left;
  }
}

/* ============================================
   Tags & Categories
   ============================================ */
.tag,
.category {
  display: inline-block;
  background: var(--bg-card);
  color: var(--accent-primary);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-2xl);
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

.tag:hover,
.category:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.tag-more {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: default;
  font-weight: bold;
}

.tag-more:hover {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  box-shadow: none;
}

/* ============================================
   Archive List
   ============================================ */
.archive-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.archive-list {
  list-style: none;
}

.archive-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.archive-item:last-child {
  border-bottom: none;
}

.archive-date {
  color: var(--accent-primary);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  font-weight: bold;
}

.archive-title {
  font-size: 1.2rem;
}

.archive-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.archive-title a:hover {
  color: var(--accent-primary);
}

/* ============================================
   Grid Layout for Posts/Projects
   ============================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* ============================================
   Full-Width Research Layout
   ============================================ */
.research-full-width {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.research-full-width .card {
  width: 100%;
}

/* ============================================
   Tags Grid Layout
   ============================================ */
.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .tags-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .tags-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

/* ============================================
   Home Posts Grid Layout
   ============================================ */
.home-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .home-posts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .home-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* ============================================
   Footer
   ============================================ */
.footer {
  margin-top: 4rem;
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.footer a {
  color: var(--accent-primary);
  text-decoration: none;
  /* Ensure touchable on mobile */
  display: inline-block;
  min-height: 24px;
  padding: 0.25rem 0;
}

.footer a:hover,
.footer a:active {
  text-decoration: underline;
}

/* ============================================
   COMPREHENSIVE RESPONSIVE DESIGN
   Mobile-First Approach with Progressive Enhancement
   ============================================ */

/* ========== Mobile Small (320px - 374px) ========== */
@media (max-width: 374px) {
  :root {
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
  }

  .navbar {
    padding: 0 0.5rem;
  }

  .navbar-left {
    left: 0.5rem;
  }

  .navbar-actions {
    right: 0.5rem;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .navbar-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .hero-logo {
    width: 100px;
  }

  .main-content {
    margin-top: 70px;
    padding: 1rem 0.5rem;
  }

  .card {
    padding: 1rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .command-palette-btn span {
    display: none;
  }
}

/* ========== Mobile Standard (375px - 428px) - iPhone/Android ========== */
@media (min-width: 375px) and (max-width: 428px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .navbar-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .post-content pre {
    font-size: 0.8rem;
    padding: 1rem;
  }
}

/* ========== Phablets (429px - 575px) ========== */
@media (min-width: 429px) and (max-width: 575px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .navbar-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ========== Mobile Large / Small Tablets (576px - 768px) ========== */
@media (min-width: 576px) and (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .navbar-nav {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .navbar {
    padding: 0 1.5rem;
  }

  .navbar-left {
    left: 1.5rem;
  }

  .navbar-actions {
    right: 1.5rem;
  }

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

  .main-content {
    padding: 1.5rem;
  }

  .hero {
    padding: 2rem 1.5rem;
  }
}

/* ========== Tablets (769px - 1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
  .navbar-nav {
    gap: 1.5rem;
    font-size: 0.9rem;
  }

  .navbar {
    padding: 0 1.5rem;
  }

  .navbar-left {
    left: 1.5rem;
  }

  .navbar-actions {
    right: 1.5rem;
  }

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

  .hero {
    padding: 3rem 2rem;
  }

  .main-content {
    padding: 1.75rem;
  }
}

/* ========== Large Tablets / Small Laptops (1025px - 1199px) ========== */
@media (min-width: 1025px) and (max-width: 1199px) {
  .navbar-nav {
    gap: 1.75rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* ========== Desktop (1200px+) ========== */
@media (min-width: 1200px) {
  .navbar-nav {
    gap: 2rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }

  .main-content {
    padding: 2rem;
  }
}

/* ========== Touch Device Optimizations ========== */
@media (hover: none) and (pointer: coarse) {
  /* This targets touch devices */
  .nav-link,
  .mobile-nav-link,
  .card-title a,
  .command-palette-btn,
  .mobile-search-btn,
  .theme-toggle-btn,
  .filter-btn,
  button,
  a {
    /* Ensure all interactive elements are easy to tap */
    min-height: 44px;
    min-width: 44px;
  }

  /* Disable hover effects on touch devices */
  .card:hover {
    transform: none;
  }

  /* Use active state instead */
  .card:active {
    transform: translateY(-2px);
  }
}

/* ========== Landscape Orientation Adjustments ========== */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: 1.5rem 2rem;
  }

  .hero-logo {
    width: clamp(80px, 20vw, 150px);
  }

  .mobile-menu.active {
    max-height: 300px;
  }

  .navbar {
    height: 50px;
  }

  .main-content {
    margin-top: 60px;
  }
}

/* ============================================
   Accent Color Highlights
   ============================================ */
.accent {
  color: var(--accent-primary);
}

.accent-bg {
  background-color: var(--accent-primary) !important;
  color: var(--text-primary) !important;
  font-weight: bold !important;
}

/* ============================================
   Loading Animation
   ============================================ */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s infinite;
}

/* ============================================
   Syntax Highlighting for Code Blocks
   ============================================ */
.highlight {
  background: rgba(10, 10, 10, 0.95);
  border-radius: var(--radius-md);
  margin: 2rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  padding: 1.5rem;
}

.highlight pre {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
}

.highlight code {
  background: transparent;
  padding: 0;
  color: inherit;
  border: none;
  font-size: 1em;
  font-family: 'Courier New', 'Monaco', 'Consolas', monospace;
  display: block;
  white-space: pre;
}

/* Syntax colors */
.highlight .c { color: #6a9955; } /* Comment */
.highlight .err { color: #f48771; } /* Error */
.highlight .k { color: #c586c0; } /* Keyword */
.highlight .o { color: #d4d4d4; } /* Operator */
.highlight .cm { color: #6a9955; } /* Comment.Multiline */
.highlight .cp { color: #9cdcfe; } /* Comment.Preproc */
.highlight .c1 { color: #6a9955; } /* Comment.Single */
.highlight .cs { color: #6a9955; } /* Comment.Special */
.highlight .gd { color: #f48771; } /* Generic.Deleted */
.highlight .ge { font-style: italic; } /* Generic.Emph */
.highlight .gh { color: #4ec9b0; font-weight: bold; } /* Generic.Heading */
.highlight .gi { color: #b5cea8; } /* Generic.Inserted */
.highlight .gp { color: #6a9955; } /* Generic.Prompt */
.highlight .gs { font-weight: bold; } /* Generic.Strong */
.highlight .gu { color: #9cdcfe; font-weight: bold; } /* Generic.Subheading */
.highlight .kc { color: #569cd6; } /* Keyword.Constant */
.highlight .kd { color: #569cd6; } /* Keyword.Declaration */
.highlight .kn { color: #c586c0; } /* Keyword.Namespace */
.highlight .kp { color: #569cd6; } /* Keyword.Pseudo */
.highlight .kr { color: #569cd6; } /* Keyword.Reserved */
.highlight .kt { color: #4ec9b0; } /* Keyword.Type */
.highlight .m { color: #b5cea8; } /* Literal.Number */
.highlight .s { color: #ce9178; } /* Literal.String */
.highlight .na { color: #9cdcfe; } /* Name.Attribute */
.highlight .nb { color: #dcdcaa; } /* Name.Builtin */
.highlight .nc { color: #4ec9b0; } /* Name.Class */
.highlight .no { color: #4ec9b0; } /* Name.Constant */
.highlight .nd { color: #dcdcaa; } /* Name.Decorator */
.highlight .ni { color: #dcdcaa; } /* Name.Entity */
.highlight .ne { color: #4ec9b0; } /* Name.Exception */
.highlight .nf { color: #dcdcaa; } /* Name.Function */
.highlight .nl { color: #9cdcfe; } /* Name.Label */
.highlight .nn { color: #4ec9b0; } /* Name.Namespace */
.highlight .nt { color: #569cd6; } /* Name.Tag */
.highlight .nv { color: #9cdcfe; } /* Name.Variable */
.highlight .ow { color: #569cd6; } /* Operator.Word */
.highlight .w { color: #d4d4d4; } /* Text.Whitespace */
.highlight .mf { color: #b5cea8; } /* Literal.Number.Float */
.highlight .mh { color: #b5cea8; } /* Literal.Number.Hex */
.highlight .mi { color: #b5cea8; } /* Literal.Number.Integer */
.highlight .mo { color: #b5cea8; } /* Literal.Number.Oct */
.highlight .sb { color: #ce9178; } /* Literal.String.Backtick */
.highlight .sc { color: #ce9178; } /* Literal.String.Char */
.highlight .sd { color: #6a9955; } /* Literal.String.Doc */
.highlight .s2 { color: #ce9178; } /* Literal.String.Double */
.highlight .se { color: #d7ba7d; } /* Literal.String.Escape */
.highlight .sh { color: #ce9178; } /* Literal.String.Heredoc */
.highlight .si { color: #ce9178; } /* Literal.String.Interpol */
.highlight .sx { color: #ce9178; } /* Literal.String.Other */
.highlight .sr { color: #d16969; } /* Literal.String.Regex */
.highlight .s1 { color: #ce9178; } /* Literal.String.Single */
.highlight .ss { color: #ce9178; } /* Literal.String.Symbol */
.highlight .bp { color: #9cdcfe; } /* Name.Builtin.Pseudo */
.highlight .vc { color: #9cdcfe; } /* Name.Variable.Class */
.highlight .vg { color: #9cdcfe; } /* Name.Variable.Global */
.highlight .vi { color: #9cdcfe; } /* Name.Variable.Instance */
.highlight .il { color: #b5cea8; } /* Literal.Number.Integer.Long */

/* Line numbers in code blocks */
.highlight .lineno {
  display: none;
}

.highlight table {
  display: block;
  width: 100%;
  border-collapse: collapse;
}

.highlight table tbody {
  display: block;
}

.highlight table tr {
  display: block;
}

.highlight table td {
  display: inline;
  padding: 0;
  border: none;
  background: transparent;
}

/* ============================================
   Filter System Styling
   ============================================ */
.filter-controls {
  margin-bottom: 2rem;
  padding: 2rem;
  background: rgba(17, 17, 17, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.filter-search {
  margin-bottom: 1.5rem;
}

.filter-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-focus);
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: bold;
  font-size: 0.95rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  background: rgba(40, 40, 40, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}

.filter-btn-active {
  background: var(--accent-primary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  font-weight: bold;
}

.filter-btn-active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.no-results-message {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  background: rgba(17, 17, 17, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  margin-top: 2rem;
}

/* Responsive filter buttons */
@media (max-width: 768px) {
  .filter-controls {
    padding: 1.5rem;
  }

  .filter-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .filter-buttons {
    gap: 0.3rem;
  }
}

@media (max-width: 480px) {
  .filter-controls {
    padding: 1rem;
  }

  .filter-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .filter-buttons {
    gap: 0.25rem;
  }
}

/* ============================================
   Gallery Page Styles
   ============================================ */

/* Gallery Hero Section */
.gallery-hero {
  text-align: center;
  padding: 3rem 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.gallery-hero h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.gallery-hero p {
  font-size: var(--font-size-base);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Gallery Filters */
.gallery-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.gallery-filters .filter-btn {
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all 0.3s ease;
  text-transform: capitalize;
}

.gallery-filters .filter-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.gallery-filters .filter-btn.active {
  background: var(--accent-primary);
  color: #000000;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

/* Gallery Grid - Masonry Layout */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-flow: dense;
  gap: 1.25rem;
  padding: 0 1rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Gallery Item */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: scale(1);
}

.gallery-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

/* Gallery Image */
.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-image {
  transform: scale(1.08);
}

/* Gallery Overlay */
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.7) 50%,
    transparent 100%
  );
  padding: 1.5rem 1rem 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: var(--text-primary);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.gallery-date {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 10000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.97);
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

#lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
}

#lightbox-caption {
  margin-top: 1rem;
  font-size: var(--font-size-lg);
  color: var(--text-primary);
  text-align: center;
  padding: 0 1rem;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2.5rem;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 10001;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.lightbox-close:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #000000;
  transform: rotate(90deg);
}

/* Empty State */
.gallery-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.gallery-empty h3 {
  font-size: var(--font-size-xl);
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.gallery-empty p {
  font-size: var(--font-size-base);
  line-height: 1.6;
}

/* Responsive Gallery Styles */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    padding: 2rem 1rem;
  }

  .gallery-hero h1 {
    font-size: var(--font-size-xl);
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
    padding: 0 0.75rem 2rem;
  }

  .gallery-filters {
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .gallery-filters .filter-btn {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-xs);
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 2rem;
  }

  #lightbox-caption {
    font-size: var(--font-size-base);
  }
}

@media (max-width: 480px) {
  .gallery-hero {
    padding: 1.5rem 0.75rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0 0.5rem 1.5rem;
  }

  .gallery-filters {
    gap: 0.4rem;
    margin-bottom: 1.5rem;
  }

  .gallery-filters .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  .gallery-overlay {
    padding: 1rem 0.75rem 0.75rem;
  }

  .gallery-title {
    font-size: var(--font-size-sm);
  }

  .lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
    width: 35px;
    height: 35px;
    font-size: 1.75rem;
  }
}
