/* Modern Portfolio Styles - Inspirational & Attractive Design */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --tech-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --dark-gradient: linear-gradient(135deg, #232526 0%, #414345 100%);
  
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #f5576c;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --border-light: #e5e7eb;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
  
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(to bottom, #f7fafc, #edf2f7);
  overflow-x: hidden;
  padding-top: 80px;
}

/* Animated Background */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  opacity: 0.03;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Header Hero Section */
.hero {
  background: var(--primary-gradient);
  color: white;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="white" opacity="0.1"><polygon points="0,0 1000,100 1000,0"/></svg>');
  background-size: 100% 100%;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero-text .subtitle {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  font-weight: 400;
  color: rgba(255,255,255,0.95);
}

.hero-image {
  text-align: center;
}

.profile-image {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid rgba(255,255,255,0.2);
  box-shadow: var(--shadow-xl);
  transition: var(--transition);
  animation: float 3s ease-in-out infinite;
}

.profile-image:hover {
  transform: scale(1.05);
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

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

/* Navigation */
.nav {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: var(--transition);
}

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

.nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  padding: 1rem 0;
  gap: 2rem;
}

.nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.nav a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  transition: var(--transition);
  z-index: -1;
}

.nav a:hover::before {
  left: 0;
}

.nav a:hover {
  color: white;
  transform: translateY(-1px);
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-primary);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 500;
}

/* Cards */
.card {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

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

/* Project Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.project-card {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border-light);
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--tech-gradient);
}

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.project-content {
  padding: 2rem;
}

.project-card h3 {
  color: var(--primary-color);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--primary-gradient);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  color: white;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

.btn-secondary {
  background: var(--secondary-gradient);
}

.btn-white {
  background: white;
  color: var(--text-primary);
  border: 2px solid white;
  font-weight: 600;
}

.btn-white:hover {
  background: #f7fafc;
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Tech Badges */
.tech-badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  color: #1f2937;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.25rem;
  border: 1px solid #d1d5db;
  transition: var(--transition);
}

.tech-badge:hover {
  background: var(--primary-gradient);
  color: white;
  transform: scale(1.05);
}

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

.skill-category {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.skill-category h3 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.stat-card {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.stat-card:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: white !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Asegurar que las estadísticas del hero también sean blancas */
.hero-stats .stat-number,
.stat-item .stat-number {
  color: white !important;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

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

.contact-card {
  background: var(--bg-white);
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

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

.contact-icon {
  width: 60px;
  height: 60px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
  font-size: 1.5rem;
}

/* Footer */
.footer {
  background: var(--dark-gradient);
  color: white;
  text-align: center;
  padding: 3rem 0;
  margin-top: 6rem;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

/* GitHub Stats Styling */
.github-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 3rem 0;
}

.github-stats img {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.github-stats img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .profile-image {
    width: 200px;
    height: 200px;
  }
  
  .nav ul {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .container {
    padding: 2rem 1rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-text h1 {
    font-size: 2.5rem;
  }

  .github-stats {
    flex-direction: column;
    align-items: center;
  }

  .github-stats img {
    max-width: 100%;
    height: auto;
  }
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-up {
  animation: slideInUp 0.8s ease-out;
}

.animate-slide-left {
  animation: slideInLeft 0.8s ease-out;
}

/* Scroll animations */
.fade-in-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

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

/* Loading animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Code block styling */
pre, code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background: var(--bg-light);
  border-radius: var(--border-radius);
  padding: 0.5rem;
}

pre {
  padding: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border-light);
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--bg-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
}

tr:hover {
  background: var(--bg-light);
}

/* Blockquote styling */
blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 1rem 2rem;
  margin: 2rem 0;
  background: var(--bg-light);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
}

/* Link styling */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* List styling */
ul, ol {
  padding-left: 2rem;
  margin: 1rem 0;
}

li {
  margin: 0.5rem 0;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.back-to-top:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
}

.back-to-top.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.loading-spinner {
  text-align: center;
  color: white;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top: 3px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p {
  font-size: 1.1rem;
  font-weight: 500;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: transform 0.3s ease;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-full {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
  background: white;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.main-nav a:hover,
.main-nav a.active {
  color: white;
  background: var(--primary-gradient);
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Page Content */
.page-content {
  padding-top: 80px; /* Space for fixed header */
  min-height: calc(100vh - 80px);
}

/* Footer Styles */
.footer {
  background: var(--dark-gradient);
  color: white;
  padding: 3rem 0 1rem;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  margin: 0.5rem 0;
}

.footer-section a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: var(--transition);
}

.footer-section a:hover {
  color: white;
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  margin-top: 2rem;
}

.footer-bottom p {
  margin: 0.5rem 0;
  color: rgba(255,255,255,0.9);
  font-size: 0.9rem;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .dark-mode {
    --bg-white: #1a1a1a;
    --bg-light: #2d2d2d;
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e0;
    --border-light: #4a5568;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
  }
  
  .logo-full {
    display: none;
  }
  
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .main-nav ul {
    flex-direction: column;
    padding: 1rem;
    gap: 0;
  }
  
  .main-nav li {
    border-bottom: 1px solid var(--border-light);
  }
  
  .main-nav li:last-child {
    border-bottom: none;
  }
  
  .main-nav a {
    display: block;
    padding: 1rem;
    text-align: center;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}