/* Enhanced Styles for Ajay Khanna's Portfolio */

/* Flip Card Styles */
.flip-card {
  background-color: transparent;
  perspective: 1000px;
  height: 400px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Stat Card Hover Effects */
.stat-card {
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.2);
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease-out;
}

/* Progress Bar Glow Effect */
#progress-bar {
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Navigation Bar Enhancement */
nav {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

/* Button Hover Effects */
.group:hover svg {
  transform: translateX(4px);
}

/* Custom Gradient Text */
.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}

/* Particle Container */
#particles-js {
  width: 100%;
  height: 100%;
}

/* Hero Section Enhancements */
#hero {
  position: relative;
  min-height: 100vh;
}

/* Scroll Indicator Animation */
@keyframes bounce {

  0%,
  100% {
    transform: translateY(0) translateX(-50%);
  }

  50% {
    transform: translateY(-10px) translateX(-50%);
  }
}

.animate-bounce {
  animation: bounce 2s infinite;
}

/* Glassmorphism Effects */
.backdrop-blur-md {
  backdrop-filter: blur(12px);
}

/* Card Transitions */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Shadow Effects */
.shadow-2xl {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.shadow-3xl {
  box-shadow: 0 35px 60px -15px rgba(0, 0, 0, 0.3);
}

/* Responsive Typography */
@media (max-width: 768px) {
  .flip-card {
    height: 350px;
  }

  #hero h1 {
    font-size: 2.5rem;
  }

  #typed-output {
    font-size: 1.5rem;
  }
}

/* Loading States */
.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Focus States for Accessibility */
a:focus,
button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print Styles */
@media print {

  #particles-js,
  #progress-bar,
  nav {
    display: none;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b82f6, #8b5cf6);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2563eb, #7c3aed);
}

/* Hover Effect for Cards */
.hover\:shadow-2xl:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Z-index Management */
.z-10 {
  z-index: 10;
}

.z-50 {
  z-index: 50;
}

/* Gradient Backgrounds */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

/* Transform Effects */
.transform {
  transform: translateZ(0);
}

.hover\:scale-105:hover {
  transform: scale(1.05);
}

.hover\:scale-110:hover {
  transform: scale(1.10);
}

.hover\:-translate-y-2:hover {
  transform: translateY(-0.5rem);
}

/* Transition Durations */
.duration-300 {
  transition-duration: 300ms;
}

.duration-500 {
  transition-duration: 500ms;
}

.duration-1000 {
  transition-duration: 1000ms;
}

/* Opacity Transitions */
.opacity-75 {
  opacity: 0.75;
}

.hover\:opacity-100:hover {
  opacity: 1;
}

/* Rounded Corners */
.rounded-2xl {
  border-radius: 1rem;
}

.rounded-full {
  border-radius: 9999px;
}

/* Enhanced Particle Background */
#particles-js canvas {
  display: block;
  vertical-align: bottom;
}

/* ====================
   Floating Action Button (FAB) Styles
   ==================== */

/* FAB Container */
.fab-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

/* Main FAB Button */
.fab-main {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.fab-main:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.6);
}

.fab-main:active {
  transform: scale(0.95);
}

.fab-main.active {
  transform: rotate(45deg);
}

.fab-icon {
  width: 28px;
  height: 28px;
  color: white;
  transition: transform 0.3s ease;
}

/* FAB Actions Container */
.fab-actions {
  position: absolute;
  bottom: 80px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(20px);
}

.fab-actions.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Individual FAB Action Button */
.fab-action {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
  animation: fab-slide-in 0.3s ease forwards;
  opacity: 0;
}

.fab-action:nth-child(1) {
  animation-delay: 0.05s;
}

.fab-action:nth-child(2) {
  animation-delay: 0.1s;
}

.fab-action:nth-child(3) {
  animation-delay: 0.15s;
}

.fab-action:nth-child(4) {
  animation-delay: 0.2s;
}

@keyframes fab-slide-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fab-action svg {
  width: 24px;
  height: 24px;
  color: #3b82f6;
}

.fab-action:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.fab-action:active {
  transform: scale(0.95);
}

/* FAB Tooltip */
.fab-tooltip {
  position: absolute;
  right: 70px;
  background: rgba(17, 24, 39, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-weight: 500;
}

.fab-action:hover .fab-tooltip {
  opacity: 1;
}

.fab-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: rgba(17, 24, 39, 0.9);
}

/* Social Links Menu */
.fab-social-menu {
  position: absolute;
  bottom: 80px;
  right: 0;
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-social-menu.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.fab-social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #1f2937;
  transition: all 0.2s ease;
  font-weight: 500;
}

.fab-social-link:hover {
  background: #f3f4f6;
  transform: translateX(4px);
}

.fab-social-link svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.fab-social-link:nth-child(1) svg {
  color: #4285f4;
}

/* Scholar - Blue */
.fab-social-link:nth-child(2) svg {
  color: #a6ce39;
}

/* ORCID - Green */
.fab-social-link:nth-child(3) svg {
  color: #181717;
}

/* GitHub - Black */
.fab-social-link:nth-child(4) svg {
  color: #0a66c2;
}

/* LinkedIn - Blue */
.fab-social-link:nth-child(5) svg {
  color: #000000;
}

/* X/Twitter - Black */

.fab-social-link span {
  font-size: 14px;
}

/* Responsive FAB */
@media (max-width: 768px) {
  .fab-container {
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .fab-main {
    width: 56px;
    height: 56px;
  }

  .fab-icon {
    width: 24px;
    height: 24px;
  }

  .fab-action {
    width: 48px;
    height: 48px;
  }

  .fab-action svg {
    width: 20px;
    height: 20px;
  }

  .fab-tooltip {
    font-size: 12px;
    padding: 6px 10px;
  }

  .fab-social-menu {
    min-width: 180px;
    right: auto;
    left: 0;
  }
}

/* Accessibility */
.fab-main:focus-visible,
.fab-action:focus-visible,
.fab-social-link:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Animation for backdrop */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ============================================
   Publication Timeline Styles
   ============================================ */

.publication-timeline-container {
  width: 100%;
  overflow-x: auto;
  padding: 20px 0;
}

.publication-timeline {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-width: fit-content;
  padding: 0 20px;
}

.timeline-year {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  min-width: 100px;
}

.timeline-year:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
  border-color: #60a5fa;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.timeline-year.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: #1d4ed8;
  color: white;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.timeline-year.active .year-label,
.timeline-year.active .year-count {
  color: white;
}

.year-label {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.5px;
}

.year-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  background: rgba(255, 255, 255, 0.7);
  padding: 4px 12px;
  border-radius: 12px;
  min-width: 30px;
  text-align: center;
}

.timeline-year.active .year-count {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

/* Publication Item Animations */
.publication-item {
  transition: all 0.3s ease-in-out;
  opacity: 1;
  transform: scale(1);
}

.publication-item.hidden {
  display: none;
  opacity: 0;
  transform: scale(0.95);
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Responsive Timeline */
@media (max-width: 768px) {
  .publication-timeline {
    justify-content: flex-start;
    gap: 8px;
  }

  .timeline-year {
    min-width: 80px;
    padding: 12px 16px;
  }

  .year-label {
    font-size: 1rem;
  }

  .year-count {
    font-size: 0.75rem;
    padding: 2px 8px;
  }
}

/* ============================================
   Collaboration Map Styles
   ============================================ */

#collaboration-map {
  height: 500px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 2px solid #e2e8f0;
}

.collaboration-section {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  padding: 60px 0;
  margin: 40px 0;
}

.map-popup {
  font-family: 'Inter', system-ui, sans-serif;
  max-width: 280px;
}

.map-popup h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.map-popup p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 4px 0;
}

.map-popup .publication-count {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
}

/* Map Legend Styles */
.map-legend {
  min-width: 140px;
}

.map-legend button:active {
  transform: scale(0.98);
}

/* ============================================
   Project Filter Styles
   ============================================ */

.project-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-btn {
  padding: 10px 20px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.875rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #3b82f6;
}

.filter-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.project-item {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}

.project-item.filtered-out {
  display: none;
  opacity: 0;
  transform: scale(0.8);
}

@media (max-width: 640px) {
  .project-filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
}