@tailwind base;
@tailwind components;
@tailwind utilities;

@layer utilities {
  /* Floating Icons Animation */
  .floating-icon {
    position: absolute;
    animation: floatUp linear infinite;
    opacity: 0;
  }
  
  @keyframes floatUp {
    0% {
      transform: translateY(100vh) translateX(0) rotate(0deg);
      opacity: 0;
    }
    10% {
      opacity: 0.8;
    }
    90% {
      opacity: 0.8;
    }
    100% {
      transform: translateY(-20vh) translateX(30px) rotate(360deg);
      opacity: 0;
    }
  }
  
  /* Typewriter Cursor */
  .typewriter-cursor {
    animation: blink 0.8s infinite;
    font-weight: 300;
  }
  
  @keyframes blink {
    0%, 49% {
      opacity: 1;
    }
    50%, 100% {
      opacity: 0;
    }
  }
  
  /* Fade In Up Animation */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out forwards;
  }
  
  /* Modern Blob Animation */
  @keyframes blob {
    0%, 100% {
      transform: translate(0, 0) scale(1);
    }
    25% {
      transform: translate(20px, -50px) scale(1.1);
    }
    50% {
      transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
      transform: translate(50px, 50px) scale(1.05);
    }
  }
  
  .animate-blob {
    animation: blob 20s infinite;
  }
  
  .animation-delay-2000 {
    animation-delay: 2s;
  }
  
  .animation-delay-4000 {
    animation-delay: 4s;
  }
  
  /* Scroll Reveal Animations */
  .scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  }
  
  .scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Stagger delays for sequential animations */
  .scroll-reveal-delay-1 {
    transition-delay: 0.1s;
  }
  
  .scroll-reveal-delay-2 {
    transition-delay: 0.2s;
  }
  
  .scroll-reveal-delay-3 {
    transition-delay: 0.3s;
  }
  
  .scroll-reveal-delay-4 {
    transition-delay: 0.4s;
  }
}

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes loader {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.animate-items {
  position: relative;
}

.animate-items::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid rgba(128, 128, 128, 0.2);
  border-top-color: #8d5ac7;
  border-radius: 50%;
  animation: loader 0.6s linear infinite;
  z-index: 10;
}

.animate-items > *:not(.pointer-events-none):not(.opacity-0) {
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

.animate-items::before {
  opacity: 1;
  animation: loader 0.6s linear infinite, fadeOut 0.2s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Mobile-specific fixes to prevent gaps and overflow */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    #main-content {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    #home {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    #home video {
        width: 100vw !important;
        height: 100vh !important;
        object-fit: cover !important;
        object-position: center !important;
    }
    
    .container {
        max-width: 100vw !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Fix for any potential horizontal scroll */
    * {
        max-width: 100vw !important;
    }
    
    /* Fix canvas elements */
    canvas {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
    }
    
    /* Ensure navbar doesn't cause overflow */
    #navbar {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Fix loading screen */
    #loading-screen {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Mobile sidebar fixes */
    #mobile-sidebar {
        width: 288px !important;
        max-width: 288px !important;
        z-index: 60 !important;
        will-change: transform !important;
        backface-visibility: hidden !important;
        transform-style: preserve-3d !important;
    }
    
    #sidebar-overlay {
        z-index: 55 !important;
    }
    
    /* Ensure navbar stays above sidebar overlay but below sidebar */
    #navbar {
        z-index: 50 !important;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }
    
    /* Fix any potential touch issues on mobile */
    #mobile-sidebar * {
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* Smooth sidebar menu item animations */
    #mobile-sidebar a {
        transition: all 0.2s ease !important;
    }
    
    #mobile-sidebar a:hover {
        transform: translateX(-4px) !important;
    }
}

/* Gradient animation for footer */
@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-gradient-slow {
    animation: gradient 15s ease infinite;
    background-size: 400% 400%;
}

/* Custom scroll animation */
@keyframes scroll-bounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(12px);
        opacity: 1;
    }
}

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