/* =========================================================
   ELEGANT REFINEMENTS - Professional & Sophisticated
   ========================================================= */

/* Modern Font Import - Elegant Serif + Clean Sans */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* =========================================================
   ROOT VARIABLES - Refined Color Palette
   ========================================================= */
:root {
  /* Sophisticated Colors */
  --color-navy: #1a1f36;
  --color-charcoal: #2d3748;
  --color-slate: #4a5568;
  --color-gray: #718096;
  --color-silver: #a0aec0;
  --color-light: #e2e8f0;
  --color-off-white: #f7fafc;
  --color-white: #ffffff;
  
  /* Elegant Accent */
  --color-accent: #667eea;
  --color-accent-light: #7f9cf5;
  --color-accent-dark: #5a67d8;
  
  /* Subtle Gradients */
  --gradient-elegant: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-subtle: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  
  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing Scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-xxl: 6rem;
  
  /* Refined Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  
  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-base: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

/* =========================================================
   GLOBAL REFINEMENTS
   ========================================================= */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--color-charcoal);
  line-height: 1.7;
  letter-spacing: -0.01em;
}

/* Elegant Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-navy);
  margin-bottom: var(--space-md);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }

p {
  margin-bottom: var(--space-md);
  color: var(--color-slate);
  line-height: 1.8;
}

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

/* =========================================================
   HEADER - Refined Hero Section
   ========================================================= */
.header {
  background: linear-gradient(135deg, #1a1f36 0%, #2d3748 100%);
  padding: var(--space-xxl) 0;
  position: relative;
  overflow: hidden;
}

/* Subtle animated background */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
  animation: subtleShift 15s ease-in-out infinite;
}

@keyframes subtleShift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

.header .container {
  position: relative;
  z-index: 1;
}

/* Social Icons - More refined */
.header .social-icons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.header .social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: all var(--transition-base);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.header .social-link:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Content */
.header-content {
  text-align: center;
  padding: var(--space-xl) 0;
}

.header-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-light);
  margin-bottom: var(--space-sm);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.header-title {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: var(--space-md);
  letter-spacing: -0.03em;
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

/* Name Highlighting - Elegant Accent */
.name-highlight {
  color: var(--color-accent);
  font-weight: 800;
}

.header-mono {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-silver);
  opacity: 0;
  animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

/* Typing Animation */
.typing-cursor {
  display: inline-block;
  margin-left: 3px;
  animation: blink 1s infinite;
  font-weight: 400;
  color: var(--color-silver);
}

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

#typed-text {
  display: inline-block;
  min-width: 0;
  text-align: left;
}

.header-mono {
  white-space: nowrap;
  overflow: visible;
}

/* Greeting Text Styling */
#greeting-full {
  display: inline-block;
  min-width: 150px;
  text-align: left;
  position: relative;
}

#greeting-full::after {
  content: '|';
  margin-left: 3px;
  animation: blink 1s infinite;
  font-weight: 400;
  color: inherit;
}

/* Elegant Fade-in Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   NAVIGATION - Clean & Refined
   ========================================================= */
.navbar {
  padding: var(--space-md) 0;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.98) !important;
  transition: all var(--transition-base);
}

.navbar.affix {
  box-shadow: var(--shadow-md);
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-slate) !important;
  padding: var(--space-xs) var(--space-md) !important;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: all var(--transition-base);
  transform: translateX(-50%);
}

.nav-link:hover {
  color: var(--color-navy) !important;
}

.nav-link:hover::after {
  width: 80%;
}

/* Brand - More elegant */
.brand-img {
  background: var(--gradient-elegant) !important;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 0;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--color-gray);
  font-weight: 400;
}

/* =========================================================
   ABOUT SECTION - Refined Cards
   ========================================================= */
.about-section {
  padding: var(--space-xxl) 0;
  background: var(--color-off-white);
}

.about-card {
  background: var(--color-white);
  padding: var(--space-xl);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 1px solid rgba(0, 0, 0, 0.04);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.about-card .row {
  margin-bottom: var(--space-sm);
}

.about-card .row:last-of-type {
  margin-bottom: 0;
}

.about-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.about-card h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  color: var(--color-navy);
}

.about-card .line {
  display: block;
  width: 50px;
  height: 3px;
  background: var(--gradient-elegant);
  border-radius: 2px;
  margin-bottom: var(--space-lg);
}

.about-card h5 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--color-charcoal);
}

.about-card p, .about-card li {
  color: var(--color-slate);
  line-height: 1.8;
}

.about-card .info li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-light);
}

.about-card .info li:last-child {
  border-bottom: none;
}

.about-card .info span {
  font-weight: 600;
  color: var(--color-navy);
  display: inline-block;
  min-width: 100px;
}

/* =========================================================
   BLOG CAROUSEL - Elegant Cards
   ========================================================= */
.blog-carousel-container {
  padding: var(--space-lg) 60px;
  position: relative;
  max-width: 100%;
  margin: 0 auto;
}

.blog-scroll-item .card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-scroll-item .card-img-top {
  height: 220px;
  object-fit: cover;
  flex-shrink: 0;
}

.blog-scroll-item .card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.blog-scroll-item .card-img-top {
  transition: all var(--transition-slow);
  height: 220px;
  object-fit: cover;
}

.blog-scroll-item .card:hover .card-img-top {
  transform: scale(1.05);
}

.blog-scroll-item .card-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-scroll-item .card-body .btn {
  margin-top: auto;
}

.blog-scroll-item .card-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}

.blog-scroll-item .card-body h3 a {
  color: var(--color-navy);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.blog-scroll-item .card-body h3 a:hover {
  color: var(--color-accent);
}

.blog-scroll-item .text-muted {
  color: var(--color-gray) !important;
  font-size: 0.9rem;
}

/* Carousel Buttons - More refined */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-white);
  border: 2px solid var(--color-navy);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: all var(--transition-base);
  z-index: 100;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-navy);
  opacity: 0.9;
}

.prev-btn {
  left: 10px;
}

.next-btn {
  right: 10px;
}

.carousel-btn:hover {
  background: var(--color-accent);
  color: var(--color-white);
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  border-color: var(--color-accent);
  opacity: 1;
}

/* =========================================================
   BUTTONS - Refined & Elegant
   ========================================================= */
.btn-primary {
  background: var(--gradient-elegant);
  border: none;
  padding: 0.75rem 1.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 8px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--color-accent-dark);
}

.btn-outline-primary {
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  background: transparent;
  padding: 0.6rem 1.5rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all var(--transition-base);
}

.btn-outline-primary:hover {
  background: var(--gradient-elegant);
  color: var(--color-white);
  border-color: transparent;
  transform: translateY(-2px);
}

/* =========================================================
   FOOTER - Clean & Minimal
   ========================================================= */
.footer {
  background: var(--color-navy);
  padding: var(--space-xl) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
  color: var(--color-silver);
  margin: 0;
}

.footer .social-links a {
  color: var(--color-silver);
  transition: all var(--transition-base);
  margin-left: var(--space-md);
}

.footer .social-links a:hover {
  color: var(--color-white);
  transform: translateY(-3px);
}

/* =========================================================
   RESUME & PROJECTS SECTION - EQUAL HEIGHT CARDS
   ========================================================= */

/* Resume Section Cards */
#resume .row > [class*="col-"] {
  display: flex;
  flex-direction: column;
}

#resume .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: var(--space-lg);
}

#resume .card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

#resume .card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Projects Section Cards */
#projects .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--color-white);
}

#projects .card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* Projects Carousel - 3D Stacked Cards */
.projects-carousel-container {
  position: relative;
  padding: 0 60px;
  margin: 0 auto;
  max-width: 100%;
  width: 100%;
  perspective: 1000px;
}

.projects-scroll-wrapper {
  display: flex;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  gap: 40px;
  padding: 40px 20px 60px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
}

.projects-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

.projects-scroll-item {
  flex: 0 0 calc(33.333% - 30px);
  min-width: 320px;
  position: relative;
  transform-style: preserve-3d;
}

/* 3D Stacked Card Effect - ALL cards get the pile look */
#projects .projects-scroll-item .card {
  height: 100%;
  min-height: 280px;
  border: none !important;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.15),
    0 5px 15px rgba(0, 0, 0, 0.1);
}

#projects .projects-scroll-item .card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Create stacked card effect with pseudo-elements */
#projects .projects-scroll-item .card::before,
#projects .projects-scroll-item .card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  z-index: -1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#projects .projects-scroll-item .card::before {
  transform: rotate(-3deg) translateY(8px) translateX(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

#projects .projects-scroll-item .card::after {
  transform: rotate(2deg) translateY(12px) translateX(3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* ===== ODD CARDS - Purple Gradient ===== */
#projects .projects-scroll-item:nth-child(odd) .card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

#projects .projects-scroll-item:nth-child(odd) .card::before {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%);
}

#projects .projects-scroll-item:nth-child(odd) .card::after {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

/* Purple card text - WHITE */
#projects .projects-scroll-item:nth-child(odd) .card-header,
#projects .projects-scroll-item:nth-child(odd) .card-body,
#projects .projects-scroll-item:nth-child(odd) .card-title,
#projects .projects-scroll-item:nth-child(odd) .card-text,
#projects .projects-scroll-item:nth-child(odd) h5,
#projects .projects-scroll-item:nth-child(odd) p,
#projects .projects-scroll-item:nth-child(odd) strong,
#projects .projects-scroll-item:nth-child(odd) .subtitle {
  color: #fff !important;
}

#projects .projects-scroll-item:nth-child(odd) .card-header.has-icon {
  background: transparent !important;
  border: none !important;
}

#projects .projects-scroll-item:nth-child(odd) .card-header.has-icon i,
#projects .projects-scroll-item:nth-child(odd) .card-header i,
#projects .projects-scroll-item:nth-child(odd) i {
  color: #fff !important;
  opacity: 1 !important;
  background: transparent !important;
  border: none !important;
  position: relative !important;
  top: 0 !important;
}

/* ===== EVEN CARDS - White ===== */
#projects .projects-scroll-item:nth-child(even) .card {
  background: #fff !important;
}

#projects .projects-scroll-item:nth-child(even) .card::before {
  background: rgba(240, 240, 245, 0.9);
}

#projects .projects-scroll-item:nth-child(even) .card::after {
  background: rgba(230, 230, 235, 0.8);
}

/* White card text - Dark */
#projects .projects-scroll-item:nth-child(even) .card-title {
  color: var(--color-navy) !important;
}

#projects .projects-scroll-item:nth-child(even) .card-text,
#projects .projects-scroll-item:nth-child(even) p {
  color: var(--color-charcoal) !important;
}

#projects .projects-scroll-item:nth-child(even) .card-header.has-icon {
  background: transparent !important;
  border: none !important;
}

#projects .projects-scroll-item:nth-child(even) .card-header.has-icon i {
  color: var(--color-primary) !important;
  background: transparent !important;
  border: none !important;
  position: relative !important;
  top: 0 !important;
}

/* ===== Hover effect - lift card from pile ===== */
#projects .projects-scroll-item .card:hover {
  transform: translateY(-15px) rotate(0deg) scale(1.02) !important;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.2),
    0 15px 30px rgba(0, 0, 0, 0.15) !important;
}

#projects .projects-scroll-item .card:hover::before {
  transform: rotate(-5deg) translateY(15px) translateX(-8px);
}

#projects .projects-scroll-item .card:hover::after {
  transform: rotate(4deg) translateY(20px) translateX(6px);
}

@media (max-width: 1200px) {
  .projects-scroll-item {
    flex: 0 0 calc(50% - 20px);
  }
}

@media (max-width: 768px) {
  .projects-scroll-item {
    flex: 0 0 100%;
  }
  
  .projects-carousel-container {
    padding: 0 40px;
  }
}

/* =========================================================
   RESPONSIVE REFINEMENTS
   ========================================================= */
@media (max-width: 768px) {
  :root {
    --space-xl: 2.5rem;
    --space-xxl: 3rem;
  }
  
  .header-title {
    font-size: 3rem;
  }
  
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
  
  .about-card {
    margin-bottom: var(--space-lg);
  }
}

/* =========================================================
   SCROLL ANIMATIONS - Subtle Fade-in
   ========================================================= */
[data-aos] {
  opacity: 0;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

[data-aos].aos-animate {
  opacity: 1;
}
