/* Centralized Color Scheme */
:root {
  --primary-bg: #121212;
  --primary-text: #ffffff;
  --accent-color: #00aaff;
  --secondary-bg: rgba(30, 30, 30, 0.8);
  --border-color: #00aaff;
  --cursor-color: #86e7ff;
  --tooltip-bg: #333;
  
  /* New variables */
  --section-padding: 80px 20%;
  --card-hover: rgba(40, 40, 40, 0.9);
  --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);
}

/* Custom scrollbar */
::-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 - now with sticky feature */
header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  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;
}


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 */
.theme-switch {
  width: 60px;
  height: 30px;
  background-color: var(--secondary-bg);
  border-radius: 15px;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.theme-switch .sun, .theme-switch .moon {
  font-size: 18px;
  color: var(--accent-color);
}

.theme-switch .toggle {
  position: absolute;
  left: 5px;
  width: 20px;
  height: 20px;
  background-color: var (--accent-color);
  border-radius: 50%;
  transition: transform 0.3s;
  z-index: 100;
}

[data-theme="light"] .theme-switch .toggle {
  transform: translateX(30px);
}

/* 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 h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 40px;
  font-size: 2rem;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--accent-color);
}

#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 */
.social-links a {
  margin: 0 10px;
  display: inline-block;
  transition: transform 0.3s;
}

.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;
  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;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  min-height: 350px; /* or preferred value */
}

.project-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  background-color: var(--card-hover);
}

.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;
  }
}

.project-item.active .project-details {
  max-height: 800px;
  opacity: 1;
  padding: 15px 0;
}

/* 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;
}

/* Sleek back button styling - updated for icon only */
.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-color);
  color: var(--primary-bg);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.back-button:hover {
  background-color: var(--primary-text);
  color: var(--accent-color);
  transform: scale(1.1);
}

/* Header project layout - adjusted */
.header-project {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.header-project > div:first-child {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 20px;
}

.header-project h1 {
  margin: 0;
}

.project-nav {
  width: 100%;
  margin-top: 15px;
}

.project-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0;
}

/* 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: 100%;
  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);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
  }
  
  .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: 300px;
  }
  
  nav ul li {
    margin: 10px 0;
  }
  
  .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;
  }
  
  .project-container {
    grid-template-columns: 1fr;
  }
  
  .project-item.active {
    grid-column: span 1;
  }
}

/* Slider styles */
.project-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
}

.slider-wrapper {
  display: flex;
  transition: transform 0.5s ease;
}

.slide {
  min-width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.slider-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: grey;
  border-radius: 50%;
  margin: 0 5px;
  cursor: pointer;
}

.slider-dot.active {
  background-color: var(--accent-color); /* or any preferred highlight */
}

/* Add dynamic background canvas styling */
#dynamic-bg {
  position: absolute;
  top: 45%;
  left: 0;
  width: 100%;
  z-index: -1;
  opacity: 0.7;
}

/* Add animated arrow styling - modified to only animate on hover */
@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}

.animated-arrow {
  transition: transform 0.3s ease;
}

.back-button:hover .animated-arrow {
  animation: arrowBounce 1s ease-in-out infinite;
}

/* Ensure back-button items are in the same row */
.header-project {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
}

/* Header project layout - adjusted for left-positioned back button */
.header-project {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  padding: 10px 0;
}

.back-button {
  position: absolute;
  left: 20px;
  top: 50%;
  text-decoration: none;
}