/* Define CSS variables for colors */
:root {
  --background-color: #0f0f0f;
  --text-color: #f0f0f0;
  --primary-color: #1f8ef1;
  --card-bg-color: #1a1a1a;
  --border-color: #333;
}

/* Reset some default browser styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.3s ease-in-out;
}

/* Global Styles */
body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* General background and text adjustments */
body {
  background-color: var(--background-color); /* Dark background */
  color: var(--text-color); /* Light text for contrast */
}

header h1, header p, section h2, .project-card h3, .video-card h3 {
  color: var(--text-color); /* Ensure headings are readable */
}

.project-card, .video-card {
  background-color: var(--card-bg-color); /* Slightly lighter background for cards */
  color: var(--text-color); /* Ensure text is readable on card backgrounds */
}

header {
  text-align: center;
  padding: 2rem 1rem;
}

header h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

header p {
  font-weight: 300;
  font-size: 1.2rem;
  color: var(--text-color);
}

.socials a {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  background-color: transparent;
  color: var(--primary-color);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
  text-decoration: none;
  margin: 0 0.5rem;
  font-weight: 600;
  position: relative;
}

.socials a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

socials a::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s;
  position: absolute;
  bottom: -2px;
  left: 0;
}

.socials a:hover {
  background-color: var(--primary-color);
  color: var(--background-color); /* Invert colors on hover */
  box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
}

.socials a:hover::after {
  width: 100%; /* Underline animation */
}

.header-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  flex-wrap: wrap; /* Ensures content wraps on smaller screens */
  justify-content: center; /* Centers content on smaller screens */
  animation: fadeIn 1.5s ease-in-out; /* Fade-in effect */
}

.profile-picture {
  width: 150px; /* Default size */
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease-in-out;
  animation: float 3s ease-in-out infinite;
}

.profile-picture:hover {
  transform: scale(1.1); /* Slight zoom on hover */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Navigation styles */
.nav-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
  position: absolute; /* Position the navigation */
  top: 1rem; /* Distance from the top */
  right: 1rem; /* Distance from the right */
}

.nav-links li {
  display: inline;
}

.nav-links a {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: bold;
  transition: color 0.3s ease-in-out;
}

.nav-links a:hover {
  color: var(--text-color);
}

section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: var(--card-bg-color);
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 1s ease-in-out forwards;
  border-bottom: 1px solid var(--border-color);
}

section:last-of-type {
  border-bottom: none;
}

section:nth-child(2) {
  animation-delay: 0.5s;
}

section:nth-child(3) {
  animation-delay: 1s;
}

section:nth-child(4) {
  animation-delay: 1.5s;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--primary-color), var(--text-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientAnimation 3s infinite;
}

.skills-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.skills-list li {
  background-color: var(--card-bg-color);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s, background-color 0.3s;
}

.skills-list li:hover {
  transform: scale(1.1);
  background-color: var(--primary-color);
  color: var(--text-color);
}

/* Project list styles */
.project-list {
  display: flex;
  flex-direction: column; /* Stack projects vertically */
  gap: 2rem; /* Add spacing between rows */
  padding: 1rem;
}

/* Project card styles */
.project-card {
  background-color: var(--card-bg-color);
  padding: 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 15px var(--primary-color);
  border-color: var(--primary-color);
}

.project-card:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.project-card h3 {
  margin-top: 0;
  color: var(--primary-color);
}

/* Thumbnail styles */
.project-thumbnail {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 10px;
  margin-bottom: 1rem;
  object-fit: cover;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-thumbnail:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), 0 0 10px var(--primary-color);
}

/* Video section styles */
#project-videos {
  padding: 4rem 1rem;
  text-align: center;
  background-color: var(--background-color); /* Matches the overall theme */
  color: var(--text-color);
}

.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
  gap: 2rem;
  margin-top: 2rem;
}

.video-card {
  background-color: var(--card-bg-color); /* Matches project card background */
  color: var(--text-color); /* Ensure text is readable */
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.video-card h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

video {
  width: 100%; /* Ensures the video takes up the full width of its container */
  max-width: 600px; /* Limits the maximum width for larger screens */
  height: auto; /* Maintains aspect ratio */
  border-radius: 10px;
  outline: none;
  background-color: var(--card-bg-color); /* Matches card background */
}

footer {
  text-align: center;
  padding: 1rem;
  background-color: var(--card-bg-color);
  color: var(--text-color);
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  opacity: 0;
  animation: fadeIn 1.5s ease-in-out forwards;
  animation-delay: 2s;
}

/* Link styles */
a {
  color: var(--primary-color); /* Matches the theme */
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease-in-out;
}

a:hover {
  color: var(--text-color); /* Changes to text color on hover */
}

/* Social links hover effect */
.socials a:hover {
  color: var(--text-color); /* Matches hover effect for consistency */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
  .profile-picture {
    width: 100px; /* Smaller size for small screens */
    height: 100px;
  }

  header h1 {
    font-size: 2rem; /* Adjust header font size */
  }

  header p {
    font-size: 1rem; /* Adjust paragraph font size */
  }

  section h2 {
    font-size: 1.5rem;
  }

  .project-card {
    padding: 0.5rem;
  }

  .project-thumbnail {
    max-width: 100%;
  }

  .nav-links {
    flex-direction: column; /* Stack navigation links vertically */
    gap: 1rem;
  }

  .project-card, .video-card {
    padding: 1rem;
  }

  .project-thumbnail, video {
    max-width: 100%;
  }

  header h1 {
    font-size: 1.8rem;
  }

  header p {
    font-size: 1rem;
  }
}

/* Keyframes for animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Add a pulsing effect to the primary color elements */
a, .nav-links a, .skills-list li:hover {
  position: relative;
}

a::before, .nav-links a::before, .skills-list li:hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  box-shadow: 0 0 15px var(--primary-color);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
}

a:hover::before, .nav-links a:hover::before, .skills-list li:hover::before {
  opacity: 1;
  transform: scale(1.2);
}

/* Dropdown menu container */
.dropdown-menu {
  position: relative;
  display: inline-block;
}

/* Dropdown toggle button */
.dropdown-toggle {
  background-color: var(--primary-color);
  color: var(--text-color);
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease-in-out;
}

.dropdown-toggle:hover {
  background-color: var(--text-color);
  color: var(--primary-color);
}

/* Navigation links (hidden by default) */
.nav-links {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--card-bg-color);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Navigation links visible when dropdown is active */
.dropdown-menu.active .nav-links {
  display: block;
}

/* Individual navigation link styles */
.nav-links li {
  margin: 0;
}

.nav-links a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.3s ease-in-out;
}

.nav-links a:hover {
  background-color: var(--primary-color);
  color: var(--background-color);
}
