/* Custom CSS for Back Software - Version 2.8 - Fixed Container Padding & Overflow */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Prevent horizontal overflow */
html, body {
  overflow-x: hidden !important;
  max-width: 100%;
}

/* Force overflow hidden on body even with inline styles */
body[style*="overflow"] {
  overflow-x: hidden !important;
}

/* Ensure all containers respect viewport width */
* {
  box-sizing: border-box;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #8b5cf6, #3b82f6);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #7c3aed, #2563eb);
}

/* Custom animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse-slow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Gradient text animation */
.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
}

/* Floating animation */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Pulse animation */
.animate-pulse-slow {
  animation: pulse-slow 4s ease-in-out infinite;
}

/* Custom button styles */
.btn-gradient {
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  position: relative;
  overflow: hidden;
}

.btn-gradient::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;
}

.btn-gradient:hover::before {
  left: 100%;
}

/* Glass morphism effect */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Custom shadows */
.shadow-glow {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.shadow-glow-blue {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

/* Text selection */
::selection {
  background: rgba(139, 92, 246, 0.2);
  color: #1f2937;
}

/* Focus styles */
.focus-ring:focus {
  outline: none;
  ring: 2px;
  ring-color: #8b5cf6;
  ring-opacity: 0.5;
}

/* Loading animation */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}

/* Responsive typography */
@media (max-width: 640px) {
  .text-responsive {
    font-size: 2.5rem;
    line-height: 1.1;
  }
}

@media (min-width: 641px) {
  .text-responsive {
    font-size: 3.5rem;
    line-height: 1.1;
  }
}

@media (min-width: 1024px) {
  .text-responsive {
    font-size: 4.5rem;
    line-height: 1.1;
  }
}

/* Custom utilities */
.text-gradient {
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-radial {
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

/* Hover effects */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Custom grid */
.grid-auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Backdrop blur fallback */
@supports not (backdrop-filter: blur(10px)) {
  .glass {
    background: rgba(255, 255, 255, 0.9);
  }
}

/* Hide scrollbar for services section */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Smooth scroll behavior for services */
.services-scroll {
  scroll-behavior: smooth;
}

/* Animated gradient line for services */
.gradient-line {
  background: linear-gradient(90deg, #8b5cf6, #3b82f6, #10b981, #f59e0b, #ef4444, #8b5cf6);
  background-size: 300% 100%;
  animation: gradient-shift 3s ease infinite;
  height: 2px;
  width: 120px;
  border-radius: 1px;
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Innovation Animation Styles */
.innovation-container {
  position: relative;
  overflow: hidden;
}

.innovation-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: scan-line 3s infinite;
  z-index: 1;
}

@keyframes scan-line {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Holographic effect */
.holographic {
  background: linear-gradient(45deg, 
    rgba(139, 92, 246, 0.1) 0%, 
    rgba(59, 130, 246, 0.1) 25%, 
    rgba(16, 185, 129, 0.1) 50%, 
    rgba(245, 158, 11, 0.1) 75%, 
    rgba(239, 68, 68, 0.1) 100%);
  background-size: 400% 400%;
  animation: holographic-shift 4s ease infinite;
}

@keyframes holographic-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Particle glow effect */
.particle-glow {
  filter: drop-shadow(0 0 3px currentColor);
}

/* Code rain effect */
.code-rain {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 10px;
  line-height: 1.2;
  color: #00ff00;
  text-shadow: 0 0 5px #00ff00;
}

/* Tech icon animations */
.tech-icon {
  transition: all 0.3s ease;
  filter: drop-shadow(0 0 8px currentColor);
}

.tech-icon:hover {
  transform: scale(1.2) rotate(10deg);
  filter: drop-shadow(0 0 15px currentColor);
}

/* Neon glow effect */
.neon-glow {
  box-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor,
    0 0 15px currentColor,
    0 0 20px currentColor;
}

/* Matrix-style background */
.matrix-bg {
  background: 
    radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
}

/* Interactive cursor */
.innovation-cursor {
  cursor: none;
}

.innovation-cursor:hover {
  cursor: crosshair;
}

/* Portfolio Specific Styles */
.portfolio-card {
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
}

.portfolio-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-color: #8b5cf6;
}

.portfolio-image {
  transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-image {
  transform: scale(1.05);
}

.testimonial-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 4px solid #8b5cf6;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .results-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.statistics-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.statistics-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.process-step {
  transition: all 0.3s ease;
}

.process-step:hover {
  transform: translateX(4px);
}

/* Portfolio Hero Animation */
.portfolio-hero-bg {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f3f4f6 100%);
  position: relative;
  overflow: hidden;
}

.portfolio-hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%238b5cf6" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%233b82f6" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%2310b981" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="%23f59e0b" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

/* Category Filter Animation */
.category-filter {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-filter:hover {
  transform: translateY(-2px);
}

.category-filter.active {
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  box-shadow: 0 10px 25px -5px rgba(139, 92, 246, 0.4);
}

/* Project Status Badges */
.status-completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.status-in-progress {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.3);
}

/* Technology Tags */
.tech-tag {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 1px solid #cbd5e1;
  transition: all 0.3s ease;
}

.tech-tag:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* CTA Button Enhancements */
.portfolio-cta {
  background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  position: relative;
  overflow: hidden;
}

.portfolio-cta::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;
}

.portfolio-cta:hover::before {
  left: 100%;
}

/* Responsive Improvements */
@media (max-width: 768px) {
  .portfolio-card {
    margin-bottom: 2rem;
  }
  
  .statistics-card {
    margin-bottom: 1rem;
  }
  
  .testimonial-card {
    padding: 1rem;
  }
}

/* Loading States */
.portfolio-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Mobile Menu Modal Fixes */
.mobile-menu-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  overflow: hidden !important;
}

.mobile-menu-content {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10000 !important;
  overflow: hidden !important;
}

/* Ensure modal covers everything when body is fixed */
body.menu-open {
  position: fixed !important;
  width: 100% !important;
  overflow: hidden !important;
}

/* Prevent any content from showing through the modal */
.mobile-menu-overlay * {
  box-sizing: border-box;
}

/* HTML Pages Mobile Menu Fixes */
#mobile-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  overflow: hidden !important;
}

#mobile-menu .fixed {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10000 !important;
  overflow: hidden !important;
}

/* Ensure modal covers everything when body is fixed */
body.menu-open-html {
  position: fixed !important;
  width: 100% !important;
  overflow: hidden !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
}
