/* 
 * Nuvalid Roadmap CSS - Estilo y Diseño Premium
 * Colores: Principal #4459A3, Fondo #F8F8F8
 * Tipografías: Poppins (Títulos), Brevia (Cuerpo / Nunito como fallback)
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Nunito:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --primary-color: #4459A3;
  --primary-color-rgb: 68, 89, 163;
  --bg-color: #F8F8F8;
  --card-bg: #ffffff;
  --text-main: #2b354f;
  --text-muted: #5e6b8c;
  --border-color: rgba(68, 89, 163, 0.12);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 20px -5px rgba(68, 89, 163, 0.08), 0 4px 6px -2px rgba(68, 89, 163, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(68, 89, 163, 0.12), 0 10px 10px -5px rgba(68, 89, 163, 0.04);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-headings: 'Poppins', sans-serif;
  --font-body: 'Brevia', 'Nunito', 'Segoe UI', sans-serif;
}

/* Base resets & styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(68, 89, 163, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(68, 89, 163, 0.03) 0%, transparent 40%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 700;
  color: var(--primary-color);
}

/* Page Layout */
.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Header Section */
header {
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.badge {
  display: inline-block;
  background-color: rgba(68, 89, 163, 0.1);
  color: var(--primary-color);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  border: 1px solid rgba(68, 89, 163, 0.2);
}

header h1 {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  font-weight: 800;
  text-transform: capitalize;
  background: linear-gradient(135deg, var(--primary-color) 0%, #6e7fc5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Context / Diagnostico */
.diagnostico-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

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

.diagnostico-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--primary-color);
}

.diagnostico-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.diagnostico-card p {
  color: var(--text-main);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Interactive Controls & Filters */
.controls-bar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

@media(min-width: 768px) {
  .controls-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-btn:hover {
  background-color: rgba(68, 89, 163, 0.05);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(68, 89, 163, 0.35);
}

/* View Toggles */
.view-toggles {
  display: flex;
  background: var(--bg-color);
  padding: 0.25rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
}

.toggle-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-btn.active {
  background: var(--card-bg);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* Stage Navigation Tabs */
.stages-tabs {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  margin-bottom: 3rem;
  padding-bottom: 0.75rem;
  scrollbar-width: thin;
}

.stages-tabs::-webkit-scrollbar {
  height: 6px;
}

.stages-tabs::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 10px;
}

.stage-tab {
  flex: 1;
  min-width: 220px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.stage-tab:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.stage-tab.active {
  background: linear-gradient(135deg, var(--primary-color) 0%, #586eb7 100%);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.stage-tab.active h3, .stage-tab.active p {
  color: #ffffff;
}

.stage-tab h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  transition: var(--transition-smooth);
}

.stage-tab p {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: var(--transition-smooth);
}

/* Timeline Layout (Linear Timeline View) */
.timeline-container {
  position: relative;
  margin-bottom: 4rem;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.75rem;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary-color) 0%, rgba(68, 89, 163, 0.2) 100%);
  border-radius: 10px;
}

@media(min-width: 1024px) {
  .timeline-container::before {
    left: 50%;
    transform: translateX(-50%);
  }
}

.timeline-stage-header {
  position: relative;
  z-index: 2;
  margin-bottom: 3rem;
  display: flex;
  justify-content: flex-start;
}

@media(min-width: 1024px) {
  .timeline-stage-header {
    justify-content: center;
  }
}

.stage-header-bubble {
  background: var(--primary-color);
  color: #ffffff;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 10px 20px rgba(68, 89, 163, 0.35);
  border: 4px solid var(--bg-color);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.stage-header-bubble span {
  font-size: 0.8rem;
  opacity: 0.85;
  font-weight: 500;
  text-transform: uppercase;
}

/* Timeline Node Cards */
.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  display: flex;
  width: 100%;
}

@media(min-width: 1024px) {
  .timeline-item {
    margin-bottom: 3.5rem;
  }
}

.timeline-dot {
  position: absolute;
  left: 1.75rem;
  top: 1.5rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--primary-color);
  transform: translateX(-50%);
  z-index: 5;
  box-shadow: 0 0 0 5px var(--bg-color);
  transition: var(--transition-smooth);
}

@media(min-width: 1024px) {
  .timeline-dot {
    left: 50%;
  }
}

.timeline-item:hover .timeline-dot {
  background: var(--primary-color);
  transform: translateX(-50%) scale(1.3);
  box-shadow: 0 0 0 8px rgba(68, 89, 163, 0.2), 0 0 0 5px var(--bg-color);
}

.timeline-content-wrapper {
  width: 100%;
  padding-left: 3.5rem;
}

@media(min-width: 1024px) {
  .timeline-content-wrapper {
    width: 46%;
    padding-left: 0;
  }
  
  .timeline-item.left-aligned {
    justify-content: flex-start;
  }
  
  .timeline-item.right-aligned {
    justify-content: flex-end;
  }
  
  .timeline-item.right-aligned .timeline-content-wrapper {
    padding-left: 0;
  }
}

.roadmap-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.roadmap-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(68, 89, 163, 0.3);
}

.card-category-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

.category-desarrollo {
  background-color: rgba(68, 89, 163, 0.08);
  color: var(--primary-color);
  border: 1px solid rgba(68, 89, 163, 0.15);
}

.category-marketing {
  background-color: rgba(234, 155, 33, 0.08);
  color: #ea9b21;
  border: 1px solid rgba(234, 155, 33, 0.15);
}

.roadmap-card p {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.6;
}

.roadmap-card-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Grid View Layout */
.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
}

@media(min-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(min-width: 1200px) {
  .grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-stage-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  height: fit-content;
  transition: var(--transition-smooth);
}

.grid-stage-section:hover {
  box-shadow: var(--shadow-lg);
}

.grid-stage-title {
  font-size: 1.25rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--primary-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid-stage-title span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.grid-items-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Risk Section Styling */
.risks-section {
  margin-top: 5rem;
  background: linear-gradient(135deg, #FFF9F9 0%, #FFF5F5 100%);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 24px;
  padding: 3rem 2rem;
  box-shadow: 0 15px 35px -10px rgba(239, 68, 68, 0.05);
}

.risks-section h2 {
  color: #dc2626;
  font-size: 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.risks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media(min-width: 1024px) {
  .risks-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.risk-card {
  background: #ffffff;
  border: 1px solid rgba(239, 68, 68, 0.12);
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.risk-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.25);
}

.risk-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: #dc2626;
}

.risk-number {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.risk-card h3 {
  color: #1e293b;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.risk-card p {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
}

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

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Footer Styling */
footer {
  margin-top: 5rem;
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}
