.diagram-button {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.diagram-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
}

.content {
    display: grid;
    grid-template-columns: 1fr 600px;
    gap: 30px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.components-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.component-card {
    background: white;
    border-radius: 12px;
    padding: 5px;
    border: 3px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 130px;
    display: flex;
    flex-direction: column;
}

.component-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.component-card:nth-child(1)::before { background: linear-gradient(90deg, #1976D2, #64B5F6); }
.component-card:nth-child(2)::before { background: linear-gradient(90deg, #388E3C, #66BB6A); }
.component-card:nth-child(3)::before { background: linear-gradient(90deg, #D32F2F, #EF5350); }
.component-card:nth-child(4)::before { background: linear-gradient(90deg, #7B1FA2, #AB47BC); }
.component-card:nth-child(5)::before { background: linear-gradient(90deg, #F57C00, #FFA726); }
.component-card:nth-child(6)::before { background: linear-gradient(90deg, #00897B, #26A69A); }
.component-card:nth-child(7)::before { background: linear-gradient(90deg, #5D4037, #8D6E63); }
.component-card:nth-child(8)::before { background: linear-gradient(90deg, #546E7A, #78909C); }
.component-card:nth-child(9)::before { background: linear-gradient(90deg, #37474F, #607D8B); }

.component-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.component-card.active {
    border-color: #1976D2;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    box-shadow: 0 8px 20px rgba(25, 118, 210, 0.3);
}

.component-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.component-title {
    font-size: 14px;
    font-weight: bold;
    color: #1a237e;
    margin-bottom: 8px;
}

.component-description {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.detail-panel {
    background: #f9f9f9;
    border: 3px solid #1976D2;
    border-radius: 12px;
    padding: 25px;
    animation: slideIn 0.3s ease;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
    min-height: 600px;
}

.detail-panel.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #666;
    font-style: italic;
    border-style: dashed;
}

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

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1976D2;
}

.detail-title {
    font-size: 20px;
    color: #1a237e;
    font-weight: bold;
    line-height: 1.3;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h3 {
    color: #1976D2;
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section h4 {
    color: #1a237e;
    margin: 15px 0 8px 0;
    font-size: 15px;
}

.detail-section p {
    line-height: 1.6;
    color: #333;
    margin-bottom: 10px;
}

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

.detail-section li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.5;
}

.detail-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #1976D2;
    font-weight: bold;
}

.activity-item, .deliverable-item, .gate-item, .risk-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.activity-item { border-left: 4px solid #1976D2; }
.deliverable-item { border-left: 4px solid #388E3C; }
.gate-item { border-left: 4px solid #7B1FA2; }
.risk-item { border-left: 4px solid #F57C00; }

.activity-title, .deliverable-title, .gate-title, .risk-title {
    font-weight: bold;
    color: #1a237e;
    margin-bottom: 8px;
    font-size: 15px;
}

.activity-description, .deliverable-description, .gate-description, .risk-description {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

/* Estilos para el modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Nuevos estilos para enlaces de herramientas */
.tool-link {
    display: inline-block;
    background: #1976D2;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.tool-link:hover {
    background: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.tool-links-container {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

@media (max-width: 1200px) {
    .content {
        grid-template-columns: 1fr;
    }
    
    .detail-panel {
        position: relative;
        top: 0;
        max-height: none;
        min-height: 400px;
    }
    
    .components-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 20px 15px;
    }
    
    .back-button, .diagram-button {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        transform: none;
        margin: 10px 5px;
        display: inline-block;
    }
    
    .header h1 {
        font-size: 24px;
    }
}