:root {
  --primary: #4e95ff;
  --secondary: #9056ec;
  --accent: #ff3b8b;
  --background: #121212;
  --dark: #1e1e1e;
  --card-bg: #1e1e24;
  --light: #f0f0f0;
  --gray: #a0a0a0;
  --text-secondary: #c0c0c0;
  --border-radius: 12px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  background: var(--background);
  color: var(--light);
  line-height: 1.7;
  overflow-x: hidden;
}

header {
  background: linear-gradient(
    135deg,
    rgba(78, 149, 255, 0.5),
    rgba(144, 86, 236, 0.5)
  );
  color: var(--light);
  padding: 3rem 1rem;
  text-align: center;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  margin-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

header h1 {
  font-family: "Montserrat", sans-serif;
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Text animation styles */
.animated-text {
  position: relative;
}

.text-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

.letters {
  display: inline-block;
  color: var(--light);
  font-weight: 800;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  animation: text-glow 3s ease-in-out infinite;
}

@keyframes text-glow {
  0%,
  100% {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5),
      0 0 15px rgba(58, 134, 255, 0.5);
  }
  50% {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7),
      0 0 20px rgba(131, 56, 236, 0.7), 0 0 30px rgba(255, 0, 110, 0.3);
  }
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 2rem;
}

nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

nav a {
  color: var(--light);
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  font-weight: 500;
  border-radius: 30px;
  background-color: rgba(78, 149, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  transition: var(--transition);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

nav a:hover {
  background-color: rgba(144, 86, 236, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 59, 139, 0.4);
}

section {
  padding: 3rem 2rem;
  max-width: 1100px;
  margin: 0 auto 4rem;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 2rem;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 0.8rem;
  display: inline-block;
}

/* Enhanced heading style for animated headings */
h2.animated-text {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  font-weight: 800;
  color: var(--light);
}

h2.animated-text .letters {
  display: inline-block;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
  animation: heading-glow 3s ease-in-out infinite;
  color: var(--light);
}

@keyframes heading-glow {
  0%,
  100% {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5),
      0 0 15px rgba(78, 149, 255, 0.5);
  }
  50% {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7),
      0 0 20px rgba(144, 86, 236, 0.6), 0 0 25px rgba(255, 59, 139, 0.4);
  }
}

h2::after {
  content: "";
  position: absolute;
  width: 60%;
  height: 4px;
  bottom: 0;
  left: 0;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border-radius: 10px;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}
ul li {
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--light);
  margin-bottom: 1rem;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(58, 134, 255, 0.07);
  transition: var(--transition);
  position: relative;
  left: 0;
  animation: slideIn 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
ul li:hover {
  left: 8px;
  box-shadow: 0 6px 18px rgba(131, 56, 236, 0.13);
}

#about p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  background: linear-gradient(
    to right,
    rgba(58, 134, 255, 0.1),
    rgba(131, 56, 236, 0.1)
  );
  padding: 2rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

@keyframes slideIn {
  from {
    opacity: 0;
    left: -30px;
  }
  to {
    opacity: 1;
    left: 0;
  }
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 2rem;
  text-align: center;
}

.skills-grid i {
  font-size: 3rem;
  color: inherit; /* Use original icon colors */
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.skills-grid i:hover {
  transform: scale(1.15);
}

/* Using devicon's built-in colored class for skill icons */

/* Add a subtle background to make icons pop */
.skills-grid i {
  padding: 1.2rem;
  border-radius: var(--border-radius);
  background-color: rgba(30, 30, 36, 0.7);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.skill-name {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

#projects .rainbow-text {
  background: linear-gradient(
    to right,
    rgba(58, 134, 255, 0.1),
    rgba(131, 56, 236, 0.1)
  );
  color: var(--text-secondary);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

#projects .rainbow-text:hover {
  transform: translateY(-5px);
  transition: opacity 0.5s ease;
}

/* Rainbow border effect for about section text */
.rainbow-text {
  position: relative;
  display: inline-block;
  padding: 1em;
  border-radius: 12px;
  background-color: var(--card-bg); /* Match the section background */
}

/* Using a double-element approach for better cross-browser support */
.rainbow-text::before,
.rainbow-text::after {
  content: "";
  position: absolute;
  border-radius: 14px; /* Slightly larger than parent */
  transition: opacity 0.3s ease;
}

/* The rainbow gradient background */
.rainbow-text::before {
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(
    45deg,
    #ff0000,
    #ff7300,
    #fffb00,
    #48ff00,
    #00ffd5,
    #002bff,
    #7a00ff,
    #ff00c8,
    #ff0000
  );
  background-size: 400%;
  animation: rainbow-border 20s linear infinite;
  filter: blur(3px);
  z-index: -2;
  opacity: 0;
}

/* The "hole" in the middle */
.rainbow-text::after {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-bg);
  border-radius: 11px; /* Slightly smaller than the outer border radius */
  z-index: -1;
}

.rainbow-text:hover::before {
  opacity: 1;
}
@keyframes rainbow-border {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#projects .rainbow-text h3 {
  margin-top: 10px;
  font-family: "Montserrat", sans-serif;
  color: var(--light);
}

#projects .rainbow-text p {
  color: var(--text-secondary);
  margin: 1rem 0;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: rgba(58, 134, 255, 0.2);
  color: var(--light);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  margin: 0.25rem 0.5rem 0.25rem 0;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(58, 134, 255, 0.3);
  backdrop-filter: blur(5px);
}

.btn:hover {
  background: rgba(131, 56, 236, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
  border-color: rgba(131, 56, 236, 0.5);
}

#coding-profiles {
  text-align: center;
}

.profiles-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

#coding-profiles .btn {
  margin: 0.5rem;
  font-size: 1rem;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(30, 30, 36, 0.7);
  border: 1px solid rgba(78, 149, 255, 0.2);
  backdrop-filter: blur(8px);
}

#coding-profiles .btn i {
  font-size: 1.2rem;
  color: var(--accent);
}

#coding-profiles .btn:hover i {
  color: var(--light);
}

#contact {
  text-align: center;
}

.contact-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

#contact .btn-large {
  font-size: 1rem;
  padding: 0.8rem 2rem;
  min-width: 180px;
  margin: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  background: rgba(58, 134, 255, 0.2);
  transform-origin: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  border: 1px solid rgba(58, 134, 255, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#contact .btn-large:hover {
  transform: scale(1.05);
  background: rgba(131, 56, 236, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 0, 110, 0.5);
}

#contact .btn-large i {
  font-size: 1.5rem;
}

footer {
  background: linear-gradient(
    135deg,
    rgba(10, 10, 10, 0.95),
    rgba(0, 0, 0, 0.98)
  );
  color: var(--gray);
  text-align: center;
  padding: 2rem;
  clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 100%);
  padding-top: 5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
}

/* Add smooth fade-in for sections */
section {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 1s forwards;
}
section:nth-of-type(2) {
  animation-delay: 0.2s;
}
section:nth-of-type(3) {
  animation-delay: 0.4s;
}
section:nth-of-type(4) {
  animation-delay: 0.6s;
}
section:nth-of-type(5) {
  animation-delay: 0.8s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: none;
  }
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
  header {
    padding: 2rem 1rem;
  }

  header h1 {
    font-size: 2.2rem;
  }

  nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  section {
    padding: 2rem 1.5rem;
    margin: 0 auto 2rem;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 1.5rem;
  }

  h2 {
    font-size: 1.8rem;
  }
}

/* Header row for name and resume button */
.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 0.5rem;
}

.resume-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  margin-left: 0.5rem;

  background-color: rgba(78, 149, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  transition: var(--transition);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.resume-btn:hover {
  color: var(--primary);
  background-color: rgba(144, 86, 236, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 59, 139, 0.4);
}

@media (max-width: 600px) {
  .header-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  .resume-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    margin-left: 0;
  }
}
