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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: #333;
    overflow: hidden;
}

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

.presentation-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.slide {
    width: 100%;
    height: 100%;
    padding: 40px;
    display: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: absolute;
    top: 0;
    left: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.5s ease;
}

.slide.active {
    display: flex;
    flex-direction: column;
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header estilo Warsaw mejorado */
.slide-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px 30px;
    margin: -40px -40px 30px -40px;
    position: relative;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 8px 30px rgba(30, 60, 114, 0.3);
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.slide-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

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

.slide-header h1 {
    font-size: 2.2em;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.slide-header h2 {
    font-size: 1.8em;
    font-weight: 600;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.2);
}

/* Slide de título mejorado */
.title-slide {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: white;
    text-align: center;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.title-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite alternate;
}

@keyframes float {
    0% { transform: translate(0px, 0px) rotate(0deg); }
    100% { transform: translate(30px, -30px) rotate(10deg); }
}

.title-slide h1 {
    font-size: 3.8em;
    margin-bottom: 30px;
    text-shadow: 3px 3px 12px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
    font-weight: 800;
    letter-spacing: -1px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 3px 3px 12px rgba(0,0,0,0.5); }
    100% { text-shadow: 3px 3px 20px rgba(255,255,255,0.3), 3px 3px 12px rgba(0,0,0,0.5); }
}

.title-slide .authors {
    font-size: 1.4em;
    margin-bottom: 25px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    font-weight: 500;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
}

.title-slide .institute {
    font-size: 1.1em;
    margin-bottom: 30px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
    line-height: 1.6;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
}

.title-slide .date {
    font-size: 1.3em;
    font-weight: 600;
    position: relative;
    z-index: 1;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
}

/* Contenido principal */
.slide-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Columnas */
.columns {
    display: flex;
    gap: 20px;
    flex: 1;
}

.column {
    flex: 1;
}

/* Bloques mejorados */
.block {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(30, 60, 114, 0.2);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08), 0 2px 8px rgba(30, 60, 114, 0.1);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.block::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 60, 114, 0.1), transparent);
    transition: left 0.6s ease;
}

.block:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15), 0 5px 15px rgba(30, 60, 114, 0.2);
    border-color: rgba(30, 60, 114, 0.4);
}

.block:hover::before {
    left: 100%;
}

.block h3 {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 15px 20px;
    margin: -25px -25px 20px -25px;
    border-radius: 15px 15px 0 0;
    font-size: 1.3em;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

/* Nuevos estilos para métricas de cocreación */
.metrics-grid {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.metric-card {
    background: linear-gradient(135deg, #4facfe 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 140px;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
    transition: transform 0.3s ease;
}

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

.metric-value {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.metric-label {
    font-size: 0.9em;
    opacity: 0.9;
    font-weight: 500;
}

/* Estilos para estadísticas de fases */
.phase-stats {
    background: rgba(30, 60, 114, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #1e3c72;
    display: block;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

/* Estilos para sprints legend */
.sprint-legend {
    background: rgba(248, 250, 252, 0.8);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(30, 60, 114, 0.1);
}

.sprint-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(30, 60, 114, 0.05);
}

.sprint-item:last-child {
    border-bottom: none;
}

.sprint-code {
    background: linear-gradient(135deg, #4facfe 0%, #2a5298 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 10px;
    min-width: 35px;
    text-align: center;
    font-size: 0.8em;
}

/* Estilos para ruta crítica */
.critical-path {
    background: linear-gradient(145deg, #f8fafc 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(30, 60, 114, 0.2);
}

.path-phase {
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(79, 172, 254, 0.1);
    border-radius: 8px;
    border-left: 4px solid #4facfe;
}

.path-phase h4 {
    color: #1e3c72;
    font-size: 1.1em;
    margin-bottom: 8px;
    font-weight: 600;
}

.path-detail {
    font-size: 0.9em;
    color: #555;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: 4px;
    line-height: 1.4;
}

.task-desc {
    background: rgba(79, 172, 254, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    color: #1e3c72;
    font-size: 0.85em;
    margin: 2px;
    display: inline-block;
}

.path-arrow {
    text-align: center;
    font-size: 1.5em;
    color: #2a5298;
    font-weight: bold;
    margin: 10px 0;
}

/* Estilos para métricas de calidad ampliadas */
.quality-metrics {
    background: rgba(248, 250, 252, 0.8);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(30, 60, 114, 0.1);
}

.quality-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(30, 60, 114, 0.1);
}

.quality-row:last-child {
    border-bottom: none;
}

.metric-name {
    font-weight: 600;
    color: #1e3c72;
    flex: 1;
}

.metric-target {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #2a5298;
    background: rgba(79, 172, 254, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* Listas */
ul {
    list-style: none;
    padding-left: 0;
}

li {
    margin: 8px 0;
    padding: 5px 0 5px 20px;
    position: relative;
}

li::before {
    content: "▶";
    color: #2c5282;
    position: absolute;
    left: 0;
    font-size: 0.8em;
}

/* Texto en negrita */
.bold {
    font-weight: bold;
    color: #2c5282;
}

/* Imágenes con zoom mejoradas */
.image-container {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.zoomable-image {
    max-width: 100%;
    max-height: 400px;
    cursor: pointer;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
    border: 2px solid rgba(30, 60, 114, 0.2);
}

.zoomable-image:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    border-color: rgba(30, 60, 114, 0.4);
}

/* Modal para zoom de imágenes */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.98);
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 98%;
    max-height: 98%;
    border-radius: 10px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.8);
    transition: transform 0.4s ease;
    cursor: zoom-out;
    object-fit: contain;
}

.modal-content:hover {
    transform: translate(-50%, -50%) scale(1.01);
}

.close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 60px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.8);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.close:hover {
    background: rgba(220,20,20,0.9);
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(220,20,20,0.5);
}

/* Indicador de zoom */
.zoom-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.8);
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 15px;
    z-index: 1001;
    opacity: 0.9;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

/* Controles de navegación mejorados */
.navigation {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.9) 0%, rgba(42, 82, 152, 0.9) 100%);
    backdrop-filter: blur(15px);
    padding: 12px 24px;
    border-radius: 25px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.nav-button {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    margin: 0 5px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
    background: linear-gradient(135deg, #2a5298 0%, #4facfe 100%);
}

.nav-button:disabled {
    background: linear-gradient(135deg, #a0a0a0 0%, #808080 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.slide-counter {
    color: white;
    margin: 0 15px;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Matriz de riesgos */
.risk-matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.risk-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #333;
    border-radius: 8px;
    font-size: 0.9em;
}

.risk-low { background-color: #4CAF50; color: black; }
.risk-medium { background-color: #FFEB3B; color: black; }
.risk-high { background-color: #FF9800; color: black; }
.risk-critical { background-color: #F44336; color: white; }

/* Leyenda de la matriz */
.matrix-legend {
    text-align: center;
    margin-top: 20px;
}

.axis-label {
    font-weight: bold;
    font-size: 1.1em;
    margin: 10px 0;
}

/* Contenedor con scroll para diagramas */
.scrollable-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
    height: 100%;
    max-height: calc(100vh - 120px);
}

.diagram-container {
    text-align: center;
    padding: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.large-diagram {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    min-width: 1400px;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    margin: 20px 0;
    display: block;
}

.large-diagram:hover {
    transform: scale(1.01);
}

.diagram-title {
    font-size: 1.4em;
    color: #2c5282;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

.diagram-description {
    max-width: 800px;
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
    text-align: center;
    margin-bottom: 20px;
}

/* Scroll personalizado */
.scrollable-content::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.scrollable-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.scrollable-content::-webkit-scrollbar-thumb {
    background: #3182ce;
    border-radius: 6px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
    background: #2c5282;
}

/* Estilos específicos para la matriz de riesgos mejorada */

/* Tabla de riesgos */
.risk-table-container {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
}

.risk-table {
    width: 100%;
    font-size: 0.85em;
    border-collapse: collapse;
}

.risk-table thead th {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    position: sticky;
    top: 0;
    border: 1px solid #ddd;
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    z-index: 10;
}

.risk-table thead th:first-child {
    width: 8%;
}

.risk-table thead th:nth-child(2) {
    width: 70%;
    text-align: left;
}

.risk-table thead th:last-child {
    width: 22%;
}

.risk-table tbody td {
    border: 1px solid #ddd;
    padding: 8px;
    transition: background-color 0.2s ease;
}

.risk-table tbody tr:hover {
    background-color: rgba(79, 172, 254, 0.1);
}

.risk-id {
    text-align: center;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    background: rgba(30, 60, 114, 0.1);
}

/* Categorías de riesgo con colores */
.risk-critical {
    background-color: #d32f2f;
    color: white;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

.risk-high {
    background-color: #ff9800;
    color: white;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

.risk-medium {
    background-color: #fbc02d;
    color: black;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

.risk-low {
    background-color: #4caf50;
    color: white;
    text-align: center;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

/* Layout específico para matriz de riesgos en 3 columnas */
.risk-matrix-layout {
    gap: 15px;
    align-items: flex-start;
}

.risk-table-column {
    flex: 1;
    max-width: 35%;
    display: flex;
    flex-direction: column;
}

.matrix-visual-column {
    flex: 0.8;
    max-width: 30%;
}

.info-details-column {
    flex: 1;
    max-width: 35%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Permitir que la tabla ocupe más espacio vertical */
.risk-table-column .block {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Ajustes para la tabla en columna */
.risk-table-container {
    flex: 1;
    min-height: 475px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
}

.risk-table thead th:nth-child(2) {
    width: 60%;
    text-align: left;
}

.risk-table thead th:last-child {
    width: 25%;
}

.matrix-image {
    max-height: 350px;
}

/* Bloques específicos */
.scales-block {
    margin-bottom: 15px;
}

.scales-content {
    font-size: 0.9em;
}

.scale-section {
    margin-bottom: 15px;
}

.scale-section h4 {
    color: #1e3c72;
    margin-bottom: 8px;
    font-size: 1em;
    font-weight: 600;
}

.scale-list {
    margin: 5px 0 10px 0;
}

.scale-list li {
    margin: 5px 0;
    padding: 3px 0 3px 15px;
    font-size: 0.85em;
}

.scale-list li::before {
    content: "•";
    color: #2a5298;
    font-size: 1.2em;
}

.scale-label {
    font-weight: 600;
    color: #1e3c72;
}

/* Acciones por nivel */
.actions-block {
    margin-bottom: 20px;
    min-height: 180px;
}

.actions-content {
    font-size: 0.85em;
    max-height: none;
    overflow: visible;
}

.action-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 6px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.action-item:hover {
    background: rgba(79, 172, 254, 0.1);
}

.action-color {
    width: 15px;
    height: 15px;
    margin-right: 10px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.risk-low-color {
    background-color: #4caf50;
}

.risk-medium-color {
    background-color: #fbc02d;
}

.risk-high-color {
    background-color: #ff9800;
}

.risk-critical-color {
    background-color: #d32f2f;
}

.action-label {
    font-weight: 600;
    color: #1e3c72;
}

@media (max-width: 768px) {
    .slide {
        padding: 20px;
    }
    
    .columns {
        flex-direction: column;
    }
    
    .slide-header h1 {
        font-size: 1.8em;
    }
    
    .title-slide h1 {
        font-size: 2.5em;
    }
    
    .metrics-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .metric-card {
        min-width: 200px;
    }
    
    .quality-row {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    .metric-target {
        align-self: flex-end;
    }
    
    /* Ajustes para matriz de riesgos en móvil */
    .matrix-column,
    .info-column {
        flex: 1;
    }
    
    .risk-table {
        font-size: 0.75em;
    }
    
    .risk-table thead th {
        padding: 6px 4px;
    }
    
    .risk-table tbody td {
        padding: 6px 4px;
    }
    
    .action-item {
        font-size: 0.8em;
    }
    
    .scales-content {
        font-size: 0.8em;
    }
}