/* Modern Design Improvements for Felipe Chavarro Website */
/* Professional, clean, and sophisticated design system */

/* ============================================ */
/* 1. TYPOGRAPHY IMPROVEMENTS */
/* ============================================ */

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1a202c 0%, #3182ce 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.hero-title span:not(:first-child) {
  display: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', 'Roboto', Arial, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: #1a202c;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  position: relative;
  padding-bottom: 1rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, #3182ce 0%, #4299e1 100%);
  border-radius: 9999px;
}

/* ============================================ */
/* 2. LAYOUT & SPACING IMPROVEMENTS */
/* ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

section {
  padding: 5rem 0;
  position: relative;
}

@media (max-width: 768px) {
  section {
    padding: 3rem 0;
  }
}

section:nth-child(even) {
  background: #f8fafc;
}

.card {
  background: white;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f1f5f9;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #3182ce;
}

@media (max-width: 768px) {
  .card {
    padding: 1.5rem;
  }
}

/* ============================================ */
/* 3. NAVIGATION IMPROVEMENTS */
/* ============================================ */

.navbar, nav {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 30;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled, nav.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.95) !important;
}

.nav-link {
  color: #1a202c !important;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: calc(100% - 2rem);
  height: 3px;
  background: linear-gradient(135deg, #3182ce 0%, #4299e1 100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::before,
.nav-link.active::before {
  transform: translateX(-50%) scaleX(1);
}

.nav-link:hover,
.nav-link.active {
  color: #3182ce !important;
}

/* ============================================ */
/* 4. STATISTICS FIX */
/* ============================================ */

.stats-counter {
  display: flex;
  gap: 3rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #3182ce;
  display: block;
  line-height: 1;
  margin-bottom: 0.5rem;
  position: relative;
}

.stat-number::after {
  font-size: 1.5rem;
  color: #4a5568;
  margin-left: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 768px) {
  .stats-counter {
    gap: 2rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
}

/* ============================================ */
/* 5. BUTTON IMPROVEMENTS */
/* ============================================ */

.btn {
  padding: 0.875rem 2rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: none;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #3182ce 0%, #4299e1 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(49, 130, 206, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(49, 130, 206, 0.4);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid #3182ce;
  color: #3182ce;
}

.btn-outline:hover {
  background: #3182ce;
  color: white;
  transform: translateY(-2px);
}

/* ============================================ */
/* 6. HERO SECTION IMPROVEMENTS */
/* ============================================ */

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(49, 130, 206, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(56, 161, 105, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(221, 107, 32, 0.1) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: white;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  font-size: 0.875rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-description {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(1deg); }
  66% { transform: translateY(10px) rotate(-1deg); }
}

/* ============================================ */
/* 7. EXPERIENCE CARDS IMPROVEMENTS */
/* ============================================ */

.experience-card {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 3rem;
}

.experience-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(135deg, #3182ce 0%, #4299e1 100%);
  border-radius: 9999px;
}

.experience-card::after {
  content: '';
  position: absolute;
  left: -6px;
  top: 1.5rem;
  width: 15px;
  height: 15px;
  background: #3182ce;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.experience-header h3 {
  color: #1a202c;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.company {
  color: #3182ce;
  font-weight: 600;
}

.period {
  color: #4a5568;
  font-size: 0.875rem;
  background: #f1f5f9;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.experience-description {
  color: #4a5568;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.experience-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: rgba(49, 130, 206, 0.1);
  color: #3182ce;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ============================================ */
/* 8. SKILLS VISUALIZATION */
/* ============================================ */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.skill-category {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.skill-category h4 {
  color: #1a202c;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-category h4 i {
  color: #3182ce;
}

.skill-item {
  margin-bottom: 1rem;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.skill-name {
  font-weight: 500;
  color: #1a202c;
}

.skill-level {
  font-size: 0.875rem;
  color: #3182ce;
  font-weight: 600;
}

.skill-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(135deg, #3182ce 0%, #4299e1 100%);
  border-radius: 9999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.skill-progress::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============================================ */
/* 9. RESPONSIVE IMPROVEMENTS */
/* ============================================ */

@media (max-width: 768px) {
  .navbar, nav {
    padding: 1rem;
  }
  
  .navbar-toggler {
    border: none;
    padding: 0.5rem;
  }
  
  .navbar-toggler:focus {
    box-shadow: none;
  }
  
  .navbar-collapse {
    background: white;
    margin: 1rem -1rem -1rem;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
  }
  
  .hero-section {
    padding: 2rem 1rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .card {
    margin-bottom: 1.5rem;
  }
  
  .experience-card {
    padding-left: 2rem;
  }
  
  .experience-header {
    flex-direction: column;
  }
  
  .period {
    align-self: flex-start;
  }
}

/* ============================================ */
/* 10. DARK MODE SUPPORT */
/* ============================================ */

[data-theme="dark"] {
  background: #1a202c;
  color: #f1f5f9;
}

[data-theme="dark"] .navbar,
[data-theme="dark"] nav {
  background: rgba(26, 32, 44, 0.98) !important;
}

[data-theme="dark"] .nav-link {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
  color: #3182ce !important;
}

[data-theme="dark"] .card {
  background: #2d3748;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: #f1f5f9;
}

[data-theme="dark"] .experience-card .experience-header h3 {
  color: #f1f5f9;
}

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

[data-theme="dark"] .skill-category {
  background: #2d3748;
}

[data-theme="dark"] .skill-category h4 {
  color: #f1f5f9;
}

[data-theme="dark"] .skill-item .skill-name {
  color: #f1f5f9;
}

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

[data-theme="dark"] section:nth-child(even) {
  background: rgba(0, 0, 0, 0.2);
}

/* ============================================ */
/* 11. ANIMATIONS & INTERACTIONS */
/* ============================================ */

html {
  scroll-behavior: smooth;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.hover-lift {
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-grow {
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================ */
/* 12. ACCESSIBILITY IMPROVEMENTS */
/* ============================================ */

*:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #3182ce;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 0 0 0.375rem 0;
  transition: top 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.skip-to-content:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================ */
/* 13. LOADING STATE */
/* ============================================ */

body:not(.loaded) .fade-in-up,
body:not(.loaded) .fade-in-left,
body:not(.loaded) .fade-in-right {
  opacity: 0;
}

body.loaded .fade-in-up,
body.loaded .fade-in-left,
body.loaded .fade-in-right {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

/* ============================================ */
/* 14. HIGH CONTRAST SUPPORT */
/* ============================================ */

@media (prefers-contrast: high) {
  .card {
    border-width: 2px;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}

/* ============================================ */
/* 15. REDUCED MOTION SUPPORT */
/* ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}