/* Centralized Color Scheme */
:root {
  --primary-bg: #121212;
  --primary-text: #ffffff;
  --accent-color: #00aaff;
  --secondary-bg: rgba(30, 30, 30, 1);
  --border-color: #00aaff;
  --cursor-color: #86e7ff;
  --tooltip-bg: #333;
  
  /* New variables */
  --section-padding: 80px 20px;
  --card-hover: rgba(40, 40, 40, 1);
  --scrollbar-thumb: #00aaff;
  --scrollbar-track: #1a1a1a;
}

/* Light Theme Variables */
[data-theme="light"] {
  --primary-bg: #f8f8f8;
  --primary-text: #121212;
  --secondary-bg: rgba(240, 240, 240, 0.9);
  --border-color: #0088cc;
  --accent-color: #0088cc;
  --tooltip-bg: #e0e0e0;
  --card-hover: rgba(220, 220, 220, 0.9);
  --scrollbar-thumb: #0088cc;
  --scrollbar-track: #e0e0e0;
}

/* Basic Styling & Static Dark Background */
html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
button {
  border: none;
}
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

body {
  background-color: var(--primary-bg);
  color: var(--primary-text);
  line-height: 1.6;
  cursor: none;
  margin: 0;
  padding: 0;
  font-family: 'Inter', Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hide default cursor for all elements */
* {
  cursor: none !important;
}

p {
  transition: color 0.3s;
}

/* Custom Cursor */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  background-color: var(--cursor-color);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  opacity: 1;
  transition: transform 0.2s ease, opacity 0.5s ease;
}

.custom-cursor.enlarged {
  transform: translate(-50%, -50%) scale(2);
}

.custom-cursor.hidden {
  opacity: 0;
}

header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  top: 0;
  backdrop-filter: blur(10px);
  background-color: rgba(18, 18, 18, 0.8);
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] header {
  background-color: rgba(248, 248, 248, 0.8);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;

}

header h1 {
  color: var(--accent-color);
  margin: 0;
  font-size: 1.8rem;
  transition: transform 0.3s;
}

header h1:hover {
  transform: scale(1.05);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin: 0 15px;
}

nav ul li a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s;
  position: relative;
  padding: 5px 0;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width 0.3s;
}

nav ul li a:hover::after {
  width: 100%;
}

nav ul li a:hover {
  color: var(--primary-text);
  cursor: none;
}

/* Theme toggle - redesigned to match language switcher */
.theme-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 15px;
  background-color: var(--secondary-bg);
  border-radius: 20px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  width: 88px; /* Fixed width to match language switcher */
}

.theme-switch::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, var(--accent-color), #0088cc);
  border-radius: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.3);
  z-index: 1;
}

[data-theme="light"] .theme-switch::before {
  transform: translateX(100%);
}

.theme-switch .fa-sun,
.theme-switch .fa-moon {
  font-size: 13px;
  color: var(--secondary-text);
  z-index: 2;
  opacity: 0.7;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 0;
  width: 40px;
  text-align: center;
  border-radius: 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-switch .fa-sun:hover,
.theme-switch .fa-moon:hover {
  color: var(--primary-text);
  transform: translateY(-1px);
}

[data-theme="light"] .theme-switch .fa-sun {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

[data-theme="dark"] .theme-switch .fa-moon {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.theme-switch .toggle {
  display: none; /* Hide the old toggle element */
}

/* Add hover effect to theme switch */
.theme-switch:hover {
  box-shadow: 
    inset 0 1px 3px rgba(0, 0, 0, 0.2),
    0 0 12px rgba(0, 136, 204, 0.2);
}

/* Loading animation for theme switching */
.theme-switch.loading::before {
  animation: pulse 1s ease-in-out infinite alternate;
}

/* Language switcher */
.language-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 15px;
  background-color: var(--secondary-bg);
  border-radius: 20px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  width: 88px; /* Fixed width to match theme switcher */
}

.language-switch::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, var(--accent-color), #0088cc);
  border-radius: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 136, 204, 0.3);
  z-index: 1;
}

.language-switch[data-active="cs"]::before {
  transform: translateX(100%);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--secondary-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
  min-width: 32px;
  text-align: center;
}

.lang-btn:hover {
  color: var(--primary-text);
  transform: translateY(-1px);
}

.lang-btn.active {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.lang-separator {
  display: none; /* Hide separator since we're using a sliding background */
}

/* Add a subtle glow effect on hover */
.language-switch:hover {
  box-shadow: 
    inset 0 1px 3px rgba(0, 0, 0, 0.2),
    0 0 12px rgba(0, 136, 204, 0.2);
}

/* Loading animation for language switching */
.language-switch.loading::before {
  animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
  0% {
    box-shadow: 0 2px 8px rgba(0, 136, 204, 0.3);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 136, 204, 0.6);
  }
}

/* Fade in animation for content changes */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 3px;
  transition: all 0.3s;
}

/* Sections */
section {
  padding: var(--section-padding);
  text-align: center;
  scroll-margin-top: 80px; /* for sticky header */
}

.section-title-container {
  display: inline-block;
  margin-bottom: 40px; /* Original h2 margin-bottom */
}

section h2 {
  margin-bottom: 0; /* No space between header and underline */
  font-size: 2rem;
  /* ::after pseudo-element for underline is removed */
}

.heading-underline-svg {
  width: 100%;
  height: 6px; /* Height of the underline */
  position: relative;
  top: -15px;
}

.underline-path {
  stroke: var(--accent-color);
  stroke-width: 4; /* Thickness of the underline */
  stroke-linecap: round; /* Rounded ends for the line */
  stroke-dasharray: 100; /* Total length of the path (M0 3 H100 has length 100) */
  stroke-dashoffset: 100; /* Start with the line "undrawn" */
  transition: stroke-dashoffset 1.5s cubic-bezier(0.19, 1, 0.22, 1); /* Dramatic easeOutExpo */
  fill: none;
}

.underline-path.animate {
  stroke-dashoffset: 0; /* "Draw" the line */
}

/* Hero Section */
#hero {
  position: relative; /* For positioning stripes */
  height: calc(100vh - 250px); /* Adjusted height to account for nav menu */
  display: flex;
  flex-direction: column; /* Align title and slogan vertically */
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden; /* Hide stripes overflowing */
  background-color: var(--primary-bg); /* Use CSS variable */
}

.hero-stripes-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: 1; /* Stripes behind content */
}

.hero-stripe {
  width: 33.333%; /* 3 stripes, each ~33.33% width */
  height: 100%;
  background-color: var(--accent-color); /* Use CSS variable for contrast */
  transform: translateY(-100%); /* Start off-screen */
  animation: revealStripe 1s ease-out forwards;
}

/* Stagger the stripe animations */
.hero-stripe:nth-child(1) { animation-delay: 0s; }
.hero-stripe:nth-child(2) { animation-delay: 0.1s; }
.hero-stripe:nth-child(3) { animation-delay: 0.2s; }
/* Removed nth-child(4) and nth-child(5) as there are only 3 stripes now */

@keyframes revealStripe {
  0% {
      transform: translateY(-100%);
  }
  50% {
      transform: translateY(0%); /* Stripes cover the screen */
  }
  100% {
      transform: translateY(0%) scaleY(0); /* Stripes shrink to reveal content */
      transform-origin: bottom;
  }
}

.hero-content {
  position: relative;
  z-index: 2; /* Content above stripes */
  display: flex; /* Enable flexbox for side-by-side layout */
  align-items: center; /* Vertically align items in the center */
  justify-content: space-around; /* Distribute space around items */
  width: 80%; /* Control the overall width of the content area */
  max-width: 1200px; /* Maximum width */
  padding: 20px;
  /* background-color: var(--secondary-bg); Removed background box */
  border-radius: 10px;
  opacity: 0; /* Start hidden */
  animation: fadeInContent 1s ease-out 1.5s forwards; /* Delay to sync with stripes */
  text-align: left; /* Align text to the left */
}

.hero-text-content {
  flex: 1; /* Allow text content to take available space */
  padding-right: 20px; /* Add some space between text and image */
}

#hero-main-title {
  font-size: 3em;
  margin-bottom: 0;
  color: var(--accent-color); /* Changed to accent color */
}

#hero-slogan {
  font-size: 1.5em;
  color: var(--primary-text);
  opacity: 0.3;
  font-style: italic;
  margin-bottom: 1em;
  margin-top: 0;
  font-family: 'Italianno', cursive;
  letter-spacing: 1px;
  font-weight: 400;
}

/* CTA Button Styles */
.cta-button {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--primary-text);
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.cta-button:hover {
  background-color: var(--border-color); /* Darken accent color on hover */
}

.hero-image {
  flex-shrink: 0; /* Prevent image from shrinking */
  width: 600px; /* Increased size */
  height: 600px; /* Increased size */
  object-fit:contain;

}

@keyframes fadeInContent {
  to {
      opacity: 1;
  }
}

/* Fade-in on Scroll General Styles */
.fade-in-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.is-visible {
  opacity: 1;
  transform: translateY(0);
}


#about {
  position: relative;
  z-index: 1;
  border-bottom: var(--accent-color) 1px solid;
}

#about p {
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
  transition: color 0.3s;
}

.about-container {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.about-img {
  width: 40%;
  max-width: 40%;
  object-fit: cover;
  border-radius: 15px;
}

#about-text {
  width: 60%;
}

p:hover strong {
  transition: color 0.3s;
  color: var(--accent-color);
}

/* Tech Badges */
.tech-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
}

.badge-group {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.badge-group h3 {
  margin-bottom: 10px;
}

.badge-group a {
  background: none;
  border: none;
  display: inline-block;
  transition: transform 0.3s;
  position: relative;
}

.badge-group a:hover {
  transform: scale(1.1);
  cursor: none;
}

.tech-logo {
  width: 50px;
  filter: invert(31%) sepia(100%) saturate(1500%) hue-rotate(180deg) contrast(98%);
  display: block;
}

.badge-group a[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--tooltip-bg);
  color: var(--primary-text);
  padding: 5px 8px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  font-size: 0.8rem;
  pointer-events: none;
}

.badge-group a[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  color: var(--accent-color);
}

/* Social Links - updated to all be blue */
.social-links a {
  margin: 0 10px;
  display: inline-block;
  transition: transform 0.3s;
}

.social-links a i {
  color: var(--accent-color); /* Forces the icons to use the accent color (blue) */
  font-size: 1.5rem;
}

.social-links a:hover {
  transform: scale(1.1);
  cursor: none;
}

.social-logo {
  width: 40px;
  display: block;
  filter: invert(31%) sepia(100%) saturate(1500%) hue-rotate(180deg) contrast(98%);
}

/* Footer Contact */
#contact {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 20px;
}

/* Ensure the canvas is placed beneath content */
#circles-canvas {
  z-index: 0;
}

/* Project Container and Items - improved */
.project-container {
  display: block;
  position: sticky;
  top: 0;
  padding: 0;
  margin: 0;
}

.project-item {
  background-color: var(--secondary-bg);
  padding: 20px;
  border-radius: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: visible !important;
  position: relative;
  height: auto !important;
  display: flex;
  flex-direction: column;
  min-height: 350px; /* or preferred value */
}

.project-item:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  background-color: var(--card-hover);
  transform: scale(1.01);
}

.project-item .project-title {
  font-weight: bold;
  color: var(--accent-color);
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 15px;
}

.project-item a {
  color: var(--accent-color);
  text-decoration: none;
  padding: 8px 15px;
  border: 1px solid var(--accent-color);
  border-radius: 5px;
  transition: all 0.3s;
  margin-top: auto;
  display: inline-block;
}

.project-item a:hover {
  background-color: var(--accent-color);
  color: var(--primary-bg);
}

.project-item .project-details {
  max-height: none !important;
  opacity: 1 !important;
  transition: none !important;
  display: flex;
  flex-direction: column;
}

/* Expanded project styles */
.project-item.active {
  height: fit-content;
  grid-column: span 2;
}

@media (min-width: 992px) {
  .project-item.active {
    grid-column: span 3;
  }
}

/* New styling for inline project tech badges */
.project-tech-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
  padding: 5%;
  margin-top: auto;
}

.project-tech-badges img {
  width: 50px;
  filter: invert(31%) sepia(100%) saturate(1500%) hue-rotate(180deg) contrast(98%);
  transition: transform 0.3s;
  cursor: pointer;
}

.project-tech-badges img:hover {
  transform: scale(1.1);
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 99;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* Contact form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background-color: var(--secondary-bg);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);

}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  text-align: left;
  margin-bottom: 8px;
  color: var(--accent-color);
}

.form-group input,
.form-group textarea {
  width: 95%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--primary-text);
  font-family: inherit;
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.form-submit {
  background-color: var(--accent-color);
  color: #fff;
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}  

.form-submit:hover {
  background-color: #0088cc;
  transform: scale(1.05);
}  

/* Slider styles - REWORKED FOR STICKY SCROLL ANIMATION */
#projects { /* Make the entire section sticky and define its scrollable height */
  top: 0; /* Stick to the top of the viewport */
  overflow: visible; /* Clip cards animating from outside */
  position: relative; /* For absolute positioning of slides */
  padding-left: 0;
  padding-right: 0;
}

.project-slider {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
}

.slide {
  position: absolute; 
  top: 20%; 
  left: 50%; 
  transform: translate(-50%, -50%); 
  transform-origin: center center;
  width: 60%; 
  max-width: 550px; 
  aspect-ratio: 16 / 10; 
  background-color: var(--secondary-bg);
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
  padding: 25px;
  opacity: 0; 
  display: flex; 
  flex-direction: column; 
}


/* Remove old slider dots and arrows */
.slider-dots,
.slider-arrow {
  display: none;
}


/* Responsive Adjustments */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    height:fit-content;
    width: 100%;
  }  
  
  .menu-toggle {
    display: flex;
    position: absolute;
    top: 20px;
    right: 20px;
  }  
  
  nav ul {
    flex-direction: column;
    width: 100%;
    text-align: center;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
  }  
  
  nav.active ul {
    max-height: 360px;
  }  
  
  nav ul li {
    margin: 10px 0;
  }  

  .language-switch,
  .theme-switch {
    margin-left: 0;
    margin-top: 10px;
    width: 88px; /* Keep same width on mobile */
    justify-content: center;
  }

  .lang-btn {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 28px;
  }

  .theme-switch .fa-sun,
  .theme-switch .fa-moon {
    padding: 6px 0;
    font-size: 12px;
    width: 36px;
  }  
  
  .about-container {
    flex-direction: column;
    align-items: center;
  }  
  
  .about-img {
    width: 100%;
    max-width: 100%;
  }  
  
  #about-text {
    width: 100%;
    text-align: center;
  }  
  
  .custom-cursor {
    display: none;
  }  

  /* Hero section adjustments for mobile */
  #hero {
    height: auto; /* Adjust height to fit content */
    padding-top: 60px; /* Add padding to account for sticky header */
    padding-bottom: 40px;
  }  

  .hero-content {
    flex-direction: column; /* Stack content vertically */
    width: 90%; /* Adjust width for smaller screens */
    text-align: center; /* Center text for stacked layout */
  }  

  .hero-text-content {
    padding-right: 0; /* Remove padding when stacked */
    margin-bottom: 20px; /* Add space between text and image */
  }  

  #hero-main-title {
    font-size: 2.5em; /* Adjust font size for mobile */
  }  

  #hero-slogan {
    font-size: 1.2em; /* Adjust font size for mobile */
  }  

  .hero-image {
    width: 80%; /* Make image responsive */
    max-width: 300px; /* Limit max width on mobile */
    height: auto; /* Maintain aspect ratio */
  }  
  
  .project-slider {
    height: 60vh; /* Adjust height for smaller screens */
  }  

  .slide {
    width: 85%; /* Increase width percentage for better use of smaller screens */
    max-width: 400px; /* Reduce max-width for smaller screens */
    padding: 15px; /* Reduce padding */
    top: 50%; /* Adjust top position for vertical centering */
    left: 50%;
    transform: translate(-50%, -50%);
  }  
}
