/* Enhanced CSS Variables for Ocean Theme */
:root {
  --ocean-deep: #0a192f;
  --ocean-medium: #112240;
  --ocean-light: #1d3557;
  --ocean-surface: #2a5298;
  --foam-white: rgba(255, 255, 255, 0.9);
  --coral-accent: #ff6b6b;
  --teal-glow: #26c6da;
  --pearl-shimmer: #b2ebf2;
  --sea-glass: rgba(178, 235, 242, 0.2);
  --wave-transition: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --bubble-transition: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Hide scrollbars globally */
html {
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
  scrollbar-width: none;  /* Firefox */
}

html::-webkit-scrollbar {
  display: none;  /* WebKit browsers */
}

/* Enhanced Body with Ocean Depth */
body {
  font-family: 'Exo', sans-serif;
  margin: 0;
  overflow-x: hidden;
  background: 
    radial-gradient(ellipse at top, var(--ocean-surface) 0%, var(--ocean-medium) 40%, var(--ocean-deep) 100%),
    linear-gradient(180deg, var(--ocean-light) 0%, var(--ocean-deep) 100%);
  position: relative;
  min-height: 100vh;
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
  scrollbar-width: none;  /* Firefox */
}

body::-webkit-scrollbar {
  display: none;  /* WebKit browsers */
}

/* Animated Ocean Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 120%;
  height: 120%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(26, 198, 218, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(178, 235, 242, 0.08) 0%, transparent 50%);
  animation: oceanFlow 20s ease-in-out infinite;
  z-index: -2;
}

/* Floating Particles Effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(178, 235, 242, 0.4), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(26, 198, 218, 0.3), transparent);
  background-repeat: repeat;
  background-size: 150px 150px;
  animation: floatingParticles 25s linear infinite;
  z-index: -1;
  pointer-events: none;
}

.scroll-container {
  height: 4000px;
  width: 100%;
  position: relative;
}

canvas.webgl {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
}

/* Enhanced Project UI with Ocean Glass Effect */
#project-ui {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(circle at 30% 30%, rgba(178, 235, 242, 0.1) 0%, transparent 50%);
  backdrop-filter: blur(25px) saturate(1.2);
  -webkit-backdrop-filter: blur(25px) saturate(1.2);
  color: white;
  padding: 40px;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 2px 0 rgba(255, 255, 255, 0.15) inset,
    0 0 50px rgba(26, 198, 218, 0.2);
  animation: surfaceFromDepth 0.8s var(--wave-transition);
  z-index: 1000;
  max-height: 90vh;
  overflow-y: auto;
}

/* Enhanced Project UI Title */
#project-ui h1 {
  font-size: 2.5em;
  margin: 0 0 40px;
  text-align: center;
  color: var(--foam-white);
  text-shadow: 
    0 0 30px rgba(178, 235, 242, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.4);
  font-weight: 300;
  letter-spacing: 2px;
  position: relative;
}

#project-ui h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal-glow), transparent);
  animation: titleGlow 3s ease-in-out infinite;
}

/* Enhanced Project Container */
.project-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  max-width: 1400px;
  width: 92vw;
}

/* Enhanced Project Cards with Ocean Depth */
.project-card {
  background: 
    linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%),
    radial-gradient(circle at 70% 20%, rgba(26, 198, 218, 0.08) 0%, transparent 50%);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  border-radius: 20px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 2px 0 rgba(255, 255, 255, 0.2) inset;
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: all 0.5s var(--wave-transition);
  position: relative;
  transform-style: preserve-3d;
}

/* Animated Shimmer Effect */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent
  );
  transition: left 0.6s ease;
  z-index: 1;
}

.project-card:hover::before {
  left: 100%;
}

/* Ocean Ripple Effect */
.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg, 
    transparent, 
    rgba(26, 198, 218, 0.6), 
    rgba(178, 235, 242, 0.8), 
    rgba(26, 198, 218, 0.6), 
    transparent
  );
  animation: oceanRipple 4s ease-in-out infinite;
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: all 0.6s var(--wave-transition);
  filter: brightness(0.9) contrast(1.1);
  position: relative;
  z-index: 2;
}

.project-card h2 {
  font-size: 1.6em;
  margin: 25px 0;
  color: var(--foam-white);
  font-weight: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 2;
}

.project-card p {
  padding: 0 25px 25px;
  font-size: 1.05em;
  color: rgba(255, 255, 255, 0.85);
  flex-grow: 1;
  text-align: left;
  line-height: 1.7;
  position: relative;
  z-index: 2;
}

/* Enhanced Hover Effects */
.project-card:hover {
  transform: translateY(-12px) scale(1.03) rotateX(2deg);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 2px 0 rgba(255, 255, 255, 0.25) inset,
    0 0 80px rgba(26, 198, 218, 0.3);
  background: 
    linear-gradient(145deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 100%),
    radial-gradient(circle at 70% 20%, rgba(26, 198, 218, 0.12) 0%, transparent 50%);
}

.project-card:hover img {
  filter: brightness(1.1) saturate(1.2) contrast(1.2);
  transform: scale(1.08);
}

/* Enhanced Contact UI */
#contact-ui {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  background: 
    linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%),
    radial-gradient(circle at 30% 30%, rgba(178, 235, 242, 0.1) 0%, transparent 50%);
  backdrop-filter: blur(25px) saturate(1.2);
  -webkit-backdrop-filter: blur(25px) saturate(1.2);
  color: white;
  padding: 40px;
  border-radius: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 2px 0 rgba(255, 255, 255, 0.15) inset,
    0 0 50px rgba(26, 198, 218, 0.2);
  z-index: 1001;
  animation: surfaceFromDepth 0.8s var(--wave-transition);
}

#contact-ui h1 {
  font-size: 2.5em;
  margin: 0 0 40px;
  text-align: center;
  color: var(--foam-white);
  text-shadow: 
    0 0 30px rgba(178, 235, 242, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.4);
  font-weight: 300;
  letter-spacing: 2px;
  position: relative;
}

.contact-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 1000px;
  width: 85vw;
}

/* Enhanced Contact Cards */
.contact-card {
  background: 
    linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  border-radius: 18px;
  box-shadow: 
    0 10px 35px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 2px 0 rgba(255, 255, 255, 0.2) inset;
  border: 1px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: all 0.5s var(--wave-transition);
  position: relative;
}

.contact-card img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin: 30px auto 0;
  filter: brightness(1.1);
  transition: all 0.5s var(--bubble-transition);
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.contact-card h2 {
  font-size: 1.3em;
  margin: 25px 0 0;
  color: var(--foam-white);
  font-weight: 500;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.contact-card p {
  padding: 20px 25px 30px;
  font-size: 1.05em;
  color: rgba(255, 255, 255, 0.85);
  flex-grow: 1;
  text-align: left;
  line-height: 1.7;
}

.contact-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset,
    0 2px 0 rgba(255, 255, 255, 0.25) inset,
    0 0 70px rgba(26, 198, 218, 0.25);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 100%);
}

.contact-card:hover img {
  filter: brightness(1.3) saturate(1.2);
  transform: scale(1.15) rotate(5deg);
}

/* Enhanced Progress Bar Container */
.progress-bar-container {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 35px;
  background: 
    linear-gradient(180deg, rgba(0, 105, 148, 0.95) 0%, rgba(0, 150, 136, 0.95) 100%),
    radial-gradient(circle at 50% 50%, rgba(26, 198, 218, 0.2) 0%, transparent 70%);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 1.5s ease;
  pointer-events: none;
  opacity: 1;
  overflow: hidden;
}

/* Enhanced Caustic Effect */
.progress-bar-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(178, 235, 242, 0.08) 0%, transparent 50%),
    linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.08) 25%,
      transparent 25%,
      transparent 50%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.08) 75%,
      transparent 75%,
      transparent
    );
  background-size: 60px 60px, 80px 80px, 50px 50px;
  animation: 
    causticFlow 12s linear infinite,
    oceanPulse 8s ease-in-out infinite;
  opacity: 0.4;
  z-index: -1;
}

.progress-bar-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 30%,
    transparent 70%,
    rgba(26, 198, 218, 0.1) 100%
  );
  animation: deepCurrents 6s ease-in-out infinite;
  z-index: -1;
}

/* Enhanced Progress Text */
.progress-bar {
  font-size: 1.8rem;
  color: var(--pearl-shimmer);
  text-shadow: 
    0 0 25px rgba(178, 235, 242, 0.9), 
    0 4px 8px rgba(0, 0, 0, 0.5);
  font-weight: 300;
  letter-spacing: 2px;
  position: relative;
  animation: deepGlow 3s ease-in-out infinite;
}

/* Enhanced Progress Bar */
#progress-bar {
  width: 50%;
  height: 28px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 20px;
  overflow: hidden;
  background: 
    linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)),
    rgba(0, 0, 0, 0.2);
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px rgba(255, 255, 255, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

#progress-bar::-webkit-progress-bar {
  background: transparent;
  border-radius: 20px;
}

#progress-bar::-webkit-progress-value {
  background: 
    linear-gradient(90deg, #1a8cb8, #26c6da, #4dd0e1, #80deea, #b2ebf2),
    linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset 0 0 15px rgba(255, 255, 255, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  animation: waveFlow 2s linear infinite;
}

/* Enhanced Intro Gesture */
.intro-gesture {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding-bottom: 60px;
  background: transparent;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transition: opacity 1s ease;
  pointer-events: none;
  opacity: 0;
}

.intro-gesture.visible {
  opacity: 1;
}

.gesture-text {
  font-size: 1.4rem;
  color: var(--pearl-shimmer);
  text-shadow: 
    0 0 20px rgba(178, 235, 242, 0.9), 
    0 3px 6px rgba(0, 0, 0, 0.4);
  font-weight: 300;
  letter-spacing: 1.5px;
  animation: deepGlow 2.5s ease-in-out infinite;
}

.scroll-arrow {
  width: 35px;
  height: 55px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 40"><path d="M12 0 L24 20 H18 V40 H6 V20 H0 L12 0 Z" fill="rgba(26,198,218,0.9)"/></svg>') no-repeat center;
  background-size: contain;
  animation: oceanicScroll 2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(26, 198, 218, 0.6));
}

/* Enhanced Link Styles */
a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s var(--wave-transition);
}

a:hover {
  transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .project-container {
    grid-template-columns: 1fr;
    width: 95vw;
    gap: 20px;
  }
  
  .contact-container {
    grid-template-columns: 1fr;
    width: 90vw;
    gap: 20px;
  }
  
  #project-ui, #contact-ui {
    padding: 25px;
    width: 90vw;
    max-width: none;
  }
  
  #project-ui h1, #contact-ui h1 {
    font-size: 2em;
    margin-bottom: 25px;
  }
  
  #progress-bar {
    width: 70%;
  }
  
  .progress-bar {
    font-size: 1.4rem;
  }
}

/* Enhanced Animations */
@keyframes surfaceFromDepth {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.8) rotateX(-10deg);
    filter: blur(10px);
  }
  50% {
    opacity: 0.7;
    transform: translate(-50%, -55%) scale(0.95) rotateX(-2deg);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotateX(0deg);
    filter: blur(0px);
  }
}

@keyframes oceanFlow {
  0%, 100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-20px) translateY(-10px) rotate(1deg);
  }
  50% {
    transform: translateX(10px) translateY(-20px) rotate(-0.5deg);
  }
  75% {
    transform: translateX(-10px) translateY(10px) rotate(0.5deg);
  }
}

@keyframes floatingParticles {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
  }
}

@keyframes oceanRipple {
  0%, 100% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    transform: translateX(0%);
    opacity: 1;
  }
}

@keyframes titleGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(26, 198, 218, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(26, 198, 218, 0.8);
  }
}

@keyframes causticFlow {
  0% {
    background-position: 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 60px 60px, 80px 80px, 50px 50px;
  }
}

@keyframes oceanPulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

@keyframes deepCurrents {
  0% {
    opacity: 0.3;
    transform: translateY(0) scaleY(1);
  }
  50% {
    opacity: 0.5;
    transform: translateY(15px) scaleY(1.1);
  }
  100% {
    opacity: 0.3;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes deepGlow {
  0% {
    text-shadow: 
      0 0 20px rgba(178, 235, 242, 0.8), 
      0 3px 6px rgba(0, 0, 0, 0.4);
  }
  50% {
    text-shadow: 
      0 0 35px rgba(178, 235, 242, 1), 
      0 0 50px rgba(26, 198, 218, 0.6),
      0 4px 8px rgba(0, 0, 0, 0.5);
  }
  100% {
    text-shadow: 
      0 0 20px rgba(178, 235, 242, 0.8), 
      0 3px 6px rgba(0, 0, 0, 0.4);
  }
}

@keyframes waveFlow {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 0;
  }
}

@keyframes oceanicScroll {
  0% {
    transform: translateY(0);
    opacity: 0.9;
    filter: drop-shadow(0 0 10px rgba(26, 198, 218, 0.6));
  }
  50% {
    transform: translateY(15px);
    opacity: 0.5;
    filter: drop-shadow(0 0 20px rgba(26, 198, 218, 0.8));
  }
  100% {
    transform: translateY(0);
    opacity: 0.9;
    filter: drop-shadow(0 0 10px rgba(26, 198, 218, 0.6));
  }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
