/* Card glow */
.card-glow {
  position: absolute;
  content: '';
  background: radial-gradient(circle at 50% 50%, var(--accent), transparent 70%);
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  mix-blend-mode: screen;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.ring:hover .card-glow,
.project:hover .card-glow,
.certification-card:hover .card-glow,
.achievement-card:hover .card-glow {
  opacity: 0.6;
}

/* Background gradient */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(120deg, var(--bg-light) 0%, var(--card-bg) 100%);
  opacity: 0.7;
  z-index: -1;
  animation: gradientAnimation 15s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Text glitch */
.hero-title {
  position: relative;
}

/* Remove glitch effect from hero-title */
.hero-title::before,
.hero-title::after {
  display: none !important;
  content: none !important;
}

@keyframes glitch-1 {}
@keyframes glitch-2 {}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.8);
}

/* Parallax */
.certification-card img {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.certification-card:hover img {
  transform: translateZ(20px);
}

/* Button effects */
.btn-primary::before,
.btn-secondary::before,
.hero-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  border-radius: inherit;
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.hero-cta:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

/* Parallax shapes */
.shape {
  transform-style: preserve-3d;
  will-change: transform;
}

/* Touch effects */
@media (hover: hover) {

  .project::after,
  .certification-card::after,
  .achievement-card::after {
    content: "";
    position: absolute;
    height: 200px;
    width: 200px;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.8), transparent 40%);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 2;
    mix-blend-mode: screen;
  }
}

/* 3D tilt */
.ring,
.project,
.certification-card,
.achievement-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  position: relative;
}

/* Noise texture */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.02;
  z-index: -1;
  pointer-events: none;
}

/* Selection */
::selection {
  background: var(--accent);
  color: white;
}

/* Custom cursor */
.custom-cursor {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: all 0.1s ease;
  mix-blend-mode: difference;
  opacity: 0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Matrix-style typing effect */
@keyframes matrix-typing {
  0% { opacity: 0; transform: translateY(10px); }
  50% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

.matrix-text {
  animation: matrix-typing 2s ease-in-out infinite;
}

/* Terminal-style blinking cursor */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.terminal-cursor {
  animation: blink 1s infinite;
}

/* Hacker-style glitch effect */
@keyframes glitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}

.glitch-effect {
  animation: glitch 0.3s ease-in-out infinite;
}

/* Cybersecurity scan effect */
@keyframes scan-line {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100vh);
  }
}

.scan-effect {
  position: relative;
  overflow: hidden;
}

.scan-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scan-line 3s linear infinite;
  z-index: 1;
}

body:hover .custom-cursor {
  opacity: 1;
}

.cursor-hover {
  width: 3rem;
  height: 3rem;
  background-color: rgba(16, 185, 129, 0.2);
  border-width: 1px;
}

.cursor-click {
  transform: translate(-50%, -50%) scale(0.5);
  background-color: var(--accent);
  transition: transform 0.1s ease, background-color 0.1s ease;
}

/* Loading */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0b0d 0%, #101214 50%, #0f1113 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 50%);
  animation: loading-glow 4s ease-in-out infinite alternate;
}

@keyframes loading-glow {
  0% { opacity: 0.2; }
  100% { opacity: 0.4; }
}

.loading-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 500;
  margin-top: 2rem;
  opacity: 0;
  animation: loading-text-fade 3s ease-in-out infinite;
  text-align: center;
  font-family: 'Courier New', monospace;
}

@keyframes loading-text-fade {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.loading-spinner {
  width: 6rem;
  height: 6rem;
  position: relative;
  z-index: 2;
}

.loading-spinner:before,
.loading-spinner:after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
}

.loading-spinner:before {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
  animation-delay: -0.9s;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.loading-spinner:after {
  width: 75%;
  height: 75%;
  background: linear-gradient(45deg, var(--accent), var(--accent-dark));
  top: 12.5%;
  left: 12.5%;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(0);
    opacity: 1;
  }

  50% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Shadow transition */
.project:hover,
.certification-card:hover,
.achievement-card:hover,
.back-to-top:hover {
  box-shadow:
    0 10px 25px -3px rgba(16, 185, 129, 0.2),
    0 4px 8px -2px rgba(16, 185, 129, 0.1),
    0 0 0 2px rgba(16, 185, 129, 0.05);
}

/* Skill bars */
progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  transition: width 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Focus styles */
button:focus,
a:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

/* Canvas */
.bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.5;
}

/* Frost glass */
.contact-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .contact-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Utilities */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-3rem);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(3rem);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-1rem);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slide-right {
  animation: slideInRight 0.8s ease-out forwards;
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

.delay-500 {
  animation-delay: 0.5s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-200deg);
  }
  to {
    opacity: 1;
    transform: rotate(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation classes */
.animate-fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.animate-slide-up-premium {
  animation: slideUpPremium 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-scale-in-premium {
  animation: scaleInPremium 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-float-premium {
  animation: floatPremium 6s ease-in-out infinite;
}

@keyframes slideUpPremium {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scaleInPremium {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes floatPremium {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-10px) rotate(1deg);
  }
  66% {
    transform: translateY(-5px) rotate(-1deg);
  }
}

.animate-slide-up {
  animation: slideInUp 0.6s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease forwards;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 1s ease-in-out;
}

.animate-slide-left {
  animation: slideInLeft 0.6s ease forwards;
}

.animate-slide-right {
  animation: slideInRight 0.6s ease forwards;
}

.animate-rotate-in {
  animation: rotateIn 0.8s ease forwards;
}

.animate-zoom-in {
  animation: zoomIn 0.6s ease forwards;
}

/* Reveal animations */
.reveal-section {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-section.revealed {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations */
.stagger-animation > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-animation.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-animation.revealed > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-animation.revealed > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-animation.revealed > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-animation.revealed > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-animation.revealed > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-animation.revealed > *:nth-child(6) { transition-delay: 0.6s; }

/* Cybersecurity animations */

/* Matrix rain */
@keyframes matrix-rain {
  0% {
    transform: translateY(-100vh);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

.matrix-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.03;
}

.matrix-rain span {
  position: absolute;
  color: var(--accent);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  animation: matrix-rain 3s linear infinite;
}

/* Security scan */
@keyframes security-scan {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

.security-scan {
  position: relative;
  overflow: hidden;
}

.security-scan::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: security-scan 2s ease-in-out infinite;
  z-index: 1;
}

/* Hover effects */
.professional-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.professional-hover:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(16, 185, 129, 0.15),
    0 0 0 1px rgba(16, 185, 129, 0.1);
}

/* Glitch text */
@keyframes glitch-text {
  0%, 100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
}

.glitch-text {
  animation: glitch-text 0.3s ease-in-out infinite;
  animation-play-state: paused;
}

.glitch-text:hover {
  animation-play-state: running;
}

/* Loading animation */
@keyframes professional-loading {
  0% {
    transform: rotate(0deg);
    border-top-color: var(--accent);
  }
  25% {
    border-top-color: var(--accent-dark);
  }
  50% {
    border-top-color: var(--accent);
  }
  75% {
    border-top-color: var(--accent-dark);
  }
  100% {
    transform: rotate(360deg);
    border-top-color: var(--accent);
  }
}

.professional-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: professional-loading 1s linear infinite;
}

/* Card animations */
.card-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Button animations */
.btn-professional {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 8px 25px rgba(16, 185, 129, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.btn-professional:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 15px 35px rgba(16, 185, 129, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.btn-professional::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.5s ease;
}

.btn-professional:hover::before {
  left: 100%;
}

/* Security badge */
@keyframes security-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
}

.security-badge {
  animation: security-pulse 2s infinite;
}

/* Typing effect */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-cursor {
  0%, 50% {
    border-color: transparent;
  }
  51%, 100% {
    border-color: var(--accent);
  }
}

.typing-effect {
  overflow: hidden;
  border-right: 2px solid var(--accent);
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink-cursor 0.75s step-end infinite;
}

/* Scroll animations */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-fade-in.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Grid animation */
.grid-animate {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.grid-item {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-item.animate {
  opacity: 1;
  transform: scale(1);
}

/* Staggered delays */
.grid-item:nth-child(1) { transition-delay: 0.1s; }
.grid-item:nth-child(2) { transition-delay: 0.2s; }
.grid-item:nth-child(3) { transition-delay: 0.3s; }
.grid-item:nth-child(4) { transition-delay: 0.4s; }
.grid-item:nth-child(5) { transition-delay: 0.5s; }
.grid-item:nth-child(6) { transition-delay: 0.6s; }

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.1s ease;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.3);
}

@keyframes progress-glow {
  0%, 100% { 
    background-position: 0% 50%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  }
  50% { 
    background-position: 100% 50%;
    box-shadow: 0 0 20px rgba(16, 185, 129, 1);
  }
}

/* Skills Section Cool Animations */
@keyframes skillCardEntrance {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes categorySlideIn {
  0% {
    opacity: 0;
    transform: translateX(-50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes progressFill {
  0% {
    width: 0%;
  }
  100% {
    width: var(--target-width);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
  }
}

@keyframes textReveal {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skillIconRotate {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(5deg) scale(1.05);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

@keyframes levelBarGrow {
  0% {
    transform: scaleX(0);
    transform-origin: left;
  }
  100% {
    transform: scaleX(1);
    transform-origin: left;
  }
}