/* === NEUMORPHIC PORTFOLIO STYLES === */

/* === VARIABLES === */
:root {
  /* Main color scheme - easily customizable */
  --bg-light: #e0e5ec;
    /* --bg-light: lab(100% 0.01 -20.01); */
  /* --bg-light: #FAF6E9; */
  /* --bg-dark: #1a1a2e; */
   --bg-dark: #01010f;
   /* --bg-dark: #222831; */
  /* --bg-dark: #000000; */
  --text-light: #444444;
  --text-dark: #f8f8f8;
  --primary: #4d84e2;
  --primary-rgb: 77, 132, 226; /* RGB values of primary color */
  --secondary: #7158e2;
  --accent: #ff9a8b;
  --shadow-light-1: #ffffff;
  --shadow-light-2: #a3b1c6;
  --shadow-dark-1: #131326;
  --shadow-dark-2: #242444;
  
  /* Dynamic properties - will change with theme */
  --bg: var(--bg-light);
  --text-color: var(--text-light);
  --text-muted: rgba(68, 68, 68, 0.7);
  --shadow-1: var(--shadow-light-1);
  --shadow-2: var(--shadow-light-2);
  --card-bg: var(--bg-light);
  --border-color: rgba(0, 0, 0, 0.05);
  
  /* Constants */
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 15px;
  --radius-lg: 25px;
  --transition: 0.3s ease;
}

/* Dark theme overrides */
[data-theme="dark"] {
  --bg: var(--bg-dark);
  --text-color: var(--text-dark);
  --text-muted: rgba(248, 248, 248, 0.7);
  --shadow-1: var(--shadow-dark-1);
  --shadow-2: var(--shadow-dark-2);
  --card-bg: var(--bg-dark);
  --border-color: rgba(255, 255, 255, 0.1);
  
  /* Keep original primary color, just adjust secondary and accent for dark mode */
  --secondary: #8a7dff;
  --accent: #ff9a8b;
}

/* === RESET & BASE STYLES === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* === LOADER === */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s;
  opacity: 1;
  visibility: visible;
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px;
  border-radius: var(--radius-md);
  box-shadow: 5px 5px 15px var(--shadow-2),
              -5px -5px 15px var(--shadow-1);
  background: var(--bg);
}

.loading-bar {
  width: 220px;
  height: 6px;
  background-color: rgba(var(--primary-rgb), 0.1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 15px;
  position: relative;
  box-shadow: inset 2px 2px 5px var(--shadow-2),
              inset -2px -2px 5px var(--shadow-1);
}

.progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: var(--radius-sm);
  animation: loadingProgress 3.6s ease-in-out forwards;
  box-shadow: 0 0 10px var(--primary);
}

.loader-text {
  color: var(--text-color);
  font-weight: 500;
  letter-spacing: 1px;
  font-size: 0.95rem;
  position: relative;
  opacity: 1;
  transition: opacity 0.3s ease;
  min-height: 1.5rem;
  text-align: center;
  min-width: 200px;
}

@keyframes loadingProgress {
  0% { width: 0; }
  20% { width: 20%; }
  40% { width: 35%; }
  60% { width: 60%; }
  70% { width: 65%; }
  80% { width: 75%; }
  90% { width: 85%; }
  100% { width: 100%; }
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-md);
}

/* === NEUMORPHIC ELEMENTS === */
.neu-shadow {
  box-shadow: 5px 5px 15px var(--shadow-2),
              -5px -5px 15px var(--shadow-1);
}

.neu-shadow-inset {
  box-shadow: inset 5px 5px 10px var(--shadow-2),
              inset -5px -5px 10px var(--shadow-1);
}

.neu-button {
  padding: 12px 25px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-md);
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 5px 5px 10px var(--shadow-2),
              -5px -5px 10px var(--shadow-1);
}

.neu-button:hover {
  box-shadow: 3px 3px 6px var(--shadow-2),
              -3px -3px 6px var(--shadow-1);
  transform: translateY(-2px);
}

.neu-button:active {
  box-shadow: inset 2px 2px 5px var(--shadow-2),
              inset -2px -2px 5px var(--shadow-1);
  transform: translateY(0);
}

.neu-button i {
  font-size: 1.1rem;
}

.neu-button.primary {
  background: var(--primary);
  color: white;
}

/* Send button with green hover effect and animation */
.send-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.send-button:hover {
  background: #28a745; /* Green color on hover */
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.send-button i {
  transition: all 0.5s ease;
  margin-right: 5px;
}

.send-button:hover i {
  animation: fly-paper-plane 1s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes fly-paper-plane {
  0% { transform: translateX(0) rotate(0); }
  40% { transform: translateX(-3px) rotate(-5deg); }
  60% { transform: translateX(3px) rotate(5deg); }
  100% { transform: translateX(0) rotate(0); }
}

.neu-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: 5px 5px 15px var(--shadow-2),
              -5px -5px 15px var(--shadow-1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.neu-card:hover {
  transform: translateY(-5px);
  box-shadow: 8px 8px 20px var(--shadow-2),
              -8px -8px 20px var(--shadow-1);
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
}

.section {
  padding: 100px 0;
  position: relative;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

/* === HEADER & NAVIGATION === */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: var(--bg);
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 1rem;
  color: var(--text-color);
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.theme-toggle {
  background: var(--bg);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-color);
  font-size: 1.2rem;
  box-shadow: 3px 3px 8px var(--shadow-2),
              -3px -3px 8px var(--shadow-1);
}

.theme-toggle:active {
  box-shadow: inset 2px 2px 5px var(--shadow-2),
              inset -2px -2px 5px var(--shadow-1);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 16px;
  cursor: pointer;
}

.bar {
  width: 100%;
  height: 2px;
  background-color: var(--text-color);
  transition: var(--transition);
}

/* === HERO SECTION === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: var(--header-height);
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

.hero-intro {
  max-width: 600px;
}

.name {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.name-1 {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.description {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 500px;
}

.cta-buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-image {
  position: relative;
  width: 350px;
  height: 350px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-frame {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  padding: 10px;
  background: var(--bg);
  box-shadow: 10px 10px 20px var(--shadow-2),
              -10px -10px 20px var(--shadow-1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* === ABOUT SECTION === */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image .image-frame {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
}

.about-content p {
  margin-bottom: 1.5rem;
}

.tech-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.tech-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tech-icon {
  color: var(--primary);
  width: 20px;
  display: flex;
  justify-content: center;
}

/* === SKILLS SECTION === */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.skill-category {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: 5px 5px 15px var(--shadow-2),
              -5px -5px 15px var(--shadow-1);
  position: relative;
  transition: transform 0.3s ease;
  z-index: 1;
}

/* Border line effect for skill cards */
.skill-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-md);
  padding: 2px;
  background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
  -webkit-mask: 
     linear-gradient(#fff 0 0) content-box, 
     linear-gradient(#fff 0 0);
  mask: 
     linear-gradient(#fff 0 0) content-box, 
     linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.skill-category:hover::before {
  opacity: 1;
}

.skill-category:hover {
  transform: translateY(-5px);
}

.category-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  position: relative;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-title i {
  font-size: 1.1em;
  color: var(--primary);
}

.category-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.skill-item {
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 5px var(--shadow-2),
              -2px -2px 5px var(--shadow-1);
  transition: box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
}

.skill-item::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
  transition: transform 0.3s ease;
  transform: scaleY(0);
}

.skill-item:hover {
  box-shadow: 3px 3px 7px var(--shadow-2),
              -3px -3px 7px var(--shadow-1);
}

.skill-item:hover::before {
  transform: scaleY(1);
}

.skill-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-icon {
  color: var(--primary);
  font-size: 1rem;
  min-width: 20px;
  text-align: center;
  transition: transform 0.3s ease, color 0.3s ease;
}

.skill-item:hover .skill-icon {
  transform: scale(1.4) translateX(2px) rotate(10deg);
  color: var(--secondary);
}

.skill-item:hover .skill-name {
  color: var(--secondary);
  transform: translateY(-1px);
  transition: color 0.3s ease, transform 0.2s ease;
}

.skill-name {
  font-weight: 500;
  font-size: 0.95rem;
}

/* === EXPERIENCE SECTION === */
.experience-timeline {
  position: relative;
  padding: 60px 0 100px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 160px; /* Reduced from 250px for more moderate spacing */
  align-items: flex-start; /* Align items to the start */
  transition: all 0.5s ease; /* Smooth transitions when changes occur */
  min-height: 100vh; /* Ensure enough space for the timeline */
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 80px;
  width: 3px;
  background: var(--primary);
  opacity: 0.7;
  z-index: 1;
  height: 100%; /* Ensure full height */
}

.timeline-item {
  position: relative;
  width: 100%;
  padding-bottom: 0; /* Remove padding-bottom */
  margin: 0; /* Reset margin */
  /* This ensures that the item takes up only the space it needs */
  display: flex;
}

/* All timeline items positioned on the right with wider cards */
.timeline-item .timeline-content {
  margin-left: 150px;
  padding-left: 40px;
  text-align: left;
  float: left; 
  width: calc(100% - 160px);
  max-width: 900px;
  box-sizing: border-box;
}

.timeline-content {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 35px;
  position: relative;
  box-shadow: 5px 5px 15px var(--shadow-2),
              -5px -5px 15px var(--shadow-1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1;
  /* Remove margin-bottom */
  width: 100%;
}

/* Timeline content scattered glow effect */
.timeline-content {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  background: transparent;
  border-radius: var(--radius-md);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  box-sizing: content-box;
}

.timeline-content:hover {
  transform: translateY(-10px); /* Increased lift effect */
  z-index: 10; /* Ensure hovered card appears above others */
}

.timeline-content:hover::after {
  opacity: 0.85;
  animation: timelineGlow 4s linear infinite;
  z-index: -1; /* Keep glow behind the card but above other elements */
}

/* Timeline marker repositioned for left timeline */
.timeline-content::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  top: 25px;
  left: -80px;
  box-shadow: 0 0 0 4px var(--bg),
              0 0 0 6px var(--primary);
  z-index: 5; /* Increased z-index to appear above glow effect */
  animation: pulseMarker 2s infinite ease-in-out;
}

@keyframes pulseMarker {
  0% {
    box-shadow: 0 0 0 4px var(--bg),
                0 0 0 6px var(--primary);
  }
  50% {
    box-shadow: 0 0 0 4px var(--bg),
                0 0 0 6px var(--primary),
                0 0 15px rgba(var(--primary-rgb), 0.3);
  }
  100% {
    box-shadow: 0 0 0 4px var(--bg),
                0 0 0 6px var(--primary);
  }
}

/* Add horizontal connectors for timeline items */
.timeline-connector {
  position: absolute;
  height: 3px;
  background: var(--primary);
  opacity: 0.8;
  top: 34px;
  width: 60px;
  left: -62px;
  z-index: 4; /* Higher z-index to appear above glow effect */
}

.timeline-date {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.timeline-title {
  font-size: 1.35rem;
  margin-bottom: 5px;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.timeline-content:hover .timeline-title {
  color: var(--primary);
}

.timeline-company {
  display: block;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

/* Enhanced timeline header styling */
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
  padding-bottom: 18px;
  margin-bottom: 25px;
}

.timeline-header-content {
  flex: 1;
}

.timeline-logo {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 3px 3px 8px var(--shadow-2),
              -3px -3px 8px var(--shadow-1);
  margin-left: 20px;
  background-color: var(--bg);
  transition: transform 0.3s ease;
  flex-shrink: 0; /* Prevent logo from shrinking */
  display: flex;
  align-items: center;
  justify-content: center; /* Center the logo image */
}

.timeline-logo img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain; /* Ensure the image maintains its aspect ratio */
}

.timeline-content:hover .timeline-logo {
  transform: scale(1.05);
}

/* Bullet point styling */
.timeline-points {
  margin-left: 20px;
}

.timeline-points li {
  position: relative;
  margin-bottom: 16px;
  padding-left: 18px;
  transition: transform 0.2s ease;
}

.timeline-points li:hover {
  transform: translateX(3px);
}

.timeline-points li::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  left: 0;
  top: 8px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.timeline-points li:hover::before {
  transform: scale(1.3);
  background-color: var(--secondary);
}

.timeline-details {
  margin-bottom: 15px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

/* Skill button styling for timeline tags */
.timeline-tag {
  padding: 6px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary);
  box-shadow: 2px 2px 5px var(--shadow-2),
              -2px -2px 5px var(--shadow-1);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.timeline-tag:hover {
  transform: translateY(-2px);
  color: var(--secondary);
  box-shadow: 3px 3px 7px var(--shadow-2),
              -3px -3px 7px var(--shadow-1),
              0 0 8px rgba(var(--primary-rgb), 0.5);
}

/* Add subtle icon to the skill tags */
.timeline-tag i {
  font-size: 0.9rem;
  opacity: 0.8;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.timeline-tag:hover i {
  transform: rotate(10deg) scale(1.2);
  opacity: 1;
}

/* Timeline content hover effect for skill tags */
.timeline-content:hover .timeline-tag {
  animation: gentle-bounce 0.6s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.1s);
}

/* === PROJECTS SECTION === */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  /* Add consistent max-width similar to certification grid */
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.project-card {
  background: var(--bg);
  border-radius: var(--radius-md);
  /* Changed from overflow: hidden to visible to show the glow effect */
  overflow: visible;
  box-shadow: 5px 5px 15px var(--shadow-2),
              -5px -5px 15px var(--shadow-1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

/* project-card hover effect */
.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 8px 8px 20px var(--shadow-2),
              -8px -8px 20px var(--shadow-1);
}

/* Remove border line effect for project cards */
.project-card::before {
  content: none !important;
  display: none !important;
}

/* Scattered glow effect for project cards (like contact form) */
.project-card::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: transparent;
  border-radius: var(--radius-md);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  box-sizing: content-box;
  /* Initialize with the first frame of the contactGlow animation */
  box-shadow: 
    0 0 7px var(--primary),
    0 0 12px var(--primary),
    10px 0 15px var(--secondary),
    -10px 0 15px var(--accent),
    0 10px 15px var(--primary),
    0 -10px 15px var(--secondary);
}

.project-card:hover::after {
  opacity: 0.85;
  animation: contactGlow 4s linear infinite;
}

.project-image {
  height: 200px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-content {
  padding: 20px;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.project-tag {
  padding: 3px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--primary);
  box-shadow: 2px 2px 5px var(--shadow-2),
              -2px -2px 5px var(--shadow-1);
  border: 1px solid rgba(var(--primary-rgb), 0.15);
}

.project-title {
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.project-description {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  min-width: 40px;
  height: 40px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  background: var(--bg);
  transition: all 0.3s ease-out;
  box-shadow: 3px 3px 8px var(--shadow-2),
              -3px -3px 8px var(--shadow-1);
  overflow: hidden;
  text-decoration: none;
  position: relative;
  /* Start with fixed width */
  width: 40px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.project-link i {
  margin-right: 0;
  transition: margin 0.3s ease;
}

.project-link:hover {
  color: var(--primary);
  width: auto;
  padding: 0 18px;
  transform: translateY(-3px);
  box-shadow: 5px 5px 10px var(--shadow-2),
              -5px -5px 10px var(--shadow-1);
  border-color: var(--primary);
}

.project-link:hover i {
  margin-right: 8px;
}

.project-link::after {
  content: "";
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-width 0.3s ease;
}

.project-link:hover::after {
  content: attr(data-label);
  opacity: 1;
  max-width: 100px;
}

.project-link:active {
  transform: translateY(0);
  box-shadow: inset 2px 2px 5px var(--shadow-2),
              inset -2px -2px 5px var(--shadow-1);
}

/* === PROJECT LINKS ANIMATIONS === */
@keyframes linkPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
  }
}

.project-links {
  position: relative;
  z-index: 2;
}

.project-link i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.project-link:hover i {
  transform: scale(1.2);
}

/* Apply pulse animation to GitHub icon */
.project-link .fa-github {
  animation: linkPulse 2s infinite;
  animation-delay: 0.5s;
}

.project-link:active {
  box-shadow: inset 2px 2px 5px var(--shadow-2),
              inset -2px -2px 5px var(--shadow-1);
  transform: translateY(0);
}

/* === PROJECT LINKS ANIMATIONS === */
@keyframes linkPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
  }
}

.project-links {
  position: relative;
  z-index: 2;
}

.project-link i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.project-link:hover i {
  transform: scale(1.2);
}

/* Apply pulse animation to GitHub icon */
.project-link .fa-github {
  animation: linkPulse 2s infinite;
  animation-delay: 0.5s;
}

/* === CONTACT SECTION === */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-heading h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: var(--bg);
  box-shadow: 3px 3px 8px var(--shadow-2),
              -3px -3px 8px var(--shadow-1);
}

.social-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.social-link {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  background: var(--bg);
  transition: all 0.3s ease;
  box-shadow: 4px 4px 10px var(--shadow-2),
              -4px -4px 10px var(--shadow-1);
}

.social-link i {
  font-size: 1.5rem;
}

.social-link:hover {
  color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 6px 6px 12px var(--shadow-2),
              -6px -6px 12px var(--shadow-1);
}

.contact-form {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: 5px 5px 15px var(--shadow-2),
              -5px -5px 15px var(--shadow-1);
  position: relative;
  transition: transform 0.3s ease;
  z-index: 1;
}

.form-group {
  margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  outline: none;
  box-shadow: inset 3px 3px 8px var(--shadow-2),
              inset -3px -3px 8px var(--shadow-1);
  transition: box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  box-shadow: inset 4px 4px 10px var(--shadow-2),
              inset -4px -4px 10px var(--shadow-1);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* Contact form scattered glow effect */
.contact-form::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  background: transparent;
  border-radius: var(--radius-md);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.contact-form:hover {
  transform: translateY(-5px);
}

.contact-form:hover::before {
  opacity: 0.85;
  animation: contactGlow 4s linear infinite;
}

@keyframes contactGlow {
  0% {
    box-shadow: 
      0 0 7px var(--primary),
      0 0 12px var(--primary),
      10px 0 15px var(--secondary),
      -10px 0 15px var(--accent),
      0 10px 15px var(--primary),
      0 -10px 15px var(--secondary);
  }
  33% {
    box-shadow: 
      0 0 7px var(--secondary),
      0 0 12px var(--secondary),
      -8px 0 12px var(--primary),
      8px 0 12px var(--accent),
      0 -8px 12px var(--primary),
      0 8px 12px var(--secondary);
  }
  66% {
    box-shadow: 
      0 0 7px var(--accent),
      0 0 12px var(--accent),
      8px 0 15px var(--primary),
      -8px 0 15px var(--secondary),
      0 8px 15px var(--accent),
      0 -8px 15px var(--primary);
  }
  100% {
    box-shadow: 
      0 0 7px var(--primary),
      0 0 12px var(--primary),
      10px 0 15px var(--secondary),
      -10px 0 15px var(--accent),
      0 10px 15px var(--primary),
      0 -10px 15px var(--secondary);
  }
}

/* === FOOTER === */
footer {
  padding: 40px 0;
  background: var(--bg);
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

footer:hover {
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.08);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  transition: transform 0.3s ease, text-shadow 0.3s ease;
  cursor: pointer;
}

.footer-logo:hover {
  transform: translateY(-2px);
  text-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.4);
}

.footer-links ul {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 1rem;
  color: var(--text-color);
  position: relative;
  padding: 0.5rem 0;
}

.footer-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-links a:hover::after {
  width: 100%;
}

.copyright {
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  font-size: 0.9rem;
}

.copyright {
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

/* === MEDIA QUERIES === */
@media (max-width: 992px) {
  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
  }
  
  .hero-intro {
    max-width: 100%;
  }
  
  .section-title::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .cta-buttons {
    justify-content: center;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
  }
  
  .about-image {
    max-width: 350px;
    margin: 0 auto;
  }
  
  .contact-container {
    grid-template-columns: 1fr;
  }
  
  .timeline-item .timeline-content {
    width: 85%;
    max-width: 100%;
    margin-left: 80px;
  }
  
  .timeline-line {
    left: 40px;
  }
  
  .timeline-content::before {
    left: -40px;
  }
  
  .timeline-connector {
    left: -25px;
    width: 25px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 80%;
    height: calc(100vh - var(--header-height));
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    gap: 2.5rem;
  }
  
  .nav-links.active {
    left: 0;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  
  .menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  
  .footer-links ul {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .certification-content {
    flex-direction: column;
    align-items: left;
    text-align: left;
    padding: 25px 20px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
  }
  
  .certification-logo {
    margin-bottom: 15px;
    width: 70px;
    height: 70px;
  }
  
  .certification-badge {
    position: relative;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    opacity: 0.6;
    right: auto;
    top: auto;
    font-size: 1.6rem;
  }
  
  .certification-info {
    width: 100%;
  }
  
  .certification-tags {
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
    width: 100%;
  }
  
  .certification-content .timeline-tag {
    padding: 5px 10px;
    font-size: 0.8rem;
    display: inline-flex;
    flex-grow: 0;
    margin-bottom: 5px;
  }
  
  .certification-verify {
    text-align: left;
    margin: 15px auto;
    width: 100%;
  }
  
  /* Ensure glow effects don't get cut off on mobile */
  .certification-content::after {
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
  }
}

@media (max-width: 480px) {
  .certifications-grid {
    gap: 1.5rem;
  }
  
  .certification-content {
    padding: 20px 15px;
    box-shadow: 4px 4px 12px var(--shadow-2),
                -4px -4px 12px var(--shadow-1);
  }
  
  .certification-content:hover {
    transform: translateY(-5px); /* Less aggressive lift on mobile */
  }
  
  .certification-logo {
    width: 60px;
    height: 60px;
  }
  
  .certification-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    line-height: 1.4;
    /* Better text wrapping on small screens */
    overflow-wrap: break-word;
    word-wrap: break-word;
    -ms-word-break: break-all;
    word-break: break-word;
  }
  
  .certification-description {
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.5;
  }
  
  .certification-date {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }
  
  .verify-button {
    padding: 7px 12px;
    font-size: 0.85rem;
    width: auto;
    margin: 0 auto;
    display: inline-flex;
  }
  
  /* Fix tag layout on small screens */
  .certification-content .timeline-tag {
    padding: 4px 8px;
    font-size: 0.75rem;
    margin: 3px;
  }
  
  /* Projects grid on mobile */
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  /* Projects card on mobile */
  .project-card {
    width: 100%;
    margin-bottom: 1rem;
  }
}
  
  .timeline-tag {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
  
  .verify-button {
    padding: 6px 12px;
    font-size: 0.85rem;
  }


/* === CERTIFICATIONS SECTION === */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Explicitly set to two columns */
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.certification-card {
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
}

.certification-content {
  display: flex;
  align-items: flex-start;
  padding: 30px;
  gap: 25px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: visible; /* Change from hidden to visible to show glow effect */
  border-radius: var(--radius-md);
  width: 100%; /* Ensure full width */
  box-sizing: border-box; /* Include padding in width calculation */
}

/* Border line effect for certification cards */
.certification-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-md);
  padding: 2px;
  background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent));
  -webkit-mask: 
     linear-gradient(#fff 0 0) content-box, 
     linear-gradient(#fff 0 0);
  mask: 
     linear-gradient(#fff 0 0) content-box, 
     linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.certification-content:hover {
  transform: translateY(-8px);
  box-shadow: 8px 8px 20px var(--shadow-2),
              -8px -8px 20px var(--shadow-1);
  z-index: 5; /* Ensure hovered card appears above others */
}

.certification-content:hover::before {
  opacity: 1;
}

/* Certificate logo styling */
.certification-logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 3px 3px 8px var(--shadow-2),
              -3px -3px 8px var(--shadow-1);
  background-color: var(--bg);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.certification-logo img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}

.certification-content:hover .certification-logo {
  transform: scale(1.05);
}

/* Certificate info styling */
.certification-info {
  flex: 1;
  position: relative;
}

.certification-title {
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.certification-content:hover .certification-title {
  color: var(--primary);
}

.certification-date {
  display: block;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.certification-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

.certification-verify {
  margin: 15px 0;
  text-align: left;
}

.verify-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  padding: 8px 15px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 3px 3px 6px var(--shadow-2), -3px -3px 6px var(--shadow-1);
  position: relative;
  z-index: 2; /* Increased z-index to ensure button is clickable */
  overflow: visible; /* Ensure glow effects are visible */
}

.verify-button i {
  margin-right: 8px;
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.verify-button:hover {
  transform: translateY(-3px);
  box-shadow: 4px 4px 10px var(--shadow-2), -4px -4px 10px var(--shadow-1),
              0 0 8px rgba(var(--primary-rgb), 0.5);
  background: var(--secondary);
}

.verify-button:hover i {
  transform: rotate(10deg) scale(1.1);
}

.verify-button:active {
  transform: translateY(-1px);
  box-shadow: 2px 2px 5px var(--shadow-2), -2px -2px 5px var(--shadow-1);
}

/* Dark mode specific enhancements */
[data-theme="dark"] .verify-button {
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5), -2px -2px 8px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .verify-button:hover {
  box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.6), -3px -3px 12px rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.certification-badge {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 1.8rem;
  color: var(--primary);
  opacity: 0.3;
  transition: all 0.3s ease;
  z-index: 2;
}

.certification-content:hover .certification-badge {
  opacity: 0.7;
  transform: scale(1.1) rotate(5deg);
}

/* Certificate glow effect */
.certification-content {
  position: relative;
  z-index: 1;
}

.certification-content::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  background: transparent;
  border-radius: var(--radius-md);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

/* Certification glow animation removed
@keyframes certificationGlow {
  0% {
    box-shadow: 
      0 0 7px var(--primary),
      0 0 12px var(--primary),
      10px 0 15px var(--secondary),
      -10px 0 15px var(--accent),
      0 10px 15px var(--primary),
      0 -10px 15px var(--secondary);
  }
  33% {
    box-shadow: 
      0 0 7px var(--secondary),
      0 0 12px var(--secondary),
      -8px 0 12px var(--primary),
      8px 0 12px var(--accent),
      0 -8px 12px var(--primary),
      0 8px 12px var(--secondary);
  }
  66% {
    box-shadow: 
      0 0 7px var(--accent),
      0 0 12px var(--accent),
      8px 0 15px var(--primary),
      -8px 0 15px var(--secondary),
      0 8px 15px var(--accent),
      0 -8px 15px var(--primary);
  }
  100% {
    box-shadow: 
      0 0 7px var(--primary),
      0 0 12px var(--primary),
      10px 0 15px var(--secondary),
      -10px 0 15px var(--accent),
      0 10px 15px var(--primary),
      0 -10px 15px var(--secondary);
  }
}
*/

/* Certificate tags styling */
.certification-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

/* Reusing the timeline-tag styling for certification tags */
.certification-content:hover .timeline-tag {
  animation: gentle-bounce 0.6s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.1s);
}

/* Timeline glow animation - for experience timeline cards */
@keyframes timelineGlow {
  0% {
    box-shadow: 
      0 0 7px var(--primary),
      0 0 12px var(--primary),
      10px 0 15px var(--secondary),
      -10px 0 15px var(--accent),
      0 10px 15px var(--primary),
      0 -10px 15px var(--secondary);
  }
  33% {
    box-shadow: 
      0 0 7px var(--secondary),
      0 0 12px var(--secondary),
      -8px 0 12px var(--primary),
      8px 0 12px var(--accent),
      0 -8px 12px var(--primary),
      0 8px 12px var(--secondary);
  }
  66% {
    box-shadow: 
      0 0 7px var(--accent),
      0 0 12px var(--accent),
      8px 0 15px var(--primary),
      -8px 0 15px var(--secondary),
      0 8px 15px var(--accent),
      0 -8px 15px var(--primary);
  }
  100% {
    box-shadow: 
      0 0 7px var(--primary),
      0 0 12px var(--primary),
      10px 0 15px var(--secondary),
      -10px 0 15px var(--accent),
      0 10px 15px var(--primary),
      0 -10px 15px var(--secondary);
  }
}

@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Consistent mobile styles for certification and badge cards */
@media (max-width: 768px) {
  .certifications-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    width: 100%;
    max-width: 100%;
  }
  
  .certification-content {
    width: 100%;
    max-width: 100%;
  }
  
  /* More consistent width between experience and certification cards on mobile */
  .certification-card {
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Ensure certificates similar to experience timeline on smaller screens */
  .certification-content {
    width: calc(100% - 20px);
    margin-left: 10px;
    margin-right: 10px;
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  .certification-content {
    padding: 18px 12px;
  }
  
  .certification-logo {
    width: 50px;
    height: 50px;
  }
  
  .certification-badge {
    font-size: 1.4rem;
  }
  
  .certification-verify {
    margin: 10px auto;
  }
  
  .verify-button {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .verify-button i {
    font-size: 0.8rem;
  }
  
  .certification-title {
    font-size: 1rem;
  }
}

/* Prevent layout shift on mobile load */
.certifications-grid {
  min-height: 200px;
}

/* === CERTIFICATION GRID FIX === */
/* This overrides all previous certification grid styles */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 768px) {
  .certifications-grid {
    grid-template-columns: 1fr;
  }
}

/* reCAPTCHA styling */
.g-recaptcha {
  transform: scale(0.85);
  transform-origin: 0 0;
  margin-bottom: 15px;
  box-shadow: 3px 3px 8px var(--shadow-2),
              -3px -3px 8px var(--shadow-1);
  border-radius: var(--radius-sm);
  padding: 5px;
  display: inline-block;
}

/* Popup Message Styles */
.popup-message {
  position: fixed;
  top: 90px; /* Position below navigation bar */
  right: 25px;
  transform: translateX(100px) scale(0.95);
  z-index: 10000;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 380px;
  width: auto;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
}

.popup-message.show {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .popup-message {
    top: 70px;
    right: 15px;
    left: 15px;
    width: auto;
    max-width: none;
  }
}

.popup-content {
  position: relative;
  padding: 18px 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-radius: 12px;
  background-color: var(--card-bg);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08), 0 3px 8px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(15px);
  border: 2px solid transparent;
  animation: popup-glow 4s infinite alternate;
  min-width: 320px;
}

@keyframes popup-glow {
  0% {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08), 0 3px 5px rgba(0, 0, 0, 0.04);
  }
  100% {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
  }
}

.popup-message.success .popup-content {
  border: 3px solid #28a745;
}

.popup-message.success {
  filter: drop-shadow(0 10px 15px rgba(40, 167, 69, 0.1));
}

.popup-message.error .popup-content {
  /* border: 3px solid #dc3545; */
  border: 3px solid #dc3545;
}

.popup-message.error {
  filter: drop-shadow(0 10px 15px rgba(220, 53, 69, 0.1));
}

.popup-icon {
  margin-right: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  animation: popup-icon-pulse 2s infinite;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

@keyframes popup-icon-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(var(--primary-rgb), 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
  }
}

.popup-icon.success {
  background: linear-gradient(145deg, #23c264, #29d873);
  color: white;
}

.popup-icon.error {
  background: linear-gradient(145deg, #d92c3a, #e34b58);
  color: white;
}

.popup-icon i {
  font-size: 24px;
  transform-origin: center;
}

.popup-icon.success i {
  animation: success-check 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.popup-icon.error i {
  animation: error-shake 1s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes success-check {
  0% {
    transform: scale(0) rotate(45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  70% {
    transform: scale(0.9) rotate(0deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes error-shake {
  0%, 100% {
    transform: translateX(0);
  }
  20%, 60% {
    transform: translateX(-6px);
  }
  40%, 80% {
    transform: translateX(6px);
  }
}

@keyframes scale-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.popup-text {
  flex: 1;
}

.popup-text h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  background: linear-gradient(to right, var(--primary), #8a2be2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-glow 4s infinite alternate;
}

@keyframes text-glow {
  0% { filter: drop-shadow(0 0 0px rgba(var(--primary-rgb), 0)); }
  100% { filter: drop-shadow(0 0 2px rgba(var(--primary-rgb), 0.5)); }
}

.popup-message.error .popup-text h3 {
  background: linear-gradient(to right, #dc3545, #ff6b6b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.popup-text p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-color);
  opacity: 0.9;
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 50%;
  transition: all 0.2s;
  padding: 0;
  backdrop-filter: blur(5px);
  background-color: rgba(0, 0, 0, 0.05);
}

.popup-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: var(--primary);
  transform: rotate(90deg);
}

[data-theme="dark"] .popup-close {
  background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .popup-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.popup-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

[data-theme="dark"] .popup-progress-bar {
  background-color: rgba(255, 255, 255, 0.08);
}

.popup-progress {
  height: 100%;
  width: 100%;
  background-color: #28a745;
  position: relative;
  overflow: hidden;
}

.popup-message.error .popup-progress {
  background-color: #ff0008;
}

@media (max-width: 768px) {
  .popup-message {
    width: 85%;
    max-width: 320px;
  }
}
/* Form validation styles */
.form-group {
  position: relative;
  margin-bottom: 20px;
}

.form-group input.invalid,
.form-group textarea.invalid {
  border-color: #ff3860;
  box-shadow: 0 0 0 2px rgba(255, 56, 96, 0.2);
}

.error-message {
  color: #ff3860;
  font-size: 0.8rem;
  margin-top: 5px;
  transition: all 0.3s ease;
}

/* Shake animation for invalid inputs */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-group input.invalid:focus,
.form-group textarea.invalid:focus {
  animation: shake 0.5s;
}

/* Dark mode tooltip styling */
.theme-tooltip {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
  z-index: 1000;
  max-width: 200px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  animation: fadeIn 0.3s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-tooltip p {
  margin: 0;
  flex-grow: 1;
}

.theme-tooltip .tooltip-close {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0 0 0 10px;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.theme-tooltip .tooltip-close:hover {
  opacity: 1;
}

.theme-tooltip.hide {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Dark mode discovery tooltip */
.dark-mode-discovery {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary);
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  max-width: 280px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none; 
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: flex;
  flex-direction: column;
}

.dark-mode-discovery.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  animation: pulse-soft 2s infinite;
}

.dark-mode-discovery .tooltip-content {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.dark-mode-discovery .tooltip-icon {
  margin-right: 10px;
  font-size: 1.2rem;
  color: white;
}

.dark-mode-discovery .tooltip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 5px;
}

.dark-mode-discovery .tooltip-button {
  background: rgba(255, 255, 255, 0.85);
  border: none;
  color: var(--primary);
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.dark-mode-discovery .tooltip-button:hover {
  background: white;
}

.dark-mode-discovery .tooltip-dismiss {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
}

.dark-mode-discovery .tooltip-dismiss:hover {
  background: rgba(255, 255, 255, 0.15);
}

@keyframes pulse-soft {
  0% {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 5px 25px rgba(var(--primary-rgb), 0.5);
  }
  100% {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  }
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--bg);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 99;
  box-shadow: 5px 5px 15px var(--shadow-2),
              -5px -5px 15px var(--shadow-1);
}

.back-to-top:hover {
  color: var(--secondary);
  transform: translateY(-5px);
}

/* Dark theme specific styles for back-to-top */
[data-theme="dark"] .back-to-top {
  box-shadow: 3px 3px 10px var(--shadow-2),
              -2px -2px 10px var(--shadow-1);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  animation: soft-bounce 1s ease;
}

@keyframes soft-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.back-to-top i {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.back-to-top:hover i {
  transform: translateY(-3px);
}