/* Custom styles */
:root {
  --color-primary: #10b981;
  --color-secondary: #6366f1;
  --color-dark: #08090a;
  --color-darker: #08090a;
  --color-light: #e5e7eb;
}

/* Prevent horizontal overflow */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  position: relative;
}

/* Scroll Bar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: #10b981;
  border-radius: 20px;
  margin: 2px;
}

/* Scroll Slider Bar Styling Starts Here */

.scroll-bar {
  position: fixed;
  height: 3px;
  top: 0;
  left: 0;
  width: 100%;
  background: #10b981;
  animation: scroll linear;
  animation-timeline: scroll();
  z-index: 1000;
}

@keyframes scroll {
  from {
    width: 0px;
  }
  to {
    width: 100%;
  }
}

/* Scroll Slider Bar Styling Ends Here */

.dark {
  --color-primary: #10b981;
  --color-secondary: #6366f1;
  --color-dark: #08090a;
  --color-darker: #08090a;
  --color-light: #e5e7eb;
}

.dark body {
  background-color: var(--color-darker);
  color: var(--color-light);
}

.gradient-text {
  background: linear-gradient(90deg, #10b981, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

.gradient-bg {
  background: linear-gradient(135deg, #6366f1 0%, #10b981 100%);
}

.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.1),
    0 10px 10px -5px rgba(16, 185, 129, 0.04);
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: #0ea271;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.1),
    0 4px 6px -2px rgba(16, 185, 129, 0.05);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background-color: var(--color-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.1),
    0 4px 6px -2px rgba(16, 185, 129, 0.05);
}

.section-heading {
  position: relative;
  display: inline-block;
}

.section-heading::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 50px;
  height: 4px;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

.section-heading:hover::after {
  width: 100%;
}

.floating {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.scroll-indicator {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--color-primary);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

.scroll-indicator.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-indicator:hover {
  transform: translateY(-5px);
}

/* Custom cursor */
.custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.5);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, background-color 0.3s;
  mix-blend-mode: difference;
}

.cursor-expanded {
  width: 50px;
  height: 50px;
  background-color: rgba(16, 185, 129, 0.2);
}

/* Grid background */
.grid-bg {
  background-size: 50px 50px;
  background-image: linear-gradient(
      to right,
      rgba(16, 185, 129, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(16, 185, 129, 0.05) 1px, transparent 1px);
}

/* Blob animation */
.blob {
  animation: blob-animation 15s infinite alternate;
  filter: blur(40px);
}

@keyframes blob-animation {
  0% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
}

/* Testimonial slider */
.testimonial-slider {
  overflow: hidden;
  position: relative;
}

.testimonial-track {
  display: flex;
  transition: transform 0.5s ease;
}

.testimonial-slide {
  flex: 0 0 100%;
}

/* Project card hover effect */
.project-card {
  position: relative;
  overflow: hidden;
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-card-overlay {
  opacity: 1;
}

.project-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.project-card:hover .project-card-content {
  transform: translateY(0);
  opacity: 1;
}

/* Tech stack animation */
.tech-icon {
  transition: all 0.3s ease;
}

.tech-icon:hover {
  transform: translateY(-10px) scale(1.1);
}

/* Animated underline */
.animated-underline {
  position: relative;
  display: inline-block;
}

.animated-underline::after {
  content: "";
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-primary);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.animated-underline:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Code animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typing-animation {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 3s steps(40, end);
}

/* Glowing effect */
.glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px rgba(16, 185, 129, 0.2),
      0 0 10px rgba(16, 185, 129, 0.2);
  }
  to {
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4),
      0 0 20px rgba(16, 185, 129, 0.4);
  }
}

/* Enhanced responsive styles */
@media (max-width: 640px) {
  .hero-text h1 {
    font-size: 2rem !important;
  }

  .hero-text p {
    font-size: 1rem !important;
  }

  .stats-container {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .stats-container h3 {
    font-size: 1.5rem !important;
  }

  .project-card-content {
    padding: 1rem !important;
  }

  .project-card-content h3 {
    font-size: 1.2rem !important;
  }
}

@media (max-width: 480px) {
  .btn-container {
    flex-direction: column !important;
    width: 100% !important;
  }

  .btn-container a {
    width: 100% !important;
    margin-bottom: 0.75rem !important;
    text-align: center !important;
  }

  .stats-container {
    grid-template-columns: repeat(1, 1fr) !important;
  }

  .testimonial-slide {
    padding: 0 !important;
  }
}

/* Dark background */
.bg-custom-dark {
  background-color: #08090a;
}

.bg-custom-dark-lighter {
  background-color: #0f1011;
}

/* Loader Styles */
#loader {
  background-color: var(--color-dark);
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
  z-index: 9999;
}

#loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content .dots {
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60% {
    content: "...";
  }
  80%,
  100% {
    content: "";
  }
}

/* Enhanced Loader Styles */
.loader-spinner {
  position: relative;
  width: 150px;
  height: 150px;
  border: 4px dashed var(--color-primary);
  border-radius: 50%;
  animation: pulse-opacity 1.5s ease-in-out infinite;
}

.loader-spinner img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  animation: pulse-image 1.5s ease-in-out infinite;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loader-text {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: 0.1em;
  animation: pulse-text 1.5s ease-in-out infinite;
}

.loader-content .dots {
  position: relative;
  animation: slide-dots 1.5s steps(4) infinite;
}

.loader-content .dots::after {
  content: "";
  position: absolute;
  left: 0;
  animation: loading-dots 1.5s infinite;
}

@keyframes pulse-image {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.95);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse-opacity {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

@keyframes pulse-text {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes loading-dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}

@keyframes slide-dots {
  from {
    transform: translateX(-10px);
  }
  to {
    transform: translateX(10px);
  }
}

/* Loader Responsive Styles */
@media (max-width: 768px) {
  .loader-spinner {
    width: 120px;
    height: 120px;
    border-width: 3px;
  }

  .loader-spinner img {
    width: 100px;
    height: 100px;
  }

  .loader-content {
    gap: 1rem;
  }

  .loader-text {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .loader-spinner {
    width: 100px;
    height: 100px;
    border-width: 2px;
  }

  .loader-spinner img {
    width: 80px;
    height: 80px;
  }

  .loader-content {
    gap: 0.75rem;
  }

  .loader-text {
    font-size: 0.875rem;
  }
}

@media (max-width: 320px) {
  .loader-spinner {
    width: 80px;
    height: 80px;
  }

  .loader-spinner img {
    width: 60px;
    height: 60px;
  }

  .loader-text {
    font-size: 0.75rem;
  }
}
