/* =========================================
   Premium Dark Portfolio for .NET Engineer
   ========================================= */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0f1626;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --glass-bg: rgba(15, 22, 38, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.2;
}

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

ul {
  list-style: none;
}

/* Typography */
.section-title {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  text-align: center;
}

.section-title span {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Layout Utilities */
.section {
  padding: 100px 5%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Glassmorphism Components */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 20px 5%;
  z-index: 1000;
  transition: var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(10px);
  padding: 15px 5%;
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
}

.logo-bracket {
  color: var(--text-muted);
}

.logo-text {
  color: var(--text-main);
}

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

.nav-links li a {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-links li a:hover {
  color: var(--accent-blue);
}

.btn-contact {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  padding: 8px 16px;
  border-radius: 20px;
  color: #fff !important;
}

.btn-contact:hover {
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-2px);
}

.hamburger {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  border: none;
}

.btn-primary:hover {
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-3px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-3px);
  border-color: var(--text-muted);
}

.btn-large {
  padding: 16px 40px;
  font-size: 1.1rem;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 120px;
}

.hero-content {
  flex: 1;
  padding: 40px;
  max-width: 600px;
  z-index: 2;
}

.greeting {
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.name {
  font-size: 4.5rem;
  margin-bottom: 10px;
}

.role {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.role span {
  color: var(--accent-purple);
}

.summary {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.cta-group {
  display: flex;
  gap: 15px;
}

/* Hero Graphics */
.hero-graphics {
  flex: 1;
  position: relative;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.cube {
  position: absolute;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid var(--accent-blue);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: var(--accent-blue);
  backdrop-filter: blur(5px);
  transform-style: preserve-3d;
  animation: float-3d 8s ease-in-out infinite;
}

.cube-1 { top: 10%; left: 20%; animation-delay: 0s; width: 60px; height: 60px; font-size: 1.5rem; }
.cube-2 { top: 40%; right: 10%; animation-delay: 2s; width: 100px; height: 100px; font-size: 2.5rem; border-color: var(--accent-purple); color: var(--accent-purple); }
.cube-3 { bottom: 20%; left: 30%; animation-delay: 4s; }

@keyframes float-3d {
  0% { transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  33% { transform: translateY(-30px) rotateX(20deg) rotateY(45deg) rotateZ(10deg); }
  66% { transform: translateY(10px) rotateX(-15deg) rotateY(90deg) rotateZ(-10deg); }
  100% { transform: translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
}

/* About Section */
.about-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px;
  display: flex;
  gap: 40px;
  align-items: center;
}

.about-text {
  flex: 2;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.about-text p {
  margin-bottom: 15px;
}

.about-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  border-left: 1px solid var(--glass-border);
  padding-left: 30px;
  min-width: 160px;
}

.stat-item h3 {
  font-size: 3rem;
  color: var(--accent-blue);
  margin-bottom: 5px;
}

.stat-item p {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.skill-card {
  padding: 30px;
  text-align: center;
  transition: var(--transition);
}

.skill-card:hover {
  transform: translateY(-10px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1);
}

.skill-icon {
  font-size: 2.5rem;
  color: var(--accent-purple);
  margin-bottom: 20px;
}

.skill-card h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
}

.skill-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Projects Section */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  padding: 30px;
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--glass-border);
}

.project-icon {
  font-size: 2rem;
  color: var(--accent-blue);
  margin-bottom: 20px;
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

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

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  padding: 5px 12px;
  border-radius: 12px;
}

/* Contact Section */
.contact-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 40px;
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  text-align: left;
  max-width: 1000px;
  padding: 3rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: 60px 5% 20px;
  background: var(--bg-secondary);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
}

.footer-content h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.footer-content p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  gap: 20px;
}

.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.social-icon:hover {
  background: var(--accent-blue);
  color: #fff;
  transform: translateY(-3px);
}

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

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* =============================
   MOBILE-FRIENDLY CSS ANIMATIONS
   ============================= */

/* Slide In From Left */
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

/* Slide In From Right */
.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* Zoom In (great for stat numbers and icons) */
.reveal-zoom {
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.reveal-zoom.active {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for sequential card loading */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.35s !important; }
.delay-4 { transition-delay: 0.5s !important; }

/* Floating Skill Icons */
.skill-icon {
  animation: icon-float 3s ease-in-out infinite;
}
.skill-card:nth-child(2) .skill-icon { animation-delay: 0.5s; }
.skill-card:nth-child(3) .skill-icon { animation-delay: 1s; }
.skill-card:nth-child(4) .skill-icon { animation-delay: 1.5s; }

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

/* Stat Number Bounce */
.stat-item h3 {
  animation: stat-bounce 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97);
  animation-play-state: paused;
}
.stat-item.active h3 {
  animation-play-state: running;
}
@keyframes stat-bounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.25); }
  60%  { transform: scale(0.9); }
  80%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Shimmer Glow Border on Cards (mobile tap feedback) */
@keyframes shimmer-border {
  0%   { border-color: rgba(59, 130, 246, 0.15); }
  50%  { border-color: rgba(139, 92, 246, 0.5); box-shadow: 0 0 20px rgba(139, 92, 246, 0.2); }
  100% { border-color: rgba(59, 130, 246, 0.15); }
}
.glass-card {
  animation: shimmer-border 4s ease-in-out infinite;
}

/* Section title underline draw animation */
.section-title::after {
  content: '';
  display: block;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  border-radius: 3px;
  margin: 12px auto 0;
  transition: width 1s ease 0.3s;
}
.section-title.active::after {
  width: 80px;
}

/* Wave greeting hand animation */
.fa-hand-sparkles {
  display: inline-block;
  animation: wave-hand 2.5s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave-hand {
  0%   { transform: rotate(0deg);   }
  10%  { transform: rotate(14deg);  }
  20%  { transform: rotate(-8deg);  }
  30%  { transform: rotate(14deg);  }
  40%  { transform: rotate(-4deg);  }
  50%  { transform: rotate(10deg);  }
  60%  { transform: rotate(0deg);   }
  100% { transform: rotate(0deg);   }
}

/* Project card image zoom on entry */
.project-card .project-image-wrapper img {
  transition: transform 0.5s ease;
}
.project-card:hover .project-image-wrapper img,
.project-card:active .project-image-wrapper img {
  transform: scale(1.05);
}

/* Pulse animation for CTA buttons */
.btn-primary {
  animation: pulse-btn 3s ease-in-out infinite;
}
@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
  50%       { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.15); }
}

/* Responsive Design */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 150px;
  }
  .cta-group {
    justify-content: center;
  }
  .about-container {
    flex-direction: column;
  }
  .about-stats {
    border-left: none;
    border-top: 1px solid var(--glass-border);
    padding-left: 0;
    padding-top: 30px;
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: var(--bg-secondary);
    padding: 20px 0;
    border-bottom: 1px solid var(--glass-border);
  }
  .nav-links.active {
    display: flex;
  }
  .hamburger {
    display: block;
  }
  .name {
    font-size: 3rem;
  }
  .role {
    font-size: 1.5rem;
  }
}

/* Enhancements: Animated Background & Typing Effect */
#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.cursor {
  display: inline-block;
  width: 3px;
  background-color: var(--accent-purple);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typing-text {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- NEW PREMIUM ENHANCEMENTS --- */

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  z-index: 9999;
  transition: width 0.1s ease;
  box-shadow: 0 0 10px var(--accent-purple);
}

/* Custom Cursor */
body {
  cursor: none; /* Hide default cursor */
}

a, button, .btn, .hamburger, .social-icon, .hover-lift {
  cursor: none;
}

/* Override input fields since they need the I-beam cursor */
input, textarea {
  cursor: text;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--accent-blue);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 0 10px var(--accent-blue);
  transition: width 0.2s, height 0.2s;
}

.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border: 2px solid var(--accent-purple);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Cursor Hover Effect */
.cursor-dot.hovered {
  width: 12px;
  height: 12px;
  background-color: var(--accent-purple);
  box-shadow: 0 0 15px var(--accent-purple);
}

.cursor-outline.hovered {
  width: 50px;
  height: 50px;
  background-color: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-blue);
}

/* Subtle Animated Background Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.25;
  animation: pulse-glow 8s infinite alternate;
  pointer-events: none;
  max-width: 100vw;
}
.glow-1 {
  top: -10%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: var(--accent-blue);
}
.glow-2 {
  bottom: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  animation-delay: 5s;
}

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.15; }
  100% { transform: scale(1.3); opacity: 0.35; }
}

/* Text Neon Glow on Headings */
.name {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  animation: text-flicker 4s infinite alternate;
}

@keyframes text-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.4), 0 0 30px rgba(59, 130, 246, 0.2);
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

/* --- ADDITIONAL MOBILE RESPONSIVENESS (<= 768px and <= 480px) --- */

@media (max-width: 768px) {
  /* Layout adjustments */
  .section {
    padding: 60px 15px; /* Reduce vertical padding on mobile */
  }

  .section-title {
    font-size: 2rem; /* Was 2.5rem */
    margin-bottom: 2rem;
  }

  /* Navbar adjustments */
  .nav-links {
    padding: 20px 5%;
  }

  .nav-links li {
    margin: 15px 0; /* Add vertical spacing when collapsed */
    text-align: center;
  }

  .nav-links li a {
    display: inline-block;
    width: 100%;
    padding: 10px;
    font-size: 1.1rem; /* Larger tap targets */
  }

  /* Hero Section */
  .hero {
    padding-top: 100px;
  }

  .hero-content {
    padding: 20px;
  }

  .name {
    font-size: 2.8rem;
    line-height: 1.1;
  }

  .role {
    font-size: 1.2rem;
  }

  .summary {
    font-size: 1rem;
    text-align: justify;
  }

  .cta-group {
    flex-direction: column; /* Stack buttons */
    gap: 15px;
  }
  
  .btn-large {
    width: 100%;
    text-align: center;
  }

  /* Contact Form adjustments */
  .contact-container {
    padding: 40px 20px;
  }
  
  input, textarea {
    font-size: 16px; /* Prevents auto-zoom on iOS */
  }

  /* Ensure cube animations don't overflow or block text */
  .hero-graphics {
    height: 300px;
    margin-top: 30px;
  }
  .cube-1, .cube-2, .cube-3 {
    transform: scale(0.6);
  }
  /* Force cards to stack vertically */
  .skills-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .skill-card,
  .project-card {
    width: 100%;
  }

  /* Contact section: stack info + form vertically */
  .contact-grid {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
    max-width: 100%;
  }

  /* Name + Email inputs: stack vertically */
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .name {
    font-size: 2.2rem;
  }
  .role {
    font-size: 1rem;
  }
  .section-title {
    font-size: 1.8rem;
  }
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  .cube {
    display: none;
  }
  /* Keep stats side-by-side and centered on small phones */
  .about-stats {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    padding-left: 0;
    padding-top: 20px;
    width: 100%;
    text-align: center;
  }
  .stat-item {
    min-width: 120px;
  }
}

/* Native hiding of custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  body, a, button, .btn, .hamburger, .social-icon, .hover-lift {
    cursor: auto;
  }
  .cursor-dot, .cursor-outline {
    display: none !important;
  }
}
