/* Base CSS Reset and Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
  scroll-behavior: auto;
}

/* Respect reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: "Neue Helvetica", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  color: #222;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;
}

/* Visually hidden but accessible (sr-only) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Performance optimizations */
img, video, iframe {
  transform: translateZ(0);
  backface-visibility: hidden;
}

.relative, .absolute, .fixed {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Utility Classes - Converted from Tailwind */
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Text Utilities */
.text-white { color: white; }
.text-white\/80 { color: rgba(255, 255, 255, 0.8); }
.text-white\/60 { color: rgba(255, 255, 255, 0.6); }
.text-white\/40 { color: rgba(255, 255, 255, 0.4); }
.font-bold { font-weight: 700; }
.font-light { font-weight: 300; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.text-7xl { font-size: 4.5rem; line-height: 1; }
.text-8xl { font-size: 6rem; line-height: 1; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.leading-tight { line-height: 1.25; }
.tracking-tight { letter-spacing: -0.025em; }
.text-center { text-align: center; }
.underline { text-decoration: underline; }

/* Spacing */
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-16 { margin-top: 4rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-12 { padding-left: 3rem; padding-right: 3rem; }
.px-16 { padding-left: 4rem; padding-right: 4rem; }

/* Layout */
.max-w-6xl { max-width: 72rem; }
.w-56 { width: 14rem; }
.h-56 { height: 14rem; }
.w-64 { width: 16rem; }
.h-64 { height: 16rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.rounded-full { border-radius: 9999px; }
.rounded-2xl { border-radius: 1rem; }
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.object-cover { object-fit: cover; }

/* Borders */
.border-2 { border-width: 2px; }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }

/* Shadows */
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-70 { opacity: 0.7; }

/* Z-index */
.z-\[1\] { z-index: 1; }

/* Transitions */
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; }

/* Hover states */
.hover\:text-white:hover { color: white; }

/* Responsive */
@media (min-width: 768px) {
  .md\:px-12 { padding-left: 3rem; padding-right: 3rem; }
  .md\:px-16 { padding-left: 4rem; padding-right: 4rem; }
  .md\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
  .md\:mb-20 { margin-bottom: 5rem; }
  .md\:flex { display: flex; }
  .md\:flex-row { flex-direction: row; }
  .md\:flex-col { flex-direction: column; }
  .md\:items-center { align-items: center; }
  .md\:text-left { text-align: left; }
  .md\:text-center { text-align: center; }
  .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
  .md\:text-7xl { font-size: 4.5rem; line-height: 1; }
  .md\:w-64 { width: 16rem; }
  .md\:h-64 { height: 16rem; }
  .md\:justify-start { justify-content: flex-start; }
}

@media (min-width: 1024px) {
  .lg\:px-16 { padding-left: 4rem; padding-right: 4rem; }
  .lg\:text-8xl { font-size: 6rem; line-height: 1; }
}

/* Animation Classes */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.fade-in.visible {
  opacity: 1;
}

/* Profile Photo Hover */
.profile-photo {
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.profile-photo:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 25px 50px -12px rgba(255, 255, 255, 0.25);
}

/* Social Icons */
.social-icon {
  transition: transform 0.5s ease, color 0.5s ease;
}

.social-icon:hover {
  transform: scale(1.15) translateY(-3px);
  color: white;
}

.social-icon:active {
  transform: scale(0.95);
}

/* Section Styles */
.section {
  position: relative;
  padding: 3rem 1rem;
}

@media (min-width: 768px) {
  .section {
    padding: 4rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: 5rem 2rem;
  }
}

/* Glass morphism effect */
.glass-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.glass-card-md {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Glass Button Styles */
.glass-button-wrap {
  position: relative;
  isolation: isolate;
  cursor: pointer;
  border-radius: 9999px;
  transition: all 0.3s ease;
}

.glass-button {
  all: unset;
  position: relative;
  cursor: pointer;
  border-radius: 9999px;
  transition: all 0.3s ease;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.glass-button-text {
  position: relative;
  display: block;
  user-select: none;
  letter-spacing: -0.025em;
  z-index: 2;
}

.glass-button-shadow {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  z-index: 0;
  transition: all 0.3s ease;
}

.glass-button-wrap:hover .glass-button-shadow {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.glass-button-wrap:active .glass-button-shadow {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

.glass-button-wrap:disabled .glass-button-shadow,
.glass-button-wrap.disabled .glass-button-shadow {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Grid utilities */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Gallery image card */
.gallery-image-card {
  aspect-ratio: 1;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  border-radius: 1rem;
  border: 4px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.gallery-image-card:hover {
  transform: scale(1.03);
  border-color: rgba(255, 255, 255, 0.5);
}

.gallery-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease-out;
}

/* Hover link preview */
.hover-link-preview {
  position: relative;
  display: inline-block;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
  color: white !important; /* Ensure link text is white */
}

.hover-link-preview:hover {
  text-decoration-color: rgba(255, 255, 255, 0.6);
  color: white !important; /* Keep white on hover */
}

.hover-link-preview-preview {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 0.75rem;
  opacity: 0;
  transform: scale(0.8) translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
}

.hover-link-preview-preview.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.hover-link-preview-preview img {
  width: auto;
  height: auto;
  max-width: 220px;
  max-height: 110px;
  object-fit: contain;
}

/* Project styles */
.project-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.project-logo {
  flex-shrink: 0;
  transition: transform 0.3s ease, border-color 0.3s ease;
  display: block;
  /* Size is controlled by inline styles, don't override */
}

/* Responsive logo sizing to match text scales (text-lg -> md:text-2xl -> lg:text-3xl) */
@media (min-width: 768px) {
  .project-logo {
    width: var(--logo-size-md, var(--logo-height-md, auto)) !important;
    height: var(--logo-size-md, var(--logo-height-md, auto)) !important;
    max-width: var(--logo-max-width-md, none) !important;
  }
}

@media (min-width: 1024px) {
  .project-logo {
    width: var(--logo-size-lg, var(--logo-height-lg, auto)) !important;
    height: var(--logo-size-lg, var(--logo-height-lg, auto)) !important;
    max-width: var(--logo-max-width-lg, none) !important;
  }
}

.project-logo:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Text shadow utilities */
.text-shadow-sm {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.text-shadow-md {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Space utilities */
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-10 > * + * { margin-top: 2.5rem; }

@media (min-width: 768px) {
  .md\:space-y-8 > * + * { margin-top: 2rem; }
}

/* Additional responsive text sizes */
@media (min-width: 768px) {
  .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .md\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
}

@media (min-width: 1024px) {
  .lg\:text-7xl { font-size: 4.5rem; line-height: 1; }
}

/* Leading/line-height utilities */
.leading-relaxed { line-height: 1.625; }

/* Flex utilities */
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.items-baseline { align-items: baseline; }

/* Additional spacing */
.pb-8 { padding-bottom: 2rem; }
.pb-24 { padding-bottom: 6rem; }
.pb-32 { padding-bottom: 8rem; }
.pb-40 { padding-bottom: 10rem; }
.-mt-8 { margin-top: -2rem; }
.-mt-4 { margin-top: -1rem; }

@media (min-width: 768px) {
  .md\:pb-32 { padding-bottom: 8rem; }
}

@media (min-width: 1024px) {
  .lg\:pb-40 { padding-bottom: 10rem; }
}

/* Overflow */
.overflow-visible { overflow: visible; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Fractal Noise Shader Container */
#fractal-noise-container {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  overflow: hidden;
}

/* Ensure background spans full viewport on all devices */
@media (min-width: 768px) {
  #fractal-noise-container {
    position: fixed !important;
    width: 100vw !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    min-width: 100vw;
    min-height: 100vh;
  }
  
  #fractal-noise-container canvas,
  .darkveil-canvas {
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw;
    min-height: 100vh;
  }
}

/* Ensure background spans full viewport on mobile */
@media (max-width: 767px) {
  #fractal-noise-container {
    position: fixed !important;
    width: 100vw !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    min-width: 100vw;
    min-height: 100vh;
  }
  
  #fractal-noise-container canvas,
  .darkveil-canvas {
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw;
    min-height: 100vh;
  }
}

#fractal-noise-container canvas,
.darkveil-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

/* Matte overlay for better text readability */
#matte-overlay {
  z-index: 0.5;
  pointer-events: none;
  mix-blend-mode: multiply;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(0.4px);
}

/* Reduce overlay opacity on desktop for more vivid colors, but keep deeper blues */
@media (min-width: 768px) {
  #matte-overlay {
    background: rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(0.4px);
  }
}

/* Make background more visible on mobile */
@media (max-width: 767px) {
  #matte-overlay {
    background: rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(0.2px);
  }
  
  #fractal-noise-container {
    opacity: 1;
  }
  
  #fractal-noise-container canvas,
  .darkveil-canvas {
    opacity: 1 !important;
  }
}

/* Project logo styles - ensure proper sizing */
.project-logo {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Section title alignment - center on mobile, left on desktop */
.section-title-mobile-center {
  text-align: center;
}

@media (min-width: 768px) {
  .section-title-mobile-center {
    text-align: left;
  }
}

/* Section content/description alignment - center on mobile, left on desktop */
.section-content-mobile-center {
  text-align: center;
}

@media (min-width: 768px) {
  .section-content-mobile-center {
    text-align: left;
  }
}

/* Project title wrapping - allow wrapping on mobile */
.project-title {
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .project-title {
    display: block !important;
    white-space: normal;
  }
}

@media (min-width: 768px) {
  .project-title {
    white-space: nowrap;
    display: flex;
  }
}

/* RL Simulation Styles */
.rl-simulation-container {
  width: 100%;
  position: relative;
  display: flex;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(100, 200, 255, 0.1);
}

.rl-simulation-canvas-container {
  flex: 1;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgb(21, 26, 54); /* Van Gogh Starry Night deep navy blue */
  border: 2px solid rgba(100, 200, 255, 0.3);
  align-self: stretch; /* Match height of controls panel */
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(100, 200, 255, 0.05),
    0 0 0 1px rgba(100, 200, 255, 0.1);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.rl-simulation-canvas-container:hover {
  border-color: rgba(100, 200, 255, 0.5);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(100, 200, 255, 0.1),
    0 0 20px rgba(100, 200, 255, 0.2);
}

/* Controls and Stats Container */
.rl-simulation-controls-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 320px;
  min-width: 320px;
}

/* Control Panel */
.rl-controls-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.7) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(100, 200, 255, 0.2);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(100, 200, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.rl-controls-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(100, 200, 255, 0.5) 50%, 
    transparent 100%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.rl-controls-title {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #64c8ff 0%, #a0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(100, 200, 255, 0.5);
  position: relative;
}

.rl-controls-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #64c8ff, transparent);
  border-radius: 2px;
}

.rl-slider-container {
  margin-bottom: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(100, 200, 255, 0.1);
}

.rl-slider-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rl-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.8) 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(100, 200, 255, 0.2);
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.rl-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #64c8ff 0%, #a0e7ff 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 0 10px rgba(100, 200, 255, 0.6),
    0 0 20px rgba(100, 200, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.rl-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 
    0 0 15px rgba(100, 200, 255, 0.8),
    0 0 30px rgba(100, 200, 255, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.rl-slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

.rl-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #64c8ff 0%, #a0e7ff 100%);
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  box-shadow: 
    0 0 10px rgba(100, 200, 255, 0.6),
    0 0 20px rgba(100, 200, 255, 0.4);
}

.rl-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 
    0 0 15px rgba(100, 200, 255, 0.8),
    0 0 30px rgba(100, 200, 255, 0.6);
}

.rl-slider-value {
  color: #64c8ff;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: right;
  text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

/* Algorithm Selector */
.rl-algorithm-select {
  width: 100%;
  padding: 8px 12px;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.8) 100%);
  border: 1.5px solid rgba(100, 200, 255, 0.3);
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2364c8ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  padding-right: 32px;
}

.rl-algorithm-select:hover {
  border-color: rgba(100, 200, 255, 0.6);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
  box-shadow: 
    0 4px 12px rgba(100, 200, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.rl-algorithm-select:focus {
  border-color: rgba(100, 200, 255, 0.8);
  box-shadow: 
    0 0 0 3px rgba(100, 200, 255, 0.2),
    0 4px 12px rgba(100, 200, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.rl-algorithm-select option {
  background: rgb(15, 23, 42);
  color: #ffffff;
  padding: 10px;
}

.rl-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1rem;
}

/* Stats Panel */
.rl-stats-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.7) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(100, 200, 255, 0.2);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(100, 200, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.rl-stats-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(100, 200, 255, 0.5) 50%, 
    transparent 100%);
  animation: shimmer 3s infinite;
}

.rl-stats-panel h4 {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #64c8ff 0%, #a0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(100, 200, 255, 0.5);
  position: relative;
}

.rl-stats-panel h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #64c8ff, transparent);
  border-radius: 2px;
}

.rl-stats-display {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0;
}

.rl-graph-container {
  margin-top: 1rem;
}

.rl-graph-container h4 {
  color: rgb(255, 255, 255);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  padding-left: 5px;
}

.rl-graph-canvas {
  width: 100%;
  height: 120px;
  border-radius: 4px;
}

.rl-simulation-canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

@media (max-width: 768px) {
  .rl-simulation-canvas-container {
    align-self: stretch; /* Match controls panel height on mobile */
  }
}

.rl-simulation-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.rl-control-btn {
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.15) 0%, rgba(100, 200, 255, 0.1) 100%);
  border: 1.5px solid rgba(100, 200, 255, 0.4);
  border-radius: 10px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.rl-control-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(100, 200, 255, 0.3), 
    transparent);
  transition: left 0.5s ease;
}

.rl-control-btn:hover:not(:disabled)::before {
  left: 100%;
}

.rl-control-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.25) 0%, rgba(100, 200, 255, 0.2) 100%);
  border-color: rgba(100, 200, 255, 0.7);
  transform: translateY(-2px);
  box-shadow: 
    0 4px 16px rgba(100, 200, 255, 0.4),
    0 0 20px rgba(100, 200, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #a0e7ff;
}

.rl-control-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(100, 200, 255, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rl-control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.5);
}

.rl-control-btn.active {
  background: linear-gradient(135deg, rgba(100, 200, 255, 0.3) 0%, rgba(160, 231, 255, 0.25) 100%);
  border-color: rgba(100, 200, 255, 0.8);
  box-shadow: 
    0 4px 16px rgba(100, 200, 255, 0.5),
    0 0 24px rgba(100, 200, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #a0e7ff;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 
      0 4px 16px rgba(100, 200, 255, 0.5),
      0 0 24px rgba(100, 200, 255, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 
      0 4px 20px rgba(100, 200, 255, 0.7),
      0 0 32px rgba(100, 200, 255, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

.rl-simulation-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rl-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  margin: 0.15rem 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(100, 200, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.rl-stat-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #64c8ff, #a0e7ff);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rl-stat-item:hover::before {
  opacity: 1;
}

.rl-stat-item:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(100, 200, 255, 0.3);
  transform: translateX(4px);
}

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

.rl-stat-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.rl-stat-value {
  color: #64c8ff;
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
  font-family: 'Courier New', monospace;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .rl-simulation-container {
    flex-direction: column;
    padding: 15px;
    gap: 12px;
  }

  .rl-simulation-canvas-container {
    align-self: stretch; /* Match controls panel height */
    width: 100%;
  }

  .rl-simulation-controls-stats {
    width: 100%;
    min-width: unset;
  }

  .rl-controls-panel,
  .rl-stats-panel {
    width: 100%;
  }

  .rl-control-btn {
    padding: 10px 20px;
    font-size: 0.8125rem;
  }
  
  .rl-controls-title,
  .rl-stats-panel h4 {
    font-size: 1.1rem;
  }

  .rl-graph-canvas {
    height: 100px;
  }

  /* Reduce heavy effects on mobile */
  .glass-card, .glass-card-md, .glass-button-shadow, #matte-overlay {
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
  }
  .shadow-2xl { box-shadow: 0 15px 30px -12px rgba(0,0,0,0.25); }
  .profile-photo:hover, .project-logo:hover { transform: none; }
}

@media (max-width: 480px) {
  .rl-simulation-container {
    padding: 12px;
    gap: 10px;
  }

  .rl-simulation-canvas-container {
    min-height: 250px;
  }

  .rl-control-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .rl-simulation-stats {
    gap: 10px;
    padding: 8px;
  }

  .rl-stat-label {
    font-size: 8px;
  }

  .rl-stat-value {
    font-size: 12px;
  }
}

/* Project title container - allow wrapping on mobile */
.project-title-container {
  flex-wrap: wrap;
  min-width: 0;
}

/* Project title div - allow wrapping on mobile */
.project-title-div {
  min-width: 0;
  flex-wrap: wrap;
}

/* Project iframe styles */
.project-iframe-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.4);
}

.project-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 1rem;
  overflow: hidden;
}

@media (max-width: 768px) {
  .project-iframe-wrapper {
    height: 72vh;
  }
}

@media (max-width: 480px) {
  .project-iframe-wrapper {
    height: 65vh;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    max-width: 100%;
    height: auto;
  }
  
  html {
    scroll-behavior: auto !important;
  }
}

