/* ================================================
   PROYECTOS PAGE - MODERN STYLES v2.0
   Inspirado en Awwwards, Behance y Linear.app
   ================================================ */

:root {
  --pro-bg-dark: #0a0f1a;
  --pro-bg-card: rgba(255, 255, 255, 0.03);
  --pro-card-bg: rgba(20, 25, 35, 0.6);
  --pro-text: #e5e7eb;
  --pro-text-muted: #9ca3af;
  --pro-accent: #ffc107;
  --pro-accent-glow: rgba(255, 193, 7, 0.3);
  --pro-primary: #29b6f6;
  --pro-primary-glow: rgba(41, 182, 246, 0.3);
  --pro-danger: #ef4444;
  --pro-border: rgba(255, 255, 255, 0.06);
  --pro-overlay: rgba(10, 15, 26, 0.85);
  --pro-shadow: 0 10px 40px rgba(0,0,0,0.4);
  --pro-radius: 20px;
  --pro-radius-sm: 12px;
}

/* Header/Nav styles are now in main.css - consolidated */

/* ==================== HERO SECTION - CYBER-MESH DARK ==================== */
.proyectos-hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0f1a;
  overflow: hidden;
  padding-top: 120px;
  padding-bottom: 100px;
}

/* Gradiente base elegante */
.proyectos-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(41, 182, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 193, 7, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(10, 15, 26, 1) 0%, transparent 70%);
  z-index: 0;
  animation: meshShift 20s ease-in-out infinite alternate;
}

@keyframes meshShift {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(2deg); }
}

/* Technical Grid */
.proyectos-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
      linear-gradient(rgba(41, 182, 246, 0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(41, 182, 246, 0.05) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 1;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black, transparent 80%);
}

/* Orbe flotante animado */
.proyectos-hero .hero-gradient-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(41,182,246,0.15) 0%, rgba(255,193,7,0.08) 50%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  filter: blur(80px);
  animation: orbFloat 10s ease-in-out infinite;
  z-index: 1;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33% { transform: translate(-50%, -60%) scale(1.15); }
  66% { transform: translate(-45%, -50%) scale(0.9); }
}

/* Partículas 3D canvas */
#particles.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  opacity: 0.4;
}

.proyectos-hero .container {
  position: relative;
  z-index: 10;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(240, 180, 41, 0.1);
  border: 1px solid rgba(240, 180, 41, 0.3);
  padding: 10px 20px;
  border-radius: 50px;
  color: var(--accent);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  animation: badgePulse 3s ease-in-out infinite;
}

.hero-badge i {
  font-size: 1.2rem;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 180, 41, 0.25); }
  50% { box-shadow: 0 0 20px 5px rgba(240, 180, 41, 0.15); }
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 9vw, 6rem);
  line-height: 1;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
  text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

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

.hero-subtitle {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2.5rem;
  line-height: 1.7;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-top: 40px;
}

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

.stat-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  line-height: 1;
}

.stat-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ==================== FILTER BUTTONS ==================== */
.projects-filters {
  position: relative;
  z-index: 20;
  margin-top: -40px;
  margin-bottom: 60px;
  padding: 0 20px;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 8px;
}

.filter-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
}

.filter-btn i, .filter-btn span, .count-badge {
  position: relative;
  z-index: 1;
}

.filter-btn:hover {
  color: #fff;
}

.filter-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 30px rgba(41, 182, 246, 0.3);
}

.count-badge {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.8rem;
}

.filter-btn.active .count-badge {
  background: rgba(0, 0, 0, 0.2);
}

/* ==================== PROJECTS GRID ==================== */
.projects-section {
  position: relative;
  z-index: 10;
  padding-top: 40px;
  padding-bottom: 120px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(41, 182, 246, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(240, 180, 41, 0.03) 0%, transparent 50%);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* ==================== PROJECT CARD - MEJORADO ==================== */
.project-card {
  background: #1a1f2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  perspective: 1000px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(40px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  border-color: rgba(41, 182, 246, 0.3);
}

.card-image {
  position: relative;
  height: 220px;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .card-image img {
  transform: scale(1.08);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 32, 39, 0.95) 0%, rgba(15, 32, 39, 0.3) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-card:hover .card-overlay {
  opacity: 1;
}

.card-badge {
  background: rgba(240, 180, 41, 0.15);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 50px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border: 1px solid rgba(240, 180, 41, 0.25);
}

.card-title-overlay {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  color: #fff;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.card-btn-ver {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 50px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(240, 180, 41, 0.25);
}

.card-btn-ver:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(240, 180, 41, 0.4);
}

.card-content {
  padding: 1.5rem;
  position: relative;
}

.card-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  gap: 10px;
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== CTA SECTION ==================== */
.cta-section {
  position: relative;
  background: linear-gradient(135deg, #0a1628, #0d2040, #1a1a2e);
  padding: 100px 0;
  text-align: center;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 40%, rgba(41, 182, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 60%, rgba(240, 180, 41, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(229, 57, 53, 0.05) 0%, transparent 50%);
  z-index: 0;
  animation: gradientShift 15s ease-in-out infinite;
  background-size: 150% 150%;
}

.cta-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(41, 182, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 182, 246, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 1;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black, transparent 80%);
}

.cta-section .container {
  position: relative;
  z-index: 10;
}

.cta-section h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}

.cta-section h2 span {
  color: var(--accent);
}

.cta-section p {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  padding: 18px 40px;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 8px 30px rgba(240, 180, 41, 0.25);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s ease;
}

.btn-cta:hover::before {
  left: 100%;
}

.btn-cta:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 16px 50px rgba(240, 180, 41, 0.4);
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 39, 0.95);
  backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  background: #fff;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  overflow: hidden;
  transform: scale(0.95) translateY(30px);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-overlay.open .modal-container {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(240, 180, 41, 0.2);
  border-color: var(--accent);
  transform: rotate(90deg);
}

/* Galería */
.modal-gallery {
  background: #000;
  position: relative;
}

.gallery-main-wrapper {
  position: relative;
  height: 100%;
  min-height: 500px;
}

.gallery-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-main-wrapper:hover .gallery-nav {
  opacity: 1;
}

.gallery-nav button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-nav button:hover {
  background: var(--accent);
  color: #000;
}

.gallery-thumbs {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  border-radius: 50px;
}

.thumb {
  width: 60px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  background: none;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.active {
  border-color: var(--accent);
  transform: scale(1.1);
}

/* Detalles */
.modal-details {
  padding: 40px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.modal-header {
  margin-bottom: 1.5rem;
}

.modal-category-badge {
  display: inline-block;
  background: rgba(240, 180, 41, 0.15);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 50px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
  border: 1px solid rgba(240, 180, 41, 0.25);
}

.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.modal-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: rgba(240, 180, 41, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

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

.stat-item .stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

.stat-item .stat-value {
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-partners {
  margin-bottom: 1.5rem;
}

.modal-partners h4 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.partners-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.partner-pill {
  background: rgba(240, 180, 41, 0.1);
  border: 1px solid rgba(240, 180, 41, 0.2);
  padding: 6px 14px;
  border-radius: 50px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.partner-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
}

/* ==================== ANIMATIONS ==================== */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .hero-stats {
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .proyectos-hero {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 60px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 25px;
    margin-top: 30px;
  }

  .stat-number {
    font-size: 2.8rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .filter-buttons {
    flex-direction: column;
    border-radius: 20px;
  }

  .projects-filters {
    margin-top: -10px;
  }

  .modal-container {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
  }

  .gallery-main-wrapper {
    min-height: 280px;
  }

  .modal-details {
    padding: 20px;
  }

  .modal-stats {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: left;
  }

  .card-image {
    height: 200px;
  }
}

/* Estilos para secciones de productos y proyectos ejecutados */
.section {
  padding: 80px 0;
  background: var(--bg-primary);
}

.section-title {
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 1.2rem;
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 60px;
}

.highlight {
  color: var(--accent);
}

.productos-grid, .proyectos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.producto-card, .proyecto-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
}

.producto-card:hover, .proyecto-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(240, 180, 41, 0.2);
}

.card-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2rem;
  color: white;
}

.producto-card h3, .proyecto-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.producto-card ul, .proyecto-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.producto-card li, .proyecto-list li {
  padding: 8px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.producto-card li:last-child, .proyecto-list li:last-child {
  border-bottom: none;
}

@media (max-width: 768px) {
  .productos-grid, .proyectos-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .section-title {
    font-size: 2.5rem;
  }
}