/* Custom CSS to override default scroll behavior and enable smooth scrolling */
html {
    scroll-behavior: smooth;
}

body {
    font-family: "Open Sans", sans-serif;
    background-color: #333333;
    color: #ffffff;
    margin: 0;
    overflow-x: hidden;
}

/* Make sure the hero section is a positioning context for the canvas */
#home {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* Style the Three.js canvas to cover the whole hero section */
canvas.webgl {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    outline: none;
    z-index: 1;
    display: block;
}

.section-header {
    position: relative;
    font-family: "Playfair Display", serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2rem;
    text-align: center;
}

/* Applying Playfair Display to prominent headings */
h1 {
    font-family: "Playfair Display", serif;
}

h3 {
    font-family: "Playfair Display", serif;
}

.section-header::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: #87ceeb;
    border-radius: 9999px;
}

/* Card hover animation */
.card-animation {
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.card-animation:hover {
    transform: translateY(-5px);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.2),
        0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

/* Keyframes for a subtle background animation */
@keyframes glowing-border {
    0% { border-color: rgba(135, 206, 235, 0.5); }
    50% { border-color: rgba(135, 206, 235, 0.8); }
    100% { border-color: rgba(135, 206, 235, 0.5); }
}

.glowing-border-animation {
    animation: glowing-border 3s infinite ease-in-out;
}

/* Ensure content in home section is above canvas */
.home-content {
    position: relative;
    z-index: 2;
}

/* Contact Section Particles */
#contact {
    position: relative;
    height: 100vh;
}

canvas.webgl-contact {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
}

#contact > div {
    position: relative;
    z-index: 2;
    height: 100%;
}

/* Mobile Menu Styles */
#mobile-menu {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
}

#mobile-menu.active {
    transform: translateX(0);
    opacity: 1;
}

.menu-overlay {
    background-color: rgba(0, 0, 0, 0.7);
    transition: opacity 0.3s ease;
}

.hamburger-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Fade-in animation for sections */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 1s ease forwards;
}

/* index.css */
/* Add these new styles */
#mobile-menu {
    transform: translateX(100%);
    opacity: 0;
}

#mobile-menu:not(.translate-x-full) {
    transform: translateX(0);
    opacity: 1;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 21px;
    cursor: pointer;
}

.hamburger-line {
    height: 3px;
    width: 100%;
    background-color: white;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Hamburger animation when active */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Menu overlay for mobile */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ======== Enhanced Navbar with Premium Animations ======== */
/* Navbar background with gradient animation */
#navbar-header {
    background: linear-gradient(135deg, rgba(51,51,51,0.9) 0%, rgba(42,42,42,0.9) 100%);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

#navbar-header.scrolled {
    background: linear-gradient(135deg, rgba(35,35,35,0.98) 0%, rgba(25,25,25,0.98) 100%);
    box-shadow: 0 6px 25px rgba(0,0,0,0.3);
    backdrop-filter: blur(12px);
}

/* Animated underline effect for nav links */
.nav-link {
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #87CEEB;
    transition: width 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
    transform-origin: left;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Enhanced mobile menu animation */
#mobile-menu {
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), 
                opacity 0.4s ease;
    box-shadow: -5px 0 30px rgba(0,0,0,0.3);
    background: rgba(35,35,35,0.98);
    backdrop-filter: blur(15px);
}

#mobile-menu.active {
    transform: translateX(0);
    opacity: 1;
}

.menu-overlay {
    transition: opacity 0.4s ease;
    background: rgba(0,0,0,0.85);
}

/* Refined hamburger animation */
.hamburger-line {
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Navbar entrance animation */
@keyframes navbarSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#navbar-header {
    animation: navbarSlideDown 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* ===== Enhanced Footer ===== */
footer {
    position: relative;
    background: linear-gradient(135deg, rgba(35,35,35,0.98) 0%, rgba(25,25,25,0.98) 100%);
    backdrop-filter: blur(12px);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    padding: 3rem 0;
    border-top: 1px solid rgba(135, 206, 235, 0.2);
    z-index: 30;
}

footer:hover {
    background: linear-gradient(135deg, rgba(40,40,40,0.98) 0%, rgba(30,30,30,0.98) 100%);
    box-shadow: 0 -6px 25px rgba(0,0,0,0.3);
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

footer p {
    font-size: 1rem;
    color: #c0c0c0;
    margin: 0;
    transition: all 0.3s ease;
}

footer:hover p {
    color: #ffffff;
    transform: translateY(-2px);
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(135, 206, 235, 0.1);
    color: #87CEEB;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.footer-social a:hover {
    background: #87CEEB;
    color: #1a1a1a;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px rgba(135, 206, 235, 0.3);
}

@keyframes floatFooter {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

footer {
    animation: none;
}

/* Add vertical separator and even spacing for about section */
.about-columns {
    position: relative;
}

.about-columns::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(to bottom, 
        transparent, 
        rgba(135, 206, 235, 0.5), 
        transparent);
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .about-columns::after {
        display: none;
    }
}

/* ===== Enhanced Profile Image Animation ===== */
/* Base Styles */
#about .rounded-full {
  position: relative;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
  z-index: 1;
}

/* Image Styles */
#about .rounded-full img {
  filter: grayscale(100%) contrast(110%);
  transition: 
    filter 0.7s ease,
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.5s ease;
  will-change: transform, filter;
  transform-style: preserve-3d;
}

/* Hover Effects */
#about .rounded-full:hover {
  animation: float-pulse 3s ease-in-out infinite;
}

#about .rounded-full:hover img {
  filter: grayscale(0%) contrast(105%) brightness(105%);
  transform: 
    translateY(-15px) 
    rotate(8deg) 
    scale(1.03)
    perspective(500px) 
    rotateY(5deg);
  box-shadow: 
    0 25px 40px rgba(135, 206, 235, 0.3),
    0 15px 25px rgba(0, 0, 0, 0.2);
}

/* Subtle 3D effect on container */
#about .rounded-full::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg, 
    rgba(135, 206, 235, 0.4) 0%, 
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.9s ease;
  z-index: -1;
}

#about .rounded-full:hover::after {
  opacity: 1;
}

/* Floating animation */
@keyframes float-pulse {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Enhanced glowing border */
@keyframes glowing-border {
  0% { 
    box-shadow: 
      0 0 5px rgba(135, 206, 235, 0.5),
      0 0 10px rgba(135, 206, 235, 0.3); 
  }
  50% { 
    box-shadow: 
      0 0 15px rgba(135, 206, 235, 0.8),
      0 0 25px rgba(135, 206, 235, 0.5); 
  }
  100% { 
    box-shadow: 
      0 0 5px rgba(135, 206, 235, 0.5),
      0 0 10px rgba(135, 206, 235, 0.3); 
  }
}

/* ===== Project Image Enhancements ===== */
/* Apply to all project images */
#projects img, 
#software-web-projects img {
  filter: grayscale(100%);
  transition: 
    filter 0.5s ease,
    transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: filter, transform;
}

/* Hover effects - restore color and enhance existing animations */
#projects .card-animation:hover img,
#software-web-projects .card-animation:hover img {
  filter: grayscale(0%);
}

/* Enhance existing card hover animation */
#projects .card-animation:hover,
#software-web-projects .card-animation:hover {
  transform: translateY(-8px); /* Slightly stronger lift */
}

/* Optional: Add color splash effect on hover */
#projects .card-animation:hover::after,
#software-web-projects .card-animation:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg, 
    rgba(135, 206, 235, 0.1) 0%, 
    transparent 70%
  );
  pointer-events: none;
  border-radius: 0.75rem; /* Match your card rounding */
}

/* Add to your index.css */
.email-tooltip {
  position: relative;
  display: inline-block;
}

.email-tooltip::after {
  content: 'dlakavusiseko@gmail.com';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: 
    opacity 0.3s ease, 
    transform 0.3s ease;
  z-index: 100;
  pointer-events: none;
  font-family: 'Open Sans', sans-serif;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.email-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: 
    opacity 0.3s ease, 
    transform 0.3s ease;
  z-index: 101;
}

.email-tooltip:hover::after,
.email-tooltip:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-15px);
}